Currently, when running the following two commands in a new prefix: wine reg query 'HKLM\Software\Microsoft\Cryptography' /v MachineGuid wine64 reg query 'HKLM\Software\Microsoft\Cryptography' /v MachineGuid
Two different values are returned. This can cause an issue when, for example, a 32-bit Launcher and 64-bit application expect the same value.
This patch ensures that when the 64-bit GUID is created, the 32-bit GUID is created as well (with the same value).
Signed-off-by: Brendan McGrath brendan@redmandi.com ---
I considered a few options on how to achieve this; but ended up with this option as it seemed the simplest. However, it does leave the possiblity for an application or user to change one and leave the other.
I did note that Windows doesn't appear to have a MachineGuid entry for WoW, so it looks like Windows just uses the one entry. But I wasn't sure of the best way to achieve that in Wine (and couldn't find a precedent).
dlls/advapi32/crypt.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/dlls/advapi32/crypt.c b/dlls/advapi32/crypt.c index 01d58804235..0ea64b52226 100644 --- a/dlls/advapi32/crypt.c +++ b/dlls/advapi32/crypt.c @@ -313,6 +313,14 @@ static void CRYPT_CreateMachineGuid(void) RegSetValueExW(key, machineGuidW, 0, REG_SZ, (const BYTE *)buf, (lstrlenW(buf)+1)*sizeof(WCHAR)); + r = RegOpenKeyExW(HKEY_LOCAL_MACHINE, cryptographyW, 0, + KEY_ALL_ACCESS | KEY_WOW64_32KEY, &key); + if (!r) + { + RegSetValueExW(key, machineGuidW, 0, REG_SZ, + (const BYTE *)buf, + (lstrlenW(buf)+1)*sizeof(WCHAR)); + } } } RegCloseKey(key);