GateWaitBlock->Thread = CurrentThread;
/* Set the Thread Wait Data */
- CurrentThread->WaitReason = WaitReason;
- CurrentThread->WaitMode = WaitMode;
CurrentThread->WaitIrql = OldIrql;
CurrentThread->GateObject = Gate;
/* Insert into the Wait List */
- InsertTailList(&Gate->Header.WaitListHead, &GateWaitBlock->WaitListEntry);
+ InsertTailList(&Gate->Header.WaitListHead,
+ &GateWaitBlock->WaitListEntry);
/* Handle Kernel Queues */
if (CurrentThread->Queue)
/* Setup the wait information */
CurrentThread->WaitMode = WaitMode;
CurrentThread->WaitReason = WaitReason;
- CurrentThread->WaitTime = 0;
+ CurrentThread->WaitTime = ((PLARGE_INTEGER)&KeTickCount)->LowPart;
CurrentThread->State = Waiting;
/* Find a new thread to run */
/* Reschedule the Thread */
DPRINT("Unblocking the Thread\n");
KiUnblockThread(WaitThread, &WaitStatus, EVENT_INCREMENT);
- return;
quit:
/* Release the Dispatcher Database Lock */