ole32: Add DebugInfo to critical sections

Jan Zerebecki jan.wine at zerebecki.de
Sat Mar 10 15:09:49 CST 2007


and add missing DeleteCriticalSection.
---
If this patch is rejected from inclusion, please tell me why, as
I would have to ask anyway.

 dlls/ole32/moniker.c  |    4 ++++
 dlls/ole32/stg_prop.c |    3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/dlls/ole32/moniker.c b/dlls/ole32/moniker.c
index c899918..bcb6891 100644
--- a/dlls/ole32/moniker.c
+++ b/dlls/ole32/moniker.c
@@ -824,6 +824,7 @@ HRESULT WINAPI RunningObjectTableImpl_Initialize(void)
 
     list_init(&runningObjectTableInstance->rot);
     InitializeCriticalSection(&runningObjectTableInstance->lock);
+    DEBUG_SET_CRITSEC_NAME(&runningObjectTableInstance->lock, "RunningObjectTableImpl*->lock");
 
     return S_OK;
 }
@@ -842,6 +843,9 @@ HRESULT WINAPI RunningObjectTableImpl_UnInitialize(void)
 
     RunningObjectTableImpl_Destroy();
 
+    DEBUG_CLEAR_CRITSEC_NAME(&runningObjectTableInstance->lock);
+    DeleteCriticalSection(&runningObjectTableInstance->lock);
+
     return S_OK;
 }
 
diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c
index a4be7b7..af610f5 100644
--- a/dlls/ole32/stg_prop.c
+++ b/dlls/ole32/stg_prop.c
@@ -233,6 +233,7 @@ static ULONG WINAPI IPropertyStorage_fnRelease(
         if (This->dirty)
             IPropertyStorage_Commit(iface, STGC_DEFAULT);
         IStream_Release(This->stm);
+        This->cs.DebugInfo->Spare[0] = 0;
         DeleteCriticalSection(&This->cs);
         PropertyStorage_DestroyDictionaries(This);
         HeapFree(GetProcessHeap(), 0, This);
@@ -1978,6 +1979,7 @@ static HRESULT PropertyStorage_BaseConstruct(IStream *stm,
     (*pps)->vtbl = &IPropertyStorage_Vtbl;
     (*pps)->ref = 1;
     InitializeCriticalSection(&(*pps)->cs);
+    (*pps)->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": PropertyStorage_impl*->cs");
     (*pps)->stm = stm;
     memcpy(&(*pps)->fmtid, rfmtid, sizeof((*pps)->fmtid));
     (*pps)->grfMode = grfMode;
@@ -1986,6 +1988,7 @@ static HRESULT PropertyStorage_BaseConstruct(IStream *stm,
     if (FAILED(hr))
     {
         IStream_Release(stm);
+        (*pps)->cs.DebugInfo->Spare[0] = 0;
         DeleteCriticalSection(&(*pps)->cs);
         HeapFree(GetProcessHeap(), 0, *pps);
         *pps = NULL;



More information about the wine-patches mailing list