msi: More Wow64 fixes.

This commit is contained in:
Hans Leidekker 2011-04-06 09:52:16 +02:00 committed by Alexandre Julliard
parent 2cad663198
commit 88b4bbfc6a
3 changed files with 21 additions and 17 deletions

View File

@ -1571,11 +1571,11 @@ UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode,
r = ERROR_UNKNOWN_PATCH;
res = RegOpenKeyExW(udprod, szPatches, 0, KEY_READ, &patches);
res = RegOpenKeyExW(udprod, szPatches, 0, KEY_WOW64_64KEY|KEY_READ, &patches);
if (res != ERROR_SUCCESS)
goto done;
res = RegOpenKeyExW(patches, squished_patch, 0, KEY_READ, &patch);
res = RegOpenKeyExW(patches, squished_patch, 0, KEY_WOW64_64KEY|KEY_READ, &patch);
if (res != ERROR_SUCCESS)
goto done;
@ -1585,7 +1585,7 @@ UINT WINAPI MsiGetPatchInfoExW(LPCWSTR szPatchCode, LPCWSTR szProductCode,
&prod, FALSE) != ERROR_SUCCESS)
goto done;
res = RegOpenKeyExW(prod, szPatches, 0, KEY_ALL_ACCESS, &prodpatches);
res = RegOpenKeyExW(prod, szPatches, 0, KEY_WOW64_64KEY|KEY_ALL_ACCESS, &prodpatches);
if (res != ERROR_SUCCESS)
goto done;

View File

@ -150,9 +150,11 @@ static const WCHAR szInstaller_LocalClassesFeat[] = {
'I','n','s','t','a','l','l','e','r','\\','F','e','a','t','u','r','e','s','\\',0};
static const WCHAR szInstaller_ClassesUpgradeCode[] = {
'S','o','f','t','w','a','r','e','\\','C','l','a','s','s','e','s','\\',
'I','n','s','t','a','l','l','e','r','\\','U','p','g','r','a','d','e','C','o','d','e','s','\\',0};
static const WCHAR szInstaller_ClassesUpgradeCodes[] = {
'S','o','f','t','w','a','r','e','\\','C','l','a','s','s','e','s','\\',
'I','n','s','t','a','l','l','e','r','\\','U','p','g','r','a','d','e','C','o','d','e','s',0};
static const WCHAR szInstaller_Features[] = {
@ -991,8 +993,8 @@ UINT MSIREG_OpenClassesUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY *key, BOOL cr
strcpyW(keypath, szInstaller_ClassesUpgradeCode);
strcatW(keypath, squished_pc);
if (create) return RegCreateKeyExW(HKEY_CLASSES_ROOT, keypath, 0, NULL, 0, access, NULL, key, NULL);
return RegOpenKeyExW(HKEY_CLASSES_ROOT, keypath, 0, access, key);
if (create) return RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, key, NULL);
return RegOpenKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, access, key);
}
UINT MSIREG_DeleteClassesUpgradeCodesKey(LPCWSTR szUpgradeCode)
@ -1005,7 +1007,7 @@ UINT MSIREG_DeleteClassesUpgradeCodesKey(LPCWSTR szUpgradeCode)
if (!squash_guid(szUpgradeCode, squished_pc)) return ERROR_FUNCTION_FAILED;
TRACE("%s squished %s\n", debugstr_w(szUpgradeCode), debugstr_w(squished_pc));
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, szInstaller_ClassesUpgradeCodes, 0, access, &hkey)) return ERROR_SUCCESS;
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szInstaller_ClassesUpgradeCodes, 0, access, &hkey)) return ERROR_SUCCESS;
r = RegDeleteTreeW(hkey, squished_pc);
RegCloseKey(hkey);
return r;
@ -1143,6 +1145,7 @@ UINT WINAPI MsiEnumProductsW(DWORD index, LPWSTR lpguid)
UINT r;
WCHAR szKeyName[SQUISH_GUID_SIZE];
HKEY key;
REGSAM access = KEY_WOW64_64KEY | KEY_ALL_ACCESS;
DWORD machine_count, managed_count, unmanaged_count;
WCHAR keypath[MAX_PATH];
LPWSTR usersid = NULL;
@ -1158,7 +1161,7 @@ UINT WINAPI MsiEnumProductsW(DWORD index, LPWSTR lpguid)
return ERROR_INVALID_PARAMETER;
key = 0;
r = RegCreateKeyW(HKEY_LOCAL_MACHINE, szInstaller_LocalClassesProducts, &key);
r = RegCreateKeyExW(HKEY_LOCAL_MACHINE, szInstaller_LocalClassesProducts, 0, NULL, 0, access, NULL, &key, NULL);
if( r != ERROR_SUCCESS ) goto failed;
r = RegQueryInfoKeyW(key, NULL, NULL, NULL, &machine_count, NULL, NULL,
@ -1188,7 +1191,7 @@ UINT WINAPI MsiEnumProductsW(DWORD index, LPWSTR lpguid)
sprintfW(keypath, szInstaller_LocalManaged_fmt, usersid);
LocalFree(usersid);
r = RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, &key);
r = RegCreateKeyExW(HKEY_LOCAL_MACHINE, keypath, 0, NULL, 0, access, NULL, &key, NULL);
if( r != ERROR_SUCCESS ) goto failed;
r = RegQueryInfoKeyW(key, NULL, NULL, NULL, &managed_count, NULL, NULL,
@ -1301,21 +1304,22 @@ UINT WINAPI MsiEnumComponentsA(DWORD index, LPSTR lpguid)
UINT WINAPI MsiEnumComponentsW(DWORD index, LPWSTR lpguid)
{
HKEY hkeyComponents = 0;
DWORD r;
HKEY hkey;
REGSAM access = KEY_WOW64_64KEY | KEY_ALL_ACCESS;
WCHAR szKeyName[SQUISH_GUID_SIZE];
DWORD r;
TRACE("%d %p\n", index, lpguid);
r = RegCreateKeyW(HKEY_LOCAL_MACHINE, szInstaller_Components, &hkeyComponents);
r = RegCreateKeyExW(HKEY_LOCAL_MACHINE, szInstaller_Components, 0, NULL, 0, access, NULL, &hkey, NULL);
if( r != ERROR_SUCCESS )
return ERROR_NO_MORE_ITEMS;
r = RegEnumKeyW(hkeyComponents, index, szKeyName, SQUISH_GUID_SIZE);
r = RegEnumKeyW(hkey, index, szKeyName, SQUISH_GUID_SIZE);
if( r == ERROR_SUCCESS )
unsquash_guid(szKeyName, lpguid);
RegCloseKey(hkeyComponents);
RegCloseKey(hkey);
return r;
}

View File

@ -2781,8 +2781,8 @@ static void test_publish_product(void)
static const CHAR badprod[] = "Software\\Microsoft\\Windows\\CurrentVersion"
"\\Installer\\Products"
"\\84A88FD7F6998CE40A22FB59F6B9C2BB";
static const CHAR machprod[] = "Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
static const CHAR machup[] = "Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
static const CHAR machprod[] = "Software\\Classes\\Installer\\Products\\84A88FD7F6998CE40A22FB59F6B9C2BB";
static const CHAR machup[] = "Software\\Classes\\Installer\\UpgradeCodes\\51AAE0C44620A5E4788506E91F249BD2";
if (is_process_limited())
{
@ -2936,7 +2936,7 @@ currentuser:
RegCloseKey(hkey);
machprod:
res = RegOpenKeyExA(HKEY_CLASSES_ROOT, machprod, 0, access, &hkey);
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, machprod, 0, access, &hkey);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
CHECK_DEL_REG_STR(hkey, "ProductName", "MSITEST");
@ -2982,7 +2982,7 @@ machprod:
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
RegCloseKey(hkey);
res = RegOpenKeyExA(HKEY_CLASSES_ROOT, machup, 0, access, &hkey);
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, machup, 0, access, &hkey);
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res);
CHECK_DEL_REG_STR(hkey, "84A88FD7F6998CE40A22FB59F6B9C2BB", NULL);