msvcrt: Add DebugInfo to critical sections.

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


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

 dlls/msvcrt/file.c |    2 ++
 dlls/msvcrt/lock.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c
index 2a44e6d..fa93204 100644
--- a/dlls/msvcrt/file.c
+++ b/dlls/msvcrt/file.c
@@ -328,6 +328,7 @@ void msvcrt_init_io(void)
   int           i;
 
   InitializeCriticalSection(&MSVCRT_file_cs);
+  MSVCRT_file_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": MSVCRT_file_cs");
   GetStartupInfoA(&si);
   if (si.cbReserved2 != 0 && si.lpReserved2 != NULL)
   {
@@ -796,6 +797,7 @@ void msvcrt_free_io(void)
     MSVCRT_fclose(&MSVCRT__iob[0]);
     MSVCRT_fclose(&MSVCRT__iob[1]);
     MSVCRT_fclose(&MSVCRT__iob[2]);
+    MSVCRT_file_cs.DebugInfo->Spare[0] = 0;
     DeleteCriticalSection(&MSVCRT_file_cs);
 }
 
diff --git a/dlls/msvcrt/lock.c b/dlls/msvcrt/lock.c
index 8b2090f..1bd74f8 100644
--- a/dlls/msvcrt/lock.c
+++ b/dlls/msvcrt/lock.c
@@ -42,11 +42,13 @@ static inline void msvcrt_mlock_set_entry_initialized( int locknum, BOOL initial
 static inline void msvcrt_initialize_mlock( int locknum )
 {
   InitializeCriticalSection( &(lock_table[ locknum ].crit) );
+  lock_table[ locknum ].crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": LOCKTABLEENTRY[locknum].crit");
   msvcrt_mlock_set_entry_initialized( locknum, TRUE );
 }
 
 static inline void msvcrt_uninitialize_mlock( int locknum )
 {
+  lock_table[ locknum ].crit.DebugInfo->Spare[0] = 0;
   DeleteCriticalSection( &(lock_table[ locknum ].crit) );
   msvcrt_mlock_set_entry_initialized( locknum, FALSE );
 }



More information about the wine-patches mailing list