taskmgr: Give a name to the PerfDataCriticalSection critical section and make it static.

Francois Gouget fgouget at codeweavers.com
Tue Nov 15 07:36:47 CST 2011


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

diff --git a/programs/taskmgr/perfdata.c b/programs/taskmgr/perfdata.c
index 0f3bf14..5d0e65c 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;
     
-- 
1.7.7.1




More information about the wine-patches mailing list