taskmgr: Give a name and statically initialize PerfDataCriticalSection.

Francois Gouget fgouget at codeweavers.com
Mon Nov 14 02:55:49 CST 2011


---
 programs/taskmgr/perfdata.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/programs/taskmgr/perfdata.c b/programs/taskmgr/perfdata.c
index 0f3bf14..585bad2 100644
--- a/programs/taskmgr/perfdata.c
+++ b/programs/taskmgr/perfdata.c
@@ -35,6 +35,14 @@ static PROCNTQSI                       NtQuerySystemInformation = NULL;
 static PROCGGR                         pGetGuiResources = NULL;
 static PROCGPIC                        pGetProcessIoCounters = NULL;
 static CRITICAL_SECTION                PerfDataCriticalSection;
+static CRITICAL_SECTION_DEBUG PerfDataCriticalSection_debug  =
+{
+    0, 0, &PerfDataCriticalSection,
+    { &PerfDataCriticalSection_debug.ProcessLocksList, &PerfDataCriticalSection_debug.ProcessLocksList },
+      0, 0, { (DWORD_PTR)(__FILE__ ": PerfDataCriticalSection") }
+};
+static CRITICAL_SECTION PerfDataCriticalSection = { &PerfDataCriticalSection_debug, -1, 0, 0, 0, 0 };
+;
 static PPERFDATA                       pPerfDataOld = NULL;    /* Older perf data (saved to establish delta values) */
 static PPERFDATA                       pPerfData = NULL;    /* Most recent copy of perf data */
 static ULONG                           ProcessCountOld = 0;
@@ -61,9 +69,7 @@ BOOL PerfDataInitialize(void)
     NtQuerySystemInformation = (PROCNTQSI)GetProcAddress(GetModuleHandleW(wszNtdll), "NtQuerySystemInformation");
     pGetGuiResources = (PROCGGR)GetProcAddress(GetModuleHandleW(wszUser32), "GetGuiResources");
     pGetProcessIoCounters = (PROCGPIC)GetProcAddress(GetModuleHandleW(wszKernel32), "GetProcessIoCounters");
-    
-    InitializeCriticalSection(&PerfDataCriticalSection);
-    
+
     if (!NtQuerySystemInformation)
         return FALSE;
     
@@ -81,6 +87,7 @@ void PerfDataUninitialize(void)
 {
     NtQuerySystemInformation = NULL;
 
+    PerfDataCriticalSection.DebugInfo->Spare[0] = 0;
     DeleteCriticalSection(&PerfDataCriticalSection);
 }
 
-- 
1.7.7.1




More information about the wine-patches mailing list