Commit in reactos/lib/ole32 on MAIN
compobj.c+30-81.7 -> 1.8
ifs.c+1-11.5 -> 1.6
ole2.c+31.12 -> 1.13
+34-9
3 modified files
Sync to Wine-20040408:
Warren Turkal <wt@midsouth.rr.com>
- Fixed the implementation of CoTreatAsClass.
Francois Gouget <fgouget@free.fr>
- Assorted spelling fixes.

reactos/lib/ole32
compobj.c 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- compobj.c	17 Feb 2004 23:00:01 -0000	1.7
+++ compobj.c	16 Apr 2004 08:31:25 -0000	1.8
@@ -1588,22 +1588,22 @@
 /***********************************************************************
  *           CoFreeLibrary [OLE32.@]
  *
- * NOTES: don't belive the docu
+ * NOTES: don't believe the documentation
  */
 void WINAPI CoFreeLibrary(HINSTANCE hLibrary)
 {
-	FreeLibrary(hLibrary);
+    FreeLibrary(hLibrary);
 }
 
 
 /***********************************************************************
  *           CoFreeAllLibraries [OLE32.@]
  *
- * NOTES: don't belive the docu
+ * NOTES: don't believe the documentation
  */
 void WINAPI CoFreeAllLibraries(void)
 {
-        /* NOP */
+    /* NOP */
 }
 
 
@@ -2010,14 +2010,19 @@
 
 /******************************************************************************
  *              CoTreatAsClass        [OLE32.@]
+ *
+ * Sets TreatAs value of a class
  */
 HRESULT WINAPI CoTreatAsClass(REFCLSID clsidOld, REFCLSID clsidNew)
 {
     HKEY hkey = 0;
-    char buf[200], szClsidNew[200];
+    char buf[47];
+    char szClsidNew[39];
     HRESULT res = S_OK;
+    char auto_treat_as[39];
+    LONG auto_treat_as_size = sizeof(auto_treat_as);
+    CLSID id;
 
-    FIXME("(%s,%s)\n", debugstr_guid(clsidOld), debugstr_guid(clsidNew));
     sprintf(buf,"CLSID\\");WINE_StringFromCLSID(clsidOld,&buf[6]);
     WINE_StringFromCLSID(clsidNew, szClsidNew);
     if (RegOpenKeyA(HKEY_CLASSES_ROOT,buf,&hkey))
@@ -2025,9 +2030,26 @@
         res = REGDB_E_CLASSNOTREG;
 	goto done;
     }
-    if (RegSetValueA(hkey, "AutoTreatAs", REG_SZ, szClsidNew, strlen(szClsidNew)+1))
+    if (!memcmp( clsidOld, clsidNew, sizeof(*clsidOld) ))
     {
-        res = REGDB_E_WRITEREGDB;
+       if (!RegQueryValueA(hkey, "AutoTreatAs", auto_treat_as, &auto_treat_as_size) &&
+           !__CLSIDFromStringA(auto_treat_as, &id))
+       {
+           if (RegSetValueA(hkey, "TreatAs", REG_SZ, auto_treat_as, strlen(auto_treat_as)+1))
+           {
+               res = REGDB_E_WRITEREGDB;
+               goto done;
+           }
+       }
+       else
+       {
+           RegDeleteKeyA(hkey, "TreatAs");
+           goto done;
+       }
+    }
+    else if (RegSetValueA(hkey, "TreatAs", REG_SZ, szClsidNew, strlen(szClsidNew)+1))
+    {
+       res = REGDB_E_WRITEREGDB;
 	goto done;
     }
 

reactos/lib/ole32
ifs.c 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- ifs.c	11 Mar 2004 21:46:41 -0000	1.5
+++ ifs.c	16 Apr 2004 08:31:25 -0000	1.6
@@ -565,7 +565,7 @@
  *           CoRegisterMallocSpy        [OLE32.@]
  *
  * NOTES
- *  if a mallocspy is already registered, we cant do it again since
+ *  if a mallocspy is already registered, we can't do it again since
  *  only the spy knows, how to free a memory block
  */
 HRESULT WINAPI CoRegisterMallocSpy(LPMALLOCSPY pMallocSpy)

reactos/lib/ole32
ole2.c 1.12 -> 1.13
diff -u -r1.12 -r1.13
--- ole2.c	28 Jan 2004 21:27:51 -0000	1.12
+++ ole2.c	16 Apr 2004 08:31:25 -0000	1.13
@@ -332,6 +332,9 @@
 
   TRACE("(%p,%p)\n", hwnd, pDropTarget);
 
+  if (!pDropTarget)
+    return E_INVALIDARG;
+  
   /*
    * First, check if the window is already registered.
    */
CVSspam 0.2.8