Maarten Lankhorst : ole32: Fix releasing spy.

Alexandre Julliard julliard at winehq.org
Fri Nov 28 07:16:33 CST 2008


Module: wine
Branch: master
Commit: 08c78e07a90583eb0b99ae09ab6e8fc3dadc78bf
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=08c78e07a90583eb0b99ae09ab6e8fc3dadc78bf

Author: Maarten Lankhorst <maarten at codeweavers.com>
Date:   Thu Nov 27 11:45:57 2008 +0100

ole32: Fix releasing spy.

---

 dlls/ole32/compobj.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/dlls/ole32/compobj.c b/dlls/ole32/compobj.c
index d97279a..a920b9c 100644
--- a/dlls/ole32/compobj.c
+++ b/dlls/ole32/compobj.c
@@ -227,6 +227,7 @@ static void COM_TlsDestroy(void)
         if (info->apt) apartment_release(info->apt);
         if (info->errorinfo) IErrorInfo_Release(info->errorinfo);
         if (info->state) IUnknown_Release(info->state);
+        if (info->spy) IUnknown_Release(info->spy);
         HeapFree(GetProcessHeap(), 0, info);
         NtCurrentTeb()->ReservedForOle = NULL;
     }
@@ -1058,6 +1059,21 @@ HRESULT WINAPI CoRegisterInitializeSpy(IInitializeSpy *spy, ULARGE_INTEGER *cook
     return hr;
 }
 
+/******************************************************************************
+ *              CoRevokeInitializeSpy [OLE32.@]
+ *
+ * Remove a spy that previously watched CoInitializeEx calls
+ *
+ * PARAMS
+ *  cookie [I] The cookie obtained from a previous CoRegisterInitializeSpy call
+ *
+ * RETURNS
+ *  Success: S_OK if a spy is removed
+ *  Failure: E_INVALIDARG
+ *
+ * SEE ALSO
+ *   CoInitializeEx
+ */
 HRESULT WINAPI CoRevokeInitializeSpy(ULARGE_INTEGER cookie)
 {
     struct oletls *info = COM_CurrentInfo();
@@ -1067,6 +1083,7 @@ HRESULT WINAPI CoRevokeInitializeSpy(ULARGE_INTEGER cookie)
         return E_INVALIDARG;
 
     IUnknown_Release(info->spy);
+    info->spy = NULL;
     return S_OK;
 }
 




More information about the wine-cvs mailing list