Msi: Advoid loops if ProgId has self as parent

Aric Stewart aric at codeweavers.com
Fri Oct 22 13:55:49 CDT 2004


Dont reregister ProgIds over and over, also write out the main key 
before trying to register the Parent. This advoids loops if a ProgId has 
itself as a parent or there is a loop in dependancies.
-------------- next part --------------
Index: dlls/msi/action.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/action.c,v
retrieving revision 1.38
diff -u -r1.38 action.c
--- dlls/msi/action.c	8 Oct 2004 23:35:35 -0000	1.38
+++ dlls/msi/action.c	22 Oct 2004 18:51:44 -0000
@@ -3888,10 +3888,16 @@
         HKEY hkey,hkey2;
         static const WCHAR szCLSID[] = { 'C','L','S','I','D',0 };
 
+        /* check if already registered */
         sz = 0x100;
-        MSI_RecordGetStringW(row,2,buffer,&sz);
-        rc = register_parent_progid(package,buffer,clsid);
-
+        MSI_RecordGetStringW(row,1,buffer,&sz);
+        if (RegOpenKeyW(HKEY_CLASSES_ROOT,buffer,&hkey) == ERROR_SUCCESS)
+        {
+            TRACE("Key Already registered\n");
+            RegCloseKey(hkey);
+            return rc;
+        }
+        
         sz = 0x100;
         MSI_RecordGetStringW(row,1,buffer,&sz);
         RegCreateKeyW(HKEY_CLASSES_ROOT,buffer,&hkey);
@@ -3901,6 +3907,11 @@
                        sizeof(WCHAR));
 
         RegCloseKey(hkey2);
+
+        sz = 0x100;
+        MSI_RecordGetStringW(row,2,buffer,&sz);
+        rc = register_parent_progid(package,buffer,clsid);
+
         if (!MSI_RecordIsNull(row,4))
         {
             sz = 0x100;


More information about the wine-patches mailing list