Commit 66520ea0 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Fix FILE critical section initialization.

parent 3d028ab6
...@@ -364,8 +364,11 @@ static MSVCRT_FILE* msvcrt_alloc_fp(void) ...@@ -364,8 +364,11 @@ static MSVCRT_FILE* msvcrt_alloc_fp(void)
{ {
if (i == MSVCRT_stream_idx) if (i == MSVCRT_stream_idx)
{ {
InitializeCriticalSection(&((file_crit*)file)->crit); if (file<MSVCRT__iob || file>=MSVCRT__iob+_IOB_ENTRIES)
((file_crit*)file)->crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": file_crit.crit"); {
InitializeCriticalSection(&((file_crit*)file)->crit);
((file_crit*)file)->crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": file_crit.crit");
}
MSVCRT_stream_idx++; MSVCRT_stream_idx++;
} }
return file; return file;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment