Hans Leidekker : msi: Register class ids from 32-bit packages under Wow6432Node on 64-bit.
Alexandre Julliard
julliard at winehq.org
Wed Oct 13 11:43:09 CDT 2010
Module: wine
Branch: master
Commit: 43a680a1554de5d67123af645692d614b071ff06
URL: http://source.winehq.org/git/wine.git/?a=commit;h=43a680a1554de5d67123af645692d614b071ff06
Author: Hans Leidekker <hans at codeweavers.com>
Date: Wed Oct 13 14:23:25 2010 +0200
msi: Register class ids from 32-bit packages under Wow6432Node on 64-bit.
---
dlls/msi/classes.c | 18 ++++++++++++++++--
dlls/msi/msipriv.h | 3 +++
dlls/msi/package.c | 1 -
dlls/msi/registry.c | 2 --
4 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/dlls/msi/classes.c b/dlls/msi/classes.c
index 5943805..beaf1f0 100644
--- a/dlls/msi/classes.c
+++ b/dlls/msi/classes.c
@@ -804,12 +804,19 @@ 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;
MSIRECORD *uirow;
HKEY hkey,hkey2,hkey3;
MSICLASS *cls;
load_classes_and_such(package);
- if (RegCreateKeyW(HKEY_CLASSES_ROOT, szCLSID, &hkey) != ERROR_SUCCESS)
+
+ if (is_64bit && package->platform == PLATFORM_INTEL)
+ keypath = szWow6432NodeCLSID;
+ else
+ keypath = szCLSID;
+
+ if (RegCreateKeyW(HKEY_CLASSES_ROOT, keypath, &hkey) != ERROR_SUCCESS)
return ERROR_FUNCTION_FAILED;
LIST_FOR_EACH_ENTRY( cls, &package->classes, MSICLASS, entry )
@@ -963,12 +970,19 @@ 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;
MSIRECORD *uirow;
MSICLASS *cls;
HKEY hkey, hkey2;
load_classes_and_such( package );
- if (RegOpenKeyW( HKEY_CLASSES_ROOT, szCLSID, &hkey ) != ERROR_SUCCESS)
+
+ if (is_64bit && package->platform == PLATFORM_INTEL)
+ keypath = szWow6432NodeCLSID;
+ else
+ keypath = szCLSID;
+
+ if (RegOpenKeyW( HKEY_CLASSES_ROOT, keypath, &hkey ) != ERROR_SUCCESS)
return ERROR_SUCCESS;
LIST_FOR_EACH_ENTRY( cls, &package->classes, MSICLASS, entry )
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index fb8bc50..a785876 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -37,6 +37,8 @@
#include "wine/list.h"
#include "wine/debug.h"
+static const BOOL is_64bit = sizeof(void *) > sizeof(int);
+
#define MSI_DATASIZEMASK 0x00ff
#define MSITYPE_VALID 0x0100
#define MSITYPE_LOCALIZABLE 0x200
@@ -1147,6 +1149,7 @@ static const WCHAR szAdminUser[] = {'A','d','m','i','n','U','s','e','r',0};
static const WCHAR szIntel[] = {'I','n','t','e','l',0};
static const WCHAR szIntel64[] = {'I','n','t','e','l','6','4',0};
static const WCHAR szX64[] = {'x','6','4',0};
+static const WCHAR szWow6432NodeCLSID[] = {'W','o','w','6','4','3','2','N','o','d','e','\\','C','L','S','I','D',0};
/* memory allocation macro functions */
static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1);
diff --git a/dlls/msi/package.c b/dlls/msi/package.c
index cd1cdf8..32576a0 100644
--- a/dlls/msi/package.c
+++ b/dlls/msi/package.c
@@ -1350,7 +1350,6 @@ static UINT msi_parse_summary( MSISUMMARYINFO *si, MSIPACKAGE *package )
static UINT validate_package( MSIPACKAGE *package )
{
- static const BOOL is_64bit = sizeof(void *) > sizeof(int);
BOOL is_wow64;
UINT i;
diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c
index f3580d2..e83490f 100644
--- a/dlls/msi/registry.c
+++ b/dlls/msi/registry.c
@@ -40,8 +40,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(msi);
-static const BOOL is_64bit = sizeof(void *) > sizeof(int);
-
/*
* This module will be all the helper functions for registry access by the
* installer bits.
More information about the wine-cvs
mailing list