msvcrt: Statically initialize and name the MSVCRT_file_cs critical section.
Francois Gouget
fgouget at codeweavers.com
Wed Nov 16 09:28:20 CST 2011
---
dlls/msvcrt/file.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c
index 0ead68a..f603c1d 100644
--- a/dlls/msvcrt/file.c
+++ b/dlls/msvcrt/file.c
@@ -128,6 +128,13 @@ static const ULONGLONG WCCOM = TOUL('c') << 32 | TOUL('o') << 16 | TOUL('m');
* protection, rather than locking the whole table for every change.
*/
static CRITICAL_SECTION MSVCRT_file_cs;
+static CRITICAL_SECTION_DEBUG MSVCRT_file_cs_debug =
+{
+ 0, 0, &MSVCRT_file_cs,
+ { &MSVCRT_file_cs_debug.ProcessLocksList, &MSVCRT_file_cs_debug.ProcessLocksList },
+ 0, 0, { (DWORD_PTR)(__FILE__ ": MSVCRT_file_cs") }
+};
+static CRITICAL_SECTION MSVCRT_file_cs = { &MSVCRT_file_cs_debug, -1, 0, 0, 0, 0 };
#define LOCK_FILES() do { EnterCriticalSection(&MSVCRT_file_cs); } while (0)
#define UNLOCK_FILES() do { LeaveCriticalSection(&MSVCRT_file_cs); } while (0)
@@ -440,8 +447,6 @@ void msvcrt_init_io(void)
int i;
ioinfo *fdinfo;
- InitializeCriticalSection(&MSVCRT_file_cs);
- MSVCRT_file_cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": MSVCRT_file_cs");
GetStartupInfoA(&si);
if (si.cbReserved2 >= sizeof(unsigned int) && si.lpReserved2 != NULL)
{
@@ -983,7 +988,6 @@ void msvcrt_free_io(void)
for(i=0; i<sizeof(MSVCRT_fstream)/sizeof(MSVCRT_fstream[0]); i++)
MSVCRT_free(MSVCRT_fstream[i]);
- MSVCRT_file_cs.DebugInfo->Spare[0] = 0;
DeleteCriticalSection(&MSVCRT_file_cs);
}
--
1.7.7.1
More information about the wine-patches
mailing list