mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:19:49 +00:00
Don't try to allocate the debug info before the process heap exists.
This commit is contained in:
parent
19b6a49845
commit
52b9cedb8e
1 changed files with 15 additions and 11 deletions
|
@ -74,18 +74,22 @@ static inline HANDLE get_semaphore( RTL_CRITICAL_SECTION *crit )
|
|||
*/
|
||||
NTSTATUS WINAPI RtlInitializeCriticalSection( RTL_CRITICAL_SECTION *crit )
|
||||
{
|
||||
crit->DebugInfo = RtlAllocateHeap(ntdll_get_process_heap(), 0, sizeof(CRITICAL_SECTION_DEBUG));
|
||||
if (crit->DebugInfo)
|
||||
if (!ntdll_get_process_heap()) crit->DebugInfo = NULL;
|
||||
else
|
||||
{
|
||||
crit->DebugInfo->Type = 0;
|
||||
crit->DebugInfo->CreatorBackTraceIndex = 0;
|
||||
crit->DebugInfo->CriticalSection = crit;
|
||||
crit->DebugInfo->ProcessLocksList.Blink = &(crit->DebugInfo->ProcessLocksList);
|
||||
crit->DebugInfo->ProcessLocksList.Flink = &(crit->DebugInfo->ProcessLocksList);
|
||||
crit->DebugInfo->EntryCount = 0;
|
||||
crit->DebugInfo->ContentionCount = 0;
|
||||
crit->DebugInfo->Spare[0] = 0;
|
||||
crit->DebugInfo->Spare[1] = 0;
|
||||
crit->DebugInfo = RtlAllocateHeap(ntdll_get_process_heap(), 0, sizeof(CRITICAL_SECTION_DEBUG));
|
||||
if (crit->DebugInfo)
|
||||
{
|
||||
crit->DebugInfo->Type = 0;
|
||||
crit->DebugInfo->CreatorBackTraceIndex = 0;
|
||||
crit->DebugInfo->CriticalSection = crit;
|
||||
crit->DebugInfo->ProcessLocksList.Blink = &(crit->DebugInfo->ProcessLocksList);
|
||||
crit->DebugInfo->ProcessLocksList.Flink = &(crit->DebugInfo->ProcessLocksList);
|
||||
crit->DebugInfo->EntryCount = 0;
|
||||
crit->DebugInfo->ContentionCount = 0;
|
||||
crit->DebugInfo->Spare[0] = 0;
|
||||
crit->DebugInfo->Spare[1] = 0;
|
||||
}
|
||||
}
|
||||
crit->LockCount = -1;
|
||||
crit->RecursionCount = 0;
|
||||
|
|
Loading…
Reference in a new issue