26 PKMUTANT FirstObject = ObjectPointer;
31 WaitEntry = WaitList->
Flink;
36 WaitThread = WaitBlock->
Thread;
49 WaitEntry = WaitList->
Flink;
62 Thread->WaitStatus |= WaitStatus;
65 WaitBlock =
Thread->WaitBlockList;
72 WaitBlock = WaitBlock->NextWaitBlock;
73 }
while (WaitBlock !=
Thread->WaitBlockList);
110 FastMutex->Contention++;
124 ULONG BitsToRemove, BitsToAdd;
125 LONG OldValue, NewValue;
131 GuardedMutex->Contention++;
147 OldValue = GuardedMutex->Count;
160 NewValue = OldValue ^ BitsToRemove;
164 if (NewValue == OldValue)
return;
169 NewValue = OldValue + BitsToAdd;
173 if (NewValue == OldValue)
break;
246 KxQueueReadyThread(
Thread, Prcb);
318 if (!
Thread->WaitNext)
goto WaitStart;
331 if ((
Thread->ApcState.KernelApcPending) && !(
Thread->SpecialApcDisable) &&
441 if (!
Thread->WaitNext)
goto WaitStart;
454 if ((
Thread->ApcState.KernelApcPending) && !(
Thread->SpecialApcDisable) &&
506 Timer->DueTime.QuadPart)
642 if (!
Thread->WaitNext)
goto WaitStart;
661 if ((
Thread->ApcState.KernelApcPending) && !(
Thread->SpecialApcDisable) &&
765 WaitBlock = WaitBlock->NextWaitBlock;
784 Timer->DueTime.QuadPart)
795 WaitBlock->NextWaitBlock = TimerBlock;
803 CurrentObject = WaitBlock->
Object;
810 WaitBlock = WaitBlock->NextWaitBlock;
891 DelayInterval = &SafeInterval;
DECLSPEC_NORETURN VOID NTAPI KeBugCheck(ULONG BugCheckCode)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeLowerIrql(oldIrql)
#define KeGetCurrentIrql()
#define KeDelayExecutionThread(mode, foo, t)
#define ExGetPreviousMode
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG Increment
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
_Must_inspect_result_ _In_ WAIT_TYPE _In_opt_ PLARGE_INTEGER _In_opt_ PKWAIT_BLOCK WaitBlockArray
VOID FASTCALL HalRequestSoftwareInterrupt(IN KIRQL Irql)
KIRQL NTAPI KeRaiseIrqlToSynchLevel(VOID)
#define KeGetCurrentThread
NTSYSAPI NTSTATUS WINAPI NtYieldExecution(void)
#define EXCEPTION_EXECUTE_HANDLER
#define InterlockedCompareExchange
#define KiSatisfyMutantWait(Object, Thread)
#define KxSingleThreadWait()
FORCEINLINE VOID KiReleaseDispatcherLock(IN KIRQL OldIrql)
FORCEINLINE VOID KiCheckDeferredReadyList(IN PKPRCB Prcb)
FORCEINLINE VOID KiSetThreadSwapBusy(IN PKTHREAD Thread)
FORCEINLINE VOID KxRemoveTreeTimer(IN PKTIMER Timer)
FORCEINLINE PLARGE_INTEGER KiRecalculateDueTime(IN PLARGE_INTEGER OriginalDueTime, IN PLARGE_INTEGER DueTime, IN OUT PLARGE_INTEGER NewDueTime)
#define KiAddThreadToWaitList(Thread, Swappable)
FORCEINLINE VOID KiReleaseDispatcherLockFromSynchLevel(VOID)
#define KxDelayThreadWait()
#define KxMultiThreadWait()
#define KiSatisfyNonMutantWait(Object)
FORCEINLINE VOID KiAcquireDispatcherLockAtSynchLevel(VOID)
FORCEINLINE VOID KiAcquirePrcbLock(IN PKPRCB Prcb)
#define KiSatisfyObjectWait(Object, Thread)
FORCEINLINE VOID KxInsertTimer(IN PKTIMER Timer, IN ULONG Hand)
FORCEINLINE NTSTATUS KiCheckAlertability(IN PKTHREAD Thread, IN BOOLEAN Alertable, IN KPROCESSOR_MODE WaitMode)
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
_In_ PVOID _In_ BOOLEAN Alertable
enum _WAIT_TYPE WAIT_TYPE
VOID FASTCALL KeWaitForGate(PKGATE Gate, KWAIT_REASON WaitReason, KPROCESSOR_MODE WaitMode)
VOID NTAPI KiReadyThread(IN PKTHREAD Thread)
BOOLEAN FASTCALL KiSwapContext(IN KIRQL WaitIrql, IN PKTHREAD CurrentThread)
VOID NTAPI KiAdjustQuantumThread(IN PKTHREAD Thread)
LONG_PTR FASTCALL KiSwapThread(IN PKTHREAD Thread, IN PKPRCB Prcb)
VOID FASTCALL KiActivateWaiterQueue(IN PKQUEUE Queue)
VOID NTAPI KiDeliverApc(IN KPROCESSOR_MODE DeliveryMode, IN PKEXCEPTION_FRAME ExceptionFrame, IN PKTRAP_FRAME TrapFrame)
BOOLEAN NTAPI KeIsWaitListEmpty(IN PVOID Object)
VOID FASTCALL KiAcquireFastMutex(IN PFAST_MUTEX FastMutex)
VOID FASTCALL KiAcquireGuardedMutex(IN OUT PKGUARDED_MUTEX GuardedMutex)
NTSTATUS NTAPI KeWaitForMultipleObjects(IN ULONG Count, IN PVOID Object[], IN WAIT_TYPE WaitType, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL, OUT PKWAIT_BLOCK WaitBlockArray OPTIONAL)
VOID FASTCALL KiExitDispatcher(IN KIRQL OldIrql)
NTSTATUS NTAPI NtDelayExecution(IN BOOLEAN Alertable, IN PLARGE_INTEGER DelayInterval)
VOID FASTCALL KiUnwaitThread(IN PKTHREAD Thread, IN LONG_PTR WaitStatus, IN KPRIORITY Increment)
VOID FASTCALL KiUnlinkThread(IN PKTHREAD Thread, IN LONG_PTR WaitStatus)
VOID FASTCALL KiWaitTest(IN PVOID ObjectPointer, IN KPRIORITY Increment)
#define STATUS_KERNEL_APC
#define STATUS_MUTANT_LIMIT_EXCEEDED
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
#define _SEH2_YIELD(__stmt)
#define ProbeForReadLargeInteger(Ptr)
#define KeQueryInterruptTime()
PULONG MinorVersion OPTIONAL
struct _KTHREAD *RESTRICTED_POINTER OwnerThread
struct _KTHREAD * CurrentThread
struct _KTHREAD * NextThread
struct _LIST_ENTRY * Flink
#define CONTAINING_RECORD(address, type, field)
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ WDFTIMER _In_ LONGLONG DueTime
#define MAXIMUM_WAIT_OBJECTS
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
#define GM_LOCK_WAITER_WOKEN
struct _KMUTANT * PKMUTANT
#define THREAD_WAIT_OBJECTS
enum _KWAIT_REASON KWAIT_REASON
#define GM_LOCK_WAITER_INC
_In_ KPROCESSOR_MODE PreviousMode