KeInsertHeadQueue
VOID __stdcall KeInsertHeadQueue(_KQUEUE *Queue, _LIST_ENTRY *Entry){
_QWORD *v3;
UINT8 OldIrql;
struct _KPRCB *CurrentPrcb;
_ETHREAD *CurrentThread;
char v8;
int v9;
_LIST_ENTRY *v10;
__int64 v11;
v3 = (_QWORD *)((char *)Queue + 8);
OldIrql = KeGetCurrentIrql();
__writecr8(2ui64);
CurrentPrcb = KeGetCurrentPrcb();
CurrentThread = CurrentPrcb->CurrentThread;
KiAcquireKobjectLockSafe(Queue);
if( (_QWORD *)*v3 == v3
|| *((_DWORD *)Queue + 10) >= *((_DWORD *)Queue + 11)
|| (_KQUEUE *)CurrentThread->Tcb.Queue == Queue && CurrentThread->Tcb.WaitReason == 15
|| (KiWakeQueueWaiter(CurrentPrcb, Queue, (INT64)Entry), !v8) )
{
v9 = *((_DWORD *)Queue + 1);
*((_DWORD *)Queue + 1) = v9 + 1;
v10 = (_LIST_ENTRY *)((char *)Queue + 24);
v11 = *((_QWORD *)Queue + 3);
if( *(_KQUEUE **)(v11 + 8) != (_KQUEUE *)((char *)Queue + 24) )
__fastfail(3u);
Entry->Flink = (_LIST_ENTRY *)v11;
Entry->Blink = v10;
*(_QWORD *)(v11 + 8) = Entry;
v10->Flink = Entry;
if( !v9 && (_QWORD *)*v3 != v3 )
KiWakeOtherQueueWaiters(CurrentPrcb, Queue);
}
_InterlockedAnd((volatile signed __int32 *)Queue, 0xFFFFFF7F);
KiExitDispatcher(CurrentPrcb, 0i64, AdjustUnwait, 0i64, OldIrql);
}Referenced by:
No references.