[NTOSKRNL]

- Fix wait asserts to account for the Thread->WaitNext case
- At least output a warning in place of the assertion failure in KeWaitForMultipleObjects
See issue #7129 for more details.

svn path=/trunk/; revision=56749
This commit is contained in:
Thomas Faber 2012-06-19 10:43:38 +00:00
parent 07a7af33f2
commit 9d043b385a

View file

@ -417,6 +417,9 @@ KeWaitForSingleObject(IN PVOID Object,
PLARGE_INTEGER OriginalDueTime = Timeout; PLARGE_INTEGER OriginalDueTime = Timeout;
ULONG Hand = 0; ULONG Hand = 0;
if (Thread->WaitNext)
ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
else
ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL || ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL ||
(KeGetCurrentIrql() == DISPATCH_LEVEL && (KeGetCurrentIrql() == DISPATCH_LEVEL &&
Timeout && Timeout->QuadPart == 0)); Timeout && Timeout->QuadPart == 0));
@ -587,10 +590,17 @@ KeWaitForMultipleObjects(IN ULONG Count,
LARGE_INTEGER DueTime = {{0}}, NewDueTime, InterruptTime; LARGE_INTEGER DueTime = {{0}}, NewDueTime, InterruptTime;
ULONG Index, Hand = 0; ULONG Index, Hand = 0;
if (Thread->WaitNext)
ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);
else if (KeGetCurrentIrql() == DISPATCH_LEVEL &&
(!Timeout || Timeout->QuadPart != 0))
{
/* HACK: tcpip is broken and waits with spinlocks acquired (bug #7129) */ /* HACK: tcpip is broken and waits with spinlocks acquired (bug #7129) */
/*ASSERT(KeGetCurrentIrql() < DISPATCH_LEVEL || DPRINT1("%s called at DISPATCH_LEVEL with non-zero timeout!\n",
(KeGetCurrentIrql() == DISPATCH_LEVEL && __FUNCTION__);
Timeout && Timeout->QuadPart == 0));*/ }
else
ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);
/* Make sure the Wait Count is valid */ /* Make sure the Wait Count is valid */
if (!WaitBlockArray) if (!WaitBlockArray)