Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/155.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 硬件配置文件信息Windows 8.1错误_C++_Guid_Hwid - Fatal编程技术网

C++ 硬件配置文件信息Windows 8.1错误

C++ 硬件配置文件信息Windows 8.1错误,c++,guid,hwid,C++,Guid,Hwid,我正在使用这段代码来唯一标识计算机,但它似乎不能在Windows 8.1上正常工作 HW_PROFILE_INFO HwProfInfo; if (!GetCurrentHwProfile(&HwProfInfo)) return; std::wstring ws(HwProfInfo.szHwProfileGuid); std::string GUID(ws.begin(), ws.end()); printf("%s\n", GUID.c_str()); 每个Windo

我正在使用这段代码来唯一标识计算机,但它似乎不能在Windows 8.1上正常工作

HW_PROFILE_INFO HwProfInfo;
if (!GetCurrentHwProfile(&HwProfInfo))
    return;

std::wstring ws(HwProfInfo.szHwProfileGuid);
std::string GUID(ws.begin(), ws.end());

printf("%s\n", GUID.c_str());
每个Windows 8.1计算机都会生成此GUID:

{bbed3e02-0b41-11e3-8249-806e6f6e6963}


这怎么可能或者我做错了什么?

这与Windows 7 IIRC中取消的硬件配置文件有关。此值仅是当前硬件配置文件的句柄(如果存在),并且仅用于配置设置,而不是唯一标识系统的键

对于该版本和更高版本的windows,它始终返回相同的值;我希望它仍然通过,以防止意外的应用程序失败

此值不应用于唯一标识计算机,因为它用于管理在系统对接/解锁/应用不同配置文件时发生变化的设置