Always access the 64-bit registry key to read MachineGuid
When running a 32bit application on a 64bit Windows, the call to open the key "HKLM/Software/Microsoft/Cryptography/MachineGuid" will by default be redirect to "HKLM/Software/WOW6432Node/Microsoft/Cryptography/MachineGuid" which does not exist. Instead access the 64bit key from either a 32bit or 64bit application. KEY_WOW64_64KEY has no effect on 32bit Windows. Change-Id: Ic5e13f99d08aef2658d58a52cffe66dbab0510b8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
2780f80fae
commit
166162d830
@ -2933,7 +2933,7 @@ QByteArray QSysInfo::machineUniqueId()
|
||||
#elif defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
|
||||
// Let's poke at the registry
|
||||
HKEY key = NULL;
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Cryptography", 0, KEY_READ, &key)
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Cryptography", 0, KEY_READ | KEY_WOW64_64KEY, &key)
|
||||
== ERROR_SUCCESS) {
|
||||
wchar_t buffer[UuidStringLen + 1];
|
||||
DWORD size = sizeof(buffer);
|
||||
|
Loading…
Reference in New Issue
Block a user