- Add check on null-pointer. Fixes exception in some cases

svn path=/trunk/; revision=40555
This commit is contained in:
Dmitry Chapyshev 2009-04-17 07:12:21 +00:00
parent 8d8ce081fa
commit 90590ee801

View file

@ -117,12 +117,15 @@ RtlpWaitForCriticalSection(PRTL_CRITICAL_SECTION CriticalSection)
DPRINT("Waiting on Critical Section Event: %p %p\n",
CriticalSection,
CriticalSection->LockSemaphore);
CriticalSection->DebugInfo->EntryCount++;
if (CriticalSection->DebugInfo)
CriticalSection->DebugInfo->EntryCount++;
for (;;) {
/* Increase the number of times we've had contention */
CriticalSection->DebugInfo->ContentionCount++;
if (CriticalSection->DebugInfo)
CriticalSection->DebugInfo->ContentionCount++;
/* Wait on the Event */
Status = NtWaitForSingleObject(CriticalSection->LockSemaphore,