- Fix a heap corruption at process shutdown
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Tue, 27 Oct 2009 12:19:33 +0000 (12:19 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Tue, 27 Oct 2009 12:19:33 +0000 (12:19 +0000)
- Found by irc:encoded

svn path=/trunk/; revision=43791

reactos/dll/win32/winmm/winmm.c

index 2a1c705..9eb9b7b 100644 (file)
@@ -65,13 +65,7 @@ HINSTANCE hWinMM32Instance;
 HANDLE psLastEvent;
 HANDLE psStopEvent;
 
-static CRITICAL_SECTION_DEBUG critsect_debug =
-{
-    0, 0, &WINMM_cs,
-    { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
-      0, 0, { (DWORD_PTR)(__FILE__ ": WINMM_cs") }
-};
-CRITICAL_SECTION WINMM_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
+CRITICAL_SECTION WINMM_cs;
 
 /**************************************************************************
  *                     WINMM_CreateIData                       [internal]
@@ -81,6 +75,7 @@ static        BOOL    WINMM_CreateIData(HINSTANCE hInstDLL)
     hWinMM32Instance = hInstDLL;
     psStopEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
     psLastEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
+    InitializeCriticalSection(&WINMM_cs);
     return TRUE;
 }