Commit 52b9cedb authored by Alexandre Julliard's avatar Alexandre Julliard

Don't try to allocate the debug info before the process heap exists.

parent 19b6a498
......@@ -74,6 +74,9 @@ static inline HANDLE get_semaphore( RTL_CRITICAL_SECTION *crit )
*/
NTSTATUS WINAPI RtlInitializeCriticalSection( RTL_CRITICAL_SECTION *crit )
{
if (!ntdll_get_process_heap()) crit->DebugInfo = NULL;
else
{
crit->DebugInfo = RtlAllocateHeap(ntdll_get_process_heap(), 0, sizeof(CRITICAL_SECTION_DEBUG));
if (crit->DebugInfo)
{
......@@ -87,6 +90,7 @@ NTSTATUS WINAPI RtlInitializeCriticalSection( RTL_CRITICAL_SECTION *crit )
crit->DebugInfo->Spare[0] = 0;
crit->DebugInfo->Spare[1] = 0;
}
}
crit->LockCount = -1;
crit->RecursionCount = 0;
crit->OwningThread = 0;
......
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