[PATCH 4/5] ole32: Don't release the registered drop targets in OleUninitialize.

Robert Shearman rob at codeweavers.com
Thu Apr 5 05:33:52 CDT 2007


Do it in DLL_PROCESS_DETACH instead.
---
  dlls/ole32/compobj.c         |    1 +
  dlls/ole32/compobj_private.h |    2 ++
  dlls/ole32/ole2.c            |    8 +-------
  dlls/ole32/tests/dragdrop.c  |    2 --
  4 files changed, 4 insertions(+), 9 deletions(-)
-------------- next part --------------
diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c
index 330b8e1..af43074 100644
--- a/dlls/ole32/compobj.c
+++ b/dlls/ole32/compobj.c
@@ -3402,6 +3402,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, 
 
     case DLL_PROCESS_DETACH:
         if (TRACE_ON(ole)) CoRevokeMallocSpy();
+        OLEDD_UnInitialize();
         COMPOBJ_UninitProcess();
         RPC_UnregisterAllChannelHooks();
         OLE32_hInstance = 0;
diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h
index 4a81c91..479cd76 100644
--- a/dlls/ole32/compobj_private.h
+++ b/dlls/ole32/compobj_private.h
@@ -242,6 +242,8 @@ HRESULT WINAPI RunningObjectTableImpl_Un
 /* This function decomposes a String path to a String Table containing all the elements ("\" or "subDirectory" or "Directory" or "FileName") of the path */
 int FileMonikerImpl_DecomposePath(LPCOLESTR str, LPOLESTR** stringTable);
 
+/* Drag and drop */
+void OLEDD_UnInitialize(void);
 
 /* Apartment Functions */
 
diff --git a/dlls/ole32/ole2.c b/dlls/ole32/ole2.c
index 1f2c301..908eb09 100644
--- a/dlls/ole32/ole2.c
+++ b/dlls/ole32/ole2.c
@@ -147,7 +147,6 @@ extern void OLEClipbrd_Initialize(void);
  * These are the prototypes of the utility methods used for OLE Drag n Drop
  */
 static void            OLEDD_Initialize(void);
-static void            OLEDD_UnInitialize(void);
 static DropTargetNode* OLEDD_FindDropTarget(
                          HWND hwndOfTarget);
 static void            OLEDD_FreeDropTarget(DropTargetNode*);
@@ -254,11 +253,6 @@ void WINAPI OleUninitialize(void)
     OLEClipbrd_UnInitialize();
 
     /*
-     * Drag and Drop
-     */
-    OLEDD_UnInitialize();
-
-    /*
      * OLE shared menu
      */
     OLEMenu_UnInitialize();
@@ -1915,7 +1909,7 @@ static void OLEDD_FreeDropTarget(DropTar
  *
  * Releases the OLE drag and drop data structures.
  */
-static void OLEDD_UnInitialize(void)
+void OLEDD_UnInitialize(void)
 {
   /*
    * Simply empty the list.
diff --git a/dlls/ole32/tests/dragdrop.c b/dlls/ole32/tests/dragdrop.c
index f8b52f6..d813bd3 100644
--- a/dlls/ole32/tests/dragdrop.c
+++ b/dlls/ole32/tests/dragdrop.c
@@ -136,11 +136,9 @@ START_TEST(dragdrop)
 
     ok(droptarget_release_called == 0, "DropTarget_Release shouldn't have been called\n");
     OleUninitialize();
-    todo_wine
     ok(droptarget_release_called == 0, "DropTarget_Release shouldn't have been called\n");
 
     hr = RevokeDragDrop(GetDesktopWindow());
-    todo_wine
     ok_ole_success(hr, "RevokeDragDrop");
     ok(droptarget_release_called == 1, "DropTarget_Release should have been called once, not %d times\n", droptarget_release_called);
 


More information about the wine-patches mailing list