[2/2] msi: Link the WindowsInstaller.Installer ProgId back to the right CLSID.

Francois Gouget fgouget at codeweavers.com
Wed Aug 9 12:13:17 CDT 2006


There are three CLSIDs with the same ProgID. But the problem is that 
each time we register a CLSID it also points the ProgID/CLSID back to 
itself. So the last CLSID registered wins which is not obvious and 
does not match Windows with the current ordering.

So this patch introduces the PROGID_CLSID flag and only sets the 
ProgID/CLSID link if that flag is set. This gives us a more maintainable 
way of selecting where that link points to.

---
 dlls/msi/regsvr.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/dlls/msi/regsvr.c b/dlls/msi/regsvr.c
index 65c00a2..dca1c80 100644
--- a/dlls/msi/regsvr.c
+++ b/dlls/msi/regsvr.c
@@ -72,11 +72,15 @@ struct regsvr_coclass {
     LPCSTR ips;			/* can be NULL to omit */
     LPCSTR ips32;		/* can be NULL to omit */
     LPCSTR ips32_tmodel;	/* can be NULL to omit, if apartment, iph32 must be set */
+    DWORD flags;
     LPCSTR progid;		/* can be NULL to omit */
     LPCSTR viprogid;		/* can be NULL to omit */
     LPCSTR progid_extra;	/* can be NULL to omit */
 };
 
+/* flags for regsvr_coclass.flags */
+#define PROGID_CLSID                  0x00000010
+
 static HRESULT register_coclasses(struct regsvr_coclass const *list);
 static HRESULT unregister_coclasses(struct regsvr_coclass const *list);
 
@@ -296,7 +300,8 @@ static HRESULT register_coclasses(struct
 					 list->progid);
 	    if (res != ERROR_SUCCESS) goto error_close_clsid_key;
 
-	    res = register_progid(buf, list->progid, NULL,
+	    res = register_progid(list->flags & PROGID_CLSID ? buf : NULL,
+                                  list->progid, NULL,
 				  list->name, list->progid_extra);
 	    if (res != ERROR_SUCCESS) goto error_close_clsid_key;
 	}
@@ -306,7 +311,8 @@ static HRESULT register_coclasses(struct
 					 list->viprogid);
 	    if (res != ERROR_SUCCESS) goto error_close_clsid_key;
 
-	    res = register_progid(buf, list->viprogid, list->progid,
+	    res = register_progid(list->flags & PROGID_CLSID ? buf : NULL,
+                                  list->viprogid, list->progid,
 				  list->name, list->progid_extra);
 	    if (res != ERROR_SUCCESS) goto error_close_clsid_key;
 	}
@@ -526,6 +532,7 @@ static struct regsvr_coclass const cocla
 	NULL,
 	"msi.dll",
 	"Apartment",
+        PROGID_CLSID,
 	"IMsiServer",
 	NULL
     },    
@@ -536,6 +543,7 @@ static struct regsvr_coclass const cocla
 	NULL,
 	"msi.dll",
 	NULL,
+        PROGID_CLSID,
 	"WindowsInstaller.Message",
 	NULL
     },
@@ -546,6 +554,7 @@ static struct regsvr_coclass const cocla
 	NULL,
 	"msi.dll",
 	"Apartment",
+        0,
 	"WindowsInstaller.Installer",
 	NULL
     },
@@ -556,6 +565,7 @@ static struct regsvr_coclass const cocla
 	NULL,
 	"msi.dll",
 	"Apartment",
+        PROGID_CLSID,
 	"WindowsInstaller.Installer",
 	NULL
     },
@@ -566,6 +576,7 @@ static struct regsvr_coclass const cocla
 	NULL,
 	"msi.dll",
 	"Apartment",
+        0,
 	"WindowsInstaller.Installer",
         NULL
     },
-- 
1.4.1




More information about the wine-patches mailing list