Jan Zerebecki : ntdll: Add DebugInfo to critical sections.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Mar 12 08:28:37 CDT 2007


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

Author: Jan Zerebecki <jan.wine at zerebecki.de>
Date:   Sat Mar 10 22:09:39 2007 +0100

ntdll: Add DebugInfo to critical sections.

---

 dlls/ntdll/heap.c |    7 ++++++-
 dlls/ntdll/rtl.c  |    2 ++
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c
index 7079054..80ddaf2 100644
--- a/dlls/ntdll/heap.c
+++ b/dlls/ntdll/heap.c
@@ -653,7 +653,11 @@ static BOOL HEAP_InitSubHeap( HEAP *heap, LPVOID address, DWORD flags,
             heap->critSection.SpinCount      = 0;
             process_heap_critsect_debug.CriticalSection = &heap->critSection;
         }
-        else RtlInitializeCriticalSection( &heap->critSection );
+        else
+        {
+            RtlInitializeCriticalSection( &heap->critSection );
+            heap->critSection.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": HEAP.critSection");
+        }
 
         if (flags & HEAP_SHARED)
         {
@@ -1128,6 +1132,7 @@ HANDLE WINAPI RtlDestroyHeap( HANDLE heap )
     list_remove( &heapPtr->entry );
     RtlLeaveCriticalSection( &processHeap->critSection );
 
+    heapPtr->critSection.DebugInfo->Spare[0] = 0;
     RtlDeleteCriticalSection( &heapPtr->critSection );
     subheap = &heapPtr->subheap;
     while (subheap)
diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c
index 7dd4003..f1b5c0d 100644
--- a/dlls/ntdll/rtl.c
+++ b/dlls/ntdll/rtl.c
@@ -118,6 +118,7 @@ void WINAPI RtlInitializeResource(LPRTL_RWLOCK rwl)
 	rwl->hOwningThreadId = 0;
 	rwl->dwTimeoutBoost = 0; /* no info on this one, default value is 0 */
 	RtlInitializeCriticalSection( &rwl->rtlCS );
+        rwl->rtlCS.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": RTL_RWLOCK.rtlCS");
         NtCreateSemaphore( &rwl->hExclusiveReleaseSemaphore, SEMAPHORE_ALL_ACCESS, NULL, 0, 65535 );
         NtCreateSemaphore( &rwl->hSharedReleaseSemaphore, SEMAPHORE_ALL_ACCESS, NULL, 0, 65535 );
     }
@@ -140,6 +141,7 @@ void WINAPI RtlDeleteResource(LPRTL_RWLOCK rwl)
 	NtClose( rwl->hExclusiveReleaseSemaphore );
 	NtClose( rwl->hSharedReleaseSemaphore );
 	RtlLeaveCriticalSection( &rwl->rtlCS );
+	rwl->rtlCS.DebugInfo->Spare[0] = 0;
 	RtlDeleteCriticalSection( &rwl->rtlCS );
     }
 }




More information about the wine-cvs mailing list