https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3635da209682edaddeaf2…
commit 3635da209682edaddeaf2f6ea9995393bc46d94a
Author: winesync <ros-dev(a)reactos.org>
AuthorDate: Sun Mar 13 01:23:58 2022 +0100
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Mar 20 19:28:18 2022 +0100
[WINESYNC] msi: Use KEY_WOW64_* flags in ACTION_Register/UnregisterClassInfo.
Signed-off-by: Hans Leidekker <hans(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
wine commit id 70732e273eb52821bfd725f3b1ea1919b8c0e3b0 by Hans Leidekker
<hans(a)codeweavers.com>
---
dll/win32/msi/classes.c | 25 ++++++++++++-------------
dll/win32/msi/msipriv.h | 1 -
2 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/dll/win32/msi/classes.c b/dll/win32/msi/classes.c
index 293aa1063b6..7b0a4a4d0e6 100644
--- a/dll/win32/msi/classes.c
+++ b/dll/win32/msi/classes.c
@@ -747,7 +747,7 @@ static UINT register_appid(const MSIAPPID *appid, LPCWSTR app )
UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
{
static const WCHAR szFileType_fmt[] =
{'F','i','l','e','T','y','p','e','\\','%','s','\\','%','i',0};
- const WCHAR *keypath;
+ REGSAM access = KEY_ALL_ACCESS;
MSIRECORD *uirow;
HKEY hkey, hkey2, hkey3;
MSICLASS *cls;
@@ -760,12 +760,12 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
if (r != ERROR_SUCCESS)
return r;
- if (is_64bit && package->platform == PLATFORM_INTEL)
- keypath = szWow6432NodeCLSID;
+ if (package->platform == PLATFORM_INTEL)
+ access |= KEY_WOW64_32KEY;
else
- keypath = szCLSID;
+ access |= KEY_WOW64_64KEY;
- if (RegCreateKeyW(HKEY_CLASSES_ROOT, keypath, &hkey) != ERROR_SUCCESS)
+ if (RegCreateKeyExW( HKEY_CLASSES_ROOT, szCLSID, 0, NULL, 0, access, NULL, &hkey,
NULL ))
return ERROR_FUNCTION_FAILED;
LIST_FOR_EACH_ENTRY( cls, &package->classes, MSICLASS, entry )
@@ -873,7 +873,6 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
if (cls->DefInprocHandler32)
msi_reg_set_subkey_val( hkey2, szInprocHandler32, NULL,
cls->DefInprocHandler32 );
-
RegCloseKey(hkey2);
/* if there is a FileTypeMask, register the FileType */
@@ -902,7 +901,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
index ++;
}
}
-
+
uirow = MSI_CreateRecord(1);
MSI_RecordSetStringW( uirow, 1, cls->clsid );
MSI_ProcessMessage(package, INSTALLMESSAGE_ACTIONDATA, uirow);
@@ -915,7 +914,7 @@ UINT ACTION_RegisterClassInfo(MSIPACKAGE *package)
UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package )
{
static const WCHAR szFileType[] =
{'F','i','l','e','T','y','p','e','\\',0};
- const WCHAR *keypath;
+ REGSAM access = KEY_ALL_ACCESS;
MSIRECORD *uirow;
MSICLASS *cls;
HKEY hkey, hkey2;
@@ -928,13 +927,13 @@ UINT ACTION_UnregisterClassInfo( MSIPACKAGE *package )
if (r != ERROR_SUCCESS)
return r;
- if (is_64bit && package->platform == PLATFORM_INTEL)
- keypath = szWow6432NodeCLSID;
+ if (package->platform == PLATFORM_INTEL)
+ access |= KEY_WOW64_32KEY;
else
- keypath = szCLSID;
+ access |= KEY_WOW64_64KEY;
- if (RegOpenKeyW( HKEY_CLASSES_ROOT, keypath, &hkey ) != ERROR_SUCCESS)
- return ERROR_SUCCESS;
+ if (RegCreateKeyExW( HKEY_CLASSES_ROOT, szCLSID, 0, NULL, 0, access, NULL, &hkey,
NULL ))
+ return ERROR_FUNCTION_FAILED;
LIST_FOR_EACH_ENTRY( cls, &package->classes, MSICLASS, entry )
{
diff --git a/dll/win32/msi/msipriv.h b/dll/win32/msi/msipriv.h
index aa33d1007e6..3d5df922f23 100644
--- a/dll/win32/msi/msipriv.h
+++ b/dll/win32/msi/msipriv.h
@@ -1207,7 +1207,6 @@ static const WCHAR szX64[] =
{'x','6','4',0};
static const WCHAR szAMD64[] =
{'A','M','D','6','4',0};
static const WCHAR szARM[] = {'A','r','m',0};
static const WCHAR szARM64[] =
{'A','r','m','6','4',0};
-static const WCHAR szWow6432NodeCLSID[] =
{'W','o','w','6','4','3','2','N','o','d','e','\\','C','L','S','I','D',0};
static const WCHAR szStreams[] =
{'_','S','t','r','e','a','m','s',0};
static const WCHAR szStorages[] =
{'_','S','t','o','r','a','g','e','s',0};
static const WCHAR szMsiPublishAssemblies[] =
{'M','s','i','P','u','b','l','i','s','h','A','s','s','e','m','b','l','i','e','s',0};