Zero out an invalidated runningObjectTableInstance pointer

Dmitry Timoshkov dmitry at baikal.ru
Fri Apr 15 08:56:14 CDT 2005


Hello,

this patch fixes a crash in the app I'm working on.

The app calls RevokeActiveObject() after it has called OleUninitialize().
The bug is in RunningObjectTableImpl_Destroy() which doesn't zero out
an invalidated runningObjectTableInstance pointer.

(dlls/ole32/moniker.c needs a clean up to remove the methods prototypes
and make the methods static, but that's another story).

Changelog:
    Dmitry Timoshkov <dmitry at codeweavers.com>
    Zero out an invalidated runningObjectTableInstance pointer.

--- cvs/hq/wine/dlls/ole32/moniker.c	2004-12-15 20:43:29.000000000 +0800
+++ wine/dlls/ole32/moniker.c	2005-04-15 22:43:44.000000000 +0900
@@ -70,7 +70,7 @@ typedef struct RunningObjectTableImpl{
 
 } RunningObjectTableImpl;
 
-RunningObjectTableImpl* runningObjectTableInstance=0;
+static RunningObjectTableImpl* runningObjectTableInstance = NULL;
 
 /* IRunningObjectTable prototype functions : */
 /* IUnknown functions*/
@@ -153,7 +153,7 @@ ULONG   WINAPI RunningObjectTableImpl_Ad
 /***********************************************************************
  *        RunningObjectTable_Initialize
  */
-HRESULT WINAPI RunningObjectTableImpl_Destroy()
+HRESULT WINAPI RunningObjectTableImpl_Destroy(void)
 {
     TRACE("()\n");
 
@@ -165,6 +165,7 @@ HRESULT WINAPI RunningObjectTableImpl_De
 
     /* free the ROT structure memory */
     HeapFree(GetProcessHeap(),0,runningObjectTableInstance);
+    runningObjectTableInstance = NULL;
 
     return S_OK;
 }






More information about the wine-patches mailing list