ReactOS 0.4.16-dev-340-g0540c21
kefuncs.h File Reference
#include <umtypes.h>
#include <ketypes.h>
#include <section_attribs.h>
Include dependency graph for kefuncs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

FORCEINLINE KAFFINITY AFFINITY_MASK (ULONG Index)
 
FORCEINLINE BOOLEAN BitScanForwardAffinity (PULONG Index, KAFFINITY Mask)
 
FORCEINLINE BOOLEAN BitScanReverseAffinity (PULONG Index, KAFFINITY Mask)
 
FORCEINLINE BOOLEAN InterlockedBitTestAndSetAffinity (volatile KAFFINITY *Affinity, ULONG Index)
 
FORCEINLINE BOOLEAN InterlockedBitTestAndResetAffinity (volatile KAFFINITY *Affinity, ULONG Index)
 
VOID NTAPI KeInitializeApc (_In_ PKAPC Apc, _In_ PKTHREAD Thread, _In_ KAPC_ENVIRONMENT TargetEnvironment, _In_ PKKERNEL_ROUTINE KernelRoutine, _In_opt_ PKRUNDOWN_ROUTINE RundownRoutine, _In_ PKNORMAL_ROUTINE NormalRoutine, _In_ KPROCESSOR_MODE Mode, _In_ PVOID Context)
 
BOOLEAN NTAPI KeInsertQueueApc (_In_ PKAPC Apc, _In_ PVOID SystemArgument1, _In_ PVOID SystemArgument2, _In_ KPRIORITY PriorityBoost)
 
VOID NTAPI KiDeliverApc (_In_ KPROCESSOR_MODE PreviousMode, _Reserved_ PKEXCEPTION_FRAME ExceptionFrame, _In_ PKTRAP_FRAME TrapFrame)
 
VOID NTAPI KeTerminateThread (_In_ KPRIORITY Increment)
 
BOOLEAN NTAPI KeIsAttachedProcess (VOID)
 
VOID NTAPI KeSetEventBoostPriority (_In_ PKEVENT Event, _In_opt_ PKTHREAD *Thread)
 
KAFFINITY NTAPI KeSetAffinityThread (_Inout_ PKTHREAD Thread, _In_ KAFFINITY Affinity)
 
PKPROCESS NTAPI KeGetCurrentProcess (VOID)
 
BOOLEAN NTAPI KeAddSystemServiceTable (_In_ PULONG_PTR Base, _In_opt_ PULONG Count, _In_ ULONG Limit, _In_ PUCHAR Number, _In_ ULONG Index)
 
VOID FASTCALL KiAcquireSpinLock (_Inout_ PKSPIN_LOCK SpinLock)
 
VOID FASTCALL KiReleaseSpinLock (_Inout_ PKSPIN_LOCK SpinLock)
 
KIRQL FASTCALL KeAcquireQueuedSpinLockRaiseToSynch (_In_ KSPIN_LOCK_QUEUE_NUMBER LockNumber)
 
BOOLEAN FASTCALL KeTryToAcquireQueuedSpinLockRaiseToSynch (_In_ KSPIN_LOCK_QUEUE_NUMBER LockNumber, _In_ PKIRQL OldIrql)
 
VOID FASTCALL KeAcquireInStackQueuedSpinLockRaiseToSynch (_In_ PKSPIN_LOCK SpinLock, _In_ PKLOCK_QUEUE_HANDLE LockHandle)
 
VOID NTAPI KeInitializeInterrupt (_Out_ PKINTERRUPT InterruptObject, _In_ PKSERVICE_ROUTINE ServiceRoutine, _In_ PVOID ServiceContext, _In_ PKSPIN_LOCK SpinLock, _In_ ULONG Vector, _In_ KIRQL Irql, _In_ KIRQL SynchronizeIrql, _In_ KINTERRUPT_MODE InterruptMode, _In_ BOOLEAN ShareVector, _In_ CHAR ProcessorNumber, _In_ BOOLEAN FloatingSave)
 
BOOLEAN NTAPI KeConnectInterrupt (_Inout_ PKINTERRUPT InterruptObject)
 
BOOLEAN NTAPI KeDisconnectInterrupt (_Inout_ PKINTERRUPT InterruptObject)
 
VOID NTAPI KiDispatchInterrupt (VOID)
 
VOID NTAPI KiCoprocessorError (VOID)
 
DECLSPEC_NORETURN VOID __cdecl KiUnexpectedInterrupt (VOID)
 
VOID NTAPI KeEnterKernelDebugger (VOID)
 
BOOLEAN NTAPI KeIsExecutingDpc (VOID)
 
BOOLEAN NTAPI KiIpiServiceRoutine (_In_ PKTRAP_FRAME TrapFrame, _Reserved_ PKEXCEPTION_FRAME ExceptionFrame)
 
VOID NTAPI KeGenericCallDpc (_In_ PKDEFERRED_ROUTINE Routine, _In_ PVOID Context)
 
VOID NTAPI KeSignalCallDpcDone (_In_ PVOID SystemArgument1)
 
BOOLEAN NTAPI KeSignalCallDpcSynchronize (_In_ PVOID SystemArgument2)
 
VOID NTAPI KeFlushEntireTb (_In_ BOOLEAN Invalid, _In_ BOOLEAN AllProcessors)
 
VOID NTAPI KeSetDmaIoCoherency (_In_ ULONG Coherency)
 
VOID KeSetGdtSelector (_In_ ULONG Entry, _In_ ULONG Value1, _In_ ULONG Value2)
 
VOID NTAPI KeProfileInterrupt (_In_ PKTRAP_FRAME TrapFrame)
 
VOID NTAPI KeProfileInterruptWithSource (_In_ PKTRAP_FRAME TrapFrame, _In_ KPROFILE_SOURCE Source)
 
VOID NTAPI KeSetProfileIrql (_In_ KIRQL ProfileIrql)
 
VOID NTAPI KeSetTimeIncrement (_In_ ULONG MaxIncrement, _In_ ULONG MinIncrement)
 
NTSTATUS NTAPI Ke386CallBios (_In_ ULONG BiosCommand, _Inout_ PCONTEXT BiosArguments)
 
NTSTATUS NTAPI KeUserModeCallback (_In_ ULONG FunctionID, _In_reads_opt_(InputLength) PVOID InputBuffer, _In_ ULONG InputLength, _Outptr_result_buffer_(*OutputLength) PVOID *OutputBuffer, _Out_ PULONG OutputLength)
 
NTSTATUS NTAPI KeRaiseUserException (_In_ NTSTATUS ExceptionCode)
 
NTSYSCALLAPI NTSTATUS NTAPI NtContinue (_In_ PCONTEXT Context, _In_ BOOLEAN TestAlert)
 
NTSYSCALLAPI NTSTATUS NTAPI NtCallbackReturn (_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
 
NTSYSCALLAPI NTSTATUS NTAPI NtCreateProfile (_Out_ PHANDLE ProfileHandle, _In_ HANDLE ProcessHandle, _In_ PVOID ImageBase, _In_ SIZE_T ImageSize, _In_ ULONG Granularity, _Out_ PVOID Buffer, _In_ ULONG ProfilingSize, _In_ KPROFILE_SOURCE Source, _In_ KAFFINITY ProcessorMask)
 
NTSYSCALLAPI NTSTATUS NTAPI NtCreateProfileEx (_Out_ PHANDLE ProfileHandle, _In_ HANDLE ProcessHandle, _In_ PVOID ImageBase, _In_ SIZE_T ImageSize, _In_ ULONG Granularity, _Out_ PVOID Buffer, _In_ ULONG ProfilingSize, _In_ KPROFILE_SOURCE Source, _In_ USHORT GroupCount, _In_reads_(GroupCount) PGROUP_AFFINITY Affinity)
 
NTSYSCALLAPI NTSTATUS NTAPI NtDelayExecution (_In_ BOOLEAN Alertable, _In_ LARGE_INTEGER *Interval)
 
ULONG NTAPI NtGetCurrentProcessorNumber (VOID)
 
NTSYSCALLAPI NTSTATUS NTAPI NtGetContextThread (_In_ HANDLE ThreadHandle, _Out_ PCONTEXT Context)
 
NTSYSCALLAPI ULONG NTAPI NtGetTickCount (VOID)
 
NTSYSCALLAPI NTSTATUS NTAPI NtQueryIntervalProfile (_In_ KPROFILE_SOURCE ProfileSource, _Out_ PULONG Interval)
 
NTSYSCALLAPI NTSTATUS NTAPI NtQueryPerformanceCounter (_Out_ PLARGE_INTEGER Counter, _Out_opt_ PLARGE_INTEGER Frequency)
 
NTSYSCALLAPI NTSTATUS NTAPI NtQuerySystemTime (_Out_ PLARGE_INTEGER CurrentTime)
 
NTSYSCALLAPI NTSTATUS NTAPI NtQueryTimerResolution (_Out_ PULONG MinimumResolution, _Out_ PULONG MaximumResolution, _Out_ PULONG ActualResolution)
 
NTSYSCALLAPI NTSTATUS NTAPI NtQueueApcThread (_In_ HANDLE ThreadHandle, _In_ PKNORMAL_ROUTINE ApcRoutine, _In_opt_ PVOID NormalContext, _In_opt_ PVOID SystemArgument1, _In_opt_ PVOID SystemArgument2)
 
NTSYSCALLAPI NTSTATUS NTAPI NtQueueApcThreadEx (_In_ HANDLE ThreadHandle, _In_opt_ HANDLE UserApcReserveHandle, _In_ PKNORMAL_ROUTINE ApcRoutine, _In_opt_ PVOID NormalContext, _In_opt_ PVOID SystemArgument1, _In_opt_ PVOID SystemArgument2)
 
NTSYSCALLAPI NTSTATUS NTAPI NtRaiseException (_In_ PEXCEPTION_RECORD ExceptionRecord, _In_ PCONTEXT Context, _In_ BOOLEAN SearchFrames)
 
NTSYSCALLAPI NTSTATUS NTAPI NtSetContextThread (_In_ HANDLE ThreadHandle, _In_ PCONTEXT Context)
 
NTSYSCALLAPI NTSTATUS NTAPI NtSetIntervalProfile (_In_ ULONG Interval, _In_ KPROFILE_SOURCE ClockSource)
 
NTSYSCALLAPI NTSTATUS NTAPI NtSetLdtEntries (_In_ ULONG Selector1, _In_ LDT_ENTRY LdtEntry1, _In_ ULONG Selector2, _In_ LDT_ENTRY LdtEntry2)
 
NTSYSCALLAPI NTSTATUS NTAPI NtSetSystemTime (_In_ PLARGE_INTEGER SystemTime, _In_opt_ PLARGE_INTEGER NewSystemTime)
 
NTSYSCALLAPI NTSTATUS NTAPI NtSetTimerResolution (_In_ ULONG RequestedResolution, _In_ BOOLEAN SetOrUnset, _Out_ PULONG ActualResolution)
 
NTSYSCALLAPI NTSTATUS NTAPI NtStartProfile (_In_ HANDLE ProfileHandle)
 
NTSYSCALLAPI NTSTATUS NTAPI NtStopProfile (_In_ HANDLE ProfileHandle)
 
NTSYSCALLAPI NTSTATUS NTAPI NtTestAlert (VOID)
 
NTSYSCALLAPI NTSTATUS NTAPI NtVdmControl (_In_ ULONG ControlCode, _In_ PVOID ControlData)
 
NTSYSCALLAPI NTSTATUS NTAPI NtW32Call (_In_ ULONG RoutineIndex, _In_ PVOID Argument, _In_ ULONG ArgumentLength, _Out_opt_ PVOID *Result, _Out_opt_ PULONG ResultLength)
 
NTSYSCALLAPI NTSTATUS NTAPI NtYieldExecution (VOID)
 
NTSYSAPI NTSTATUS NTAPI ZwContinue (_In_ PCONTEXT Context, _In_ BOOLEAN TestAlert)
 
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn (_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
 
NTSYSAPI NTSTATUS NTAPI ZwCreateProfile (_Out_ PHANDLE ProfileHandle, _In_ HANDLE ProcessHandle, _In_ PVOID ImageBase, _In_ ULONG ImageSize, _In_ ULONG Granularity, _Out_ PVOID Buffer, _In_ ULONG ProfilingSize, _In_ KPROFILE_SOURCE Source, _In_ KAFFINITY ProcessorMask)
 
NTSYSAPI NTSTATUS NTAPI ZwDelayExecution (_In_ BOOLEAN Alertable, _In_ LARGE_INTEGER *Interval)
 
NTSYSAPI NTSTATUS NTAPI ZwFlushInstructionCache (_In_ HANDLE ProcessHandle, _In_ PVOID BaseAddress, _In_ ULONG NumberOfBytesToFlush)
 
NTSYSAPI NTSTATUS NTAPI ZwGetContextThread (_In_ HANDLE ThreadHandle, _Out_ PCONTEXT Context)
 
NTSYSAPI ULONG NTAPI ZwGetTickCount (VOID)
 
NTSYSAPI NTSTATUS NTAPI ZwQueryIntervalProfile (_In_ KPROFILE_SOURCE ProfileSource, _Out_ PULONG Interval)
 
NTSYSAPI NTSTATUS NTAPI ZwQueryPerformanceCounter (_Out_ PLARGE_INTEGER Counter, _Out_opt_ PLARGE_INTEGER Frequency)
 
NTSYSAPI NTSTATUS NTAPI ZwQuerySystemTime (_Out_ PLARGE_INTEGER CurrentTime)
 
NTSYSAPI NTSTATUS NTAPI ZwQueryTimerResolution (_Out_ PULONG MinimumResolution, _Out_ PULONG MaximumResolution, _Out_ PULONG ActualResolution)
 
NTSYSAPI NTSTATUS NTAPI ZwQueueApcThread (_In_ HANDLE ThreadHandle, _In_ PKNORMAL_ROUTINE ApcRoutine, _In_opt_ PVOID NormalContext, _In_opt_ PVOID SystemArgument1, _In_opt_ PVOID SystemArgument2)
 
NTSYSAPI NTSTATUS NTAPI ZwRaiseException (_In_ PEXCEPTION_RECORD ExceptionRecord, _In_ PCONTEXT Context, _In_ BOOLEAN SearchFrames)
 
NTSYSAPI NTSTATUS NTAPI ZwSetContextThread (_In_ HANDLE ThreadHandle, _In_ PCONTEXT Context)
 
NTSYSAPI NTSTATUS NTAPI ZwSetIntervalProfile (_In_ ULONG Interval, _In_ KPROFILE_SOURCE ClockSource)
 
NTSYSAPI NTSTATUS NTAPI ZwSetLdtEntries (_In_ ULONG Selector1, _In_ LDT_ENTRY LdtEntry1, _In_ ULONG Selector2, _In_ LDT_ENTRY LdtEntry2)
 
NTSYSAPI NTSTATUS NTAPI ZwSetSystemTime (_In_ PLARGE_INTEGER SystemTime, _In_opt_ PLARGE_INTEGER NewSystemTime)
 
NTSYSAPI NTSTATUS NTAPI ZwSetTimerResolution (_In_ ULONG RequestedResolution, _In_ BOOLEAN SetOrUnset, _Out_ PULONG ActualResolution)
 
NTSYSAPI NTSTATUS NTAPI ZwStartProfile (_In_ HANDLE ProfileHandle)
 
NTSYSAPI NTSTATUS NTAPI ZwStopProfile (_In_ HANDLE ProfileHandle)
 
NTSYSAPI NTSTATUS NTAPI ZwTestAlert (VOID)
 
NTSYSAPI NTSTATUS NTAPI ZwVdmControl (_In_ ULONG ControlCode, _In_ PVOID ControlData)
 
NTSYSAPI NTSTATUS NTAPI ZwW32Call (_In_ ULONG RoutineIndex, _In_ PVOID Argument, _In_ ULONG ArgumentLength, _Out_opt_ PVOID *Result, _Out_opt_ PULONG ResultLength)
 
NTSYSAPI NTSTATUS NTAPI ZwYieldExecution (VOID)
 

Function Documentation

◆ AFFINITY_MASK()

◆ BitScanForwardAffinity()

FORCEINLINE BOOLEAN BitScanForwardAffinity ( PULONG  Index,
KAFFINITY  Mask 
)

Definition at line 45 of file kefuncs.h.

46{
47#ifdef _WIN64
48 return BitScanForward64(Index, Mask);
49#else
50 return BitScanForward(Index, Mask);
51#endif
52}
unsigned int Mask
Definition: fpcontrol.c:82
#define BitScanForward
Definition: interlocked.h:5

Referenced by HalRequestIpiSpecifyVector().

◆ BitScanReverseAffinity()

FORCEINLINE BOOLEAN BitScanReverseAffinity ( PULONG  Index,
KAFFINITY  Mask 
)

Definition at line 54 of file kefuncs.h.

55{
56#ifdef _WIN64
57 return BitScanReverse64(Index, Mask);
58#else
59 return BitScanReverse(Index, Mask);
60#endif
61}
#define BitScanReverse
Definition: interlocked.h:6

Referenced by KeFindNextRightSetAffinity(), and KeSetSystemAffinityThread().

◆ InterlockedBitTestAndResetAffinity()

FORCEINLINE BOOLEAN InterlockedBitTestAndResetAffinity ( volatile KAFFINITY Affinity,
ULONG  Index 
)

Definition at line 73 of file kefuncs.h.

74{
75 ASSERT(Index < sizeof(KAFFINITY) * 8);
76#ifdef _WIN64
77 return InterlockedBitTestAndReset64((PLONG64)Affinity, Index);
78#else
80#endif
81}
__int64 * PLONG64
Definition: basetsd.h:183
#define InterlockedBitTestAndReset
Definition: interlocked.h:35
int32_t * PLONG
Definition: typedefs.h:58
_In_ ULONG _In_ ULONG _In_ ULONG _Out_ PKIRQL _Out_ PKAFFINITY Affinity
Definition: halfuncs.h:174

◆ InterlockedBitTestAndSetAffinity()

FORCEINLINE BOOLEAN InterlockedBitTestAndSetAffinity ( volatile KAFFINITY Affinity,
ULONG  Index 
)

Definition at line 63 of file kefuncs.h.

64{
65 ASSERT(Index < sizeof(KAFFINITY) * 8);
66#ifdef _WIN64
67 return InterlockedBitTestAndSet64((PLONG64)Affinity, Index);
68#else
70#endif
71}
#define InterlockedBitTestAndSet
Definition: interlocked.h:30

Referenced by HalInitializeProcessor().

◆ Ke386CallBios()

NTSTATUS NTAPI Ke386CallBios ( _In_ ULONG  BiosCommand,
_Inout_ PCONTEXT  BiosArguments 
)

◆ KeAcquireInStackQueuedSpinLockRaiseToSynch()

VOID FASTCALL KeAcquireInStackQueuedSpinLockRaiseToSynch ( _In_ PKSPIN_LOCK  SpinLock,
_In_ PKLOCK_QUEUE_HANDLE  LockHandle 
)

◆ KeAcquireQueuedSpinLockRaiseToSynch()

KIRQL FASTCALL KeAcquireQueuedSpinLockRaiseToSynch ( _In_ KSPIN_LOCK_QUEUE_NUMBER  LockNumber)

◆ KeAddSystemServiceTable()

BOOLEAN NTAPI KeAddSystemServiceTable ( _In_ PULONG_PTR  Base,
_In_opt_ PULONG  Count,
_In_ ULONG  Limit,
_In_ PUCHAR  Number,
_In_ ULONG  Index 
)

◆ KeConnectInterrupt()

BOOLEAN NTAPI KeConnectInterrupt ( _Inout_ PKINTERRUPT  InterruptObject)

◆ KeDisconnectInterrupt()

BOOLEAN NTAPI KeDisconnectInterrupt ( _Inout_ PKINTERRUPT  InterruptObject)

◆ KeEnterKernelDebugger()

VOID NTAPI KeEnterKernelDebugger ( VOID  )

Definition at line 1441 of file bug.c.

1442{
1443 /* Disable interrupts */
1445 _disable();
1446
1447 /* Check the bugcheck count */
1449 {
1450 /* There was only one, is the debugger disabled? */
1452 {
1453 /* Enable the debugger */
1454 KdInitSystem(0, NULL);
1455 }
1456 }
1457
1458 /* Break in the debugger */
1460}
#define InterlockedDecrement
Definition: armddk.h:52
VOID NTAPI KiBugCheckDebugBreak(IN ULONG StatusCode)
Definition: bug.c:493
ULONG KeBugCheckCount
Definition: bug.c:28
ULONG KiHardwareTrigger
Definition: bug.c:29
#define NULL
Definition: types.h:112
void __cdecl _disable(void)
Definition: intrin_arm.h:365
BOOLEAN NTAPI KdInitSystem(_In_ ULONG BootPhase, _In_opt_ PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: kdinit.c:161
BOOLEAN KdPitchDebugger
Definition: kddata.c:80
BOOLEAN KdDebuggerEnabled
Definition: kddata.c:82
#define DBG_STATUS_FATAL
Definition: kdtypes.h:43

Referenced by HalHandleNMI().

◆ KeFlushEntireTb()

VOID NTAPI KeFlushEntireTb ( _In_ BOOLEAN  Invalid,
_In_ BOOLEAN  AllProcessors 
)

◆ KeGenericCallDpc()

VOID NTAPI KeGenericCallDpc ( _In_ PKDEFERRED_ROUTINE  Routine,
_In_ PVOID  Context 
)

◆ KeGetCurrentProcess()

PKPROCESS NTAPI KeGetCurrentProcess ( VOID  )

◆ KeInitializeApc()

VOID NTAPI KeInitializeApc ( _In_ PKAPC  Apc,
_In_ PKTHREAD  Thread,
_In_ KAPC_ENVIRONMENT  TargetEnvironment,
_In_ PKKERNEL_ROUTINE  KernelRoutine,
_In_opt_ PKRUNDOWN_ROUTINE  RundownRoutine,
_In_ PKNORMAL_ROUTINE  NormalRoutine,
_In_ KPROCESSOR_MODE  Mode,
_In_ PVOID  Context 
)

◆ KeInitializeInterrupt()

VOID NTAPI KeInitializeInterrupt ( _Out_ PKINTERRUPT  InterruptObject,
_In_ PKSERVICE_ROUTINE  ServiceRoutine,
_In_ PVOID  ServiceContext,
_In_ PKSPIN_LOCK  SpinLock,
_In_ ULONG  Vector,
_In_ KIRQL  Irql,
_In_ KIRQL  SynchronizeIrql,
_In_ KINTERRUPT_MODE  InterruptMode,
_In_ BOOLEAN  ShareVector,
_In_ CHAR  ProcessorNumber,
_In_ BOOLEAN  FloatingSave 
)

◆ KeInsertQueueApc()

BOOLEAN NTAPI KeInsertQueueApc ( _In_ PKAPC  Apc,
_In_ PVOID  SystemArgument1,
_In_ PVOID  SystemArgument2,
_In_ KPRIORITY  PriorityBoost 
)

◆ KeIsAttachedProcess()

BOOLEAN NTAPI KeIsAttachedProcess ( VOID  )

Definition at line 693 of file procobj.c.

694{
695 /* Return the APC State */
696 return KeGetCurrentThread()->ApcStateIndex;
697}
#define KeGetCurrentThread
Definition: hal.h:55

Referenced by IntEnlistPowerCallout(), MiAccessCheck(), MiCheckForUserStackOverflow(), MmWorkingSetManager(), ObpCloseHandle(), PspExitThread(), and RtlWalkFrameChain().

◆ KeIsExecutingDpc()

◆ KeProfileInterrupt()

VOID NTAPI KeProfileInterrupt ( _In_ PKTRAP_FRAME  TrapFrame)

◆ KeProfileInterruptWithSource()

VOID NTAPI KeProfileInterruptWithSource ( _In_ PKTRAP_FRAME  TrapFrame,
_In_ KPROFILE_SOURCE  Source 
)

◆ KeRaiseUserException()

NTSTATUS NTAPI KeRaiseUserException ( _In_ NTSTATUS  ExceptionCode)

Definition at line 266 of file exp.c.

268{
269 ASSERT(FALSE);
271}
#define STATUS_NOT_IMPLEMENTED
Definition: d3dkmdt.h:42
#define FALSE
Definition: types.h:117

◆ KeSetAffinityThread()

KAFFINITY NTAPI KeSetAffinityThread ( _Inout_ PKTHREAD  Thread,
_In_ KAFFINITY  Affinity 
)

◆ KeSetDmaIoCoherency()

VOID NTAPI KeSetDmaIoCoherency ( _In_ ULONG  Coherency)

◆ KeSetEventBoostPriority()

VOID NTAPI KeSetEventBoostPriority ( _In_ PKEVENT  Event,
_In_opt_ PKTHREAD Thread 
)

◆ KeSetGdtSelector()

VOID KeSetGdtSelector ( _In_ ULONG  Entry,
_In_ ULONG  Value1,
_In_ ULONG  Value2 
)

◆ KeSetProfileIrql()

VOID NTAPI KeSetProfileIrql ( _In_ KIRQL  ProfileIrql)

◆ KeSetTimeIncrement()

VOID NTAPI KeSetTimeIncrement ( _In_ ULONG  MaxIncrement,
_In_ ULONG  MinIncrement 
)

◆ KeSignalCallDpcDone()

VOID NTAPI KeSignalCallDpcDone ( _In_ PVOID  SystemArgument1)

◆ KeSignalCallDpcSynchronize()

BOOLEAN NTAPI KeSignalCallDpcSynchronize ( _In_ PVOID  SystemArgument2)

◆ KeTerminateThread()

VOID NTAPI KeTerminateThread ( _In_ KPRIORITY  Increment)

◆ KeTryToAcquireQueuedSpinLockRaiseToSynch()

BOOLEAN FASTCALL KeTryToAcquireQueuedSpinLockRaiseToSynch ( _In_ KSPIN_LOCK_QUEUE_NUMBER  LockNumber,
_In_ PKIRQL  OldIrql 
)

◆ KeUserModeCallback()

NTSTATUS NTAPI KeUserModeCallback ( _In_ ULONG  FunctionID,
_In_reads_opt_(InputLength) PVOID  InputBuffer,
_In_ ULONG  InputLength,
_Outptr_result_buffer_ *OutputLength PVOID OutputBuffer,
_Out_ PULONG  OutputLength 
)

◆ KiAcquireSpinLock()

VOID FASTCALL KiAcquireSpinLock ( _Inout_ PKSPIN_LOCK  SpinLock)

◆ KiCoprocessorError()

VOID NTAPI KiCoprocessorError ( VOID  )

Definition at line 1321 of file cpu.c.

1322{
1323 PFX_SAVE_AREA NpxArea;
1324
1325 /* Get the FPU area */
1327
1328 /* Set CR0_TS */
1329 NpxArea->Cr0NpxState = CR0_TS;
1331}
__INTRIN_INLINE unsigned long __readcr0(void)
Definition: intrin_x86.h:1804
__INTRIN_INLINE void __writecr0(unsigned int Data)
Definition: intrin_x86.h:1789
#define CR0_TS
Definition: asm.h:248
FORCEINLINE PFX_SAVE_AREA KiGetThreadNpxArea(IN PKTHREAD Thread)
Definition: ke.h:733
ULONG Cr0NpxState
Definition: ketypes.h:505

◆ KiDeliverApc()

VOID NTAPI KiDeliverApc ( _In_ KPROCESSOR_MODE  PreviousMode,
_Reserved_ PKEXCEPTION_FRAME  ExceptionFrame,
_In_ PKTRAP_FRAME  TrapFrame 
)

◆ KiDispatchInterrupt()

VOID NTAPI KiDispatchInterrupt ( VOID  )

Definition at line 305 of file thrdini.c.

306{
307 PKIPCR Pcr = (PKIPCR)KeGetPcr();
308 PKPRCB Prcb = &Pcr->Prcb;
309 PKTHREAD NewThread, OldThread;
310
311 /* Disable interrupts */
312 _disable();
313
314 /* Check for pending timers, pending DPCs, or pending ready threads */
315 if ((Prcb->DpcData[0].DpcQueueDepth) ||
316 (Prcb->TimerRequest) ||
318 {
319 /* Retire DPCs while under the DPC stack */
320 //KiRetireDpcListInDpcStack(Prcb, Prcb->DpcStack);
321 // FIXME!!! //
322 KiRetireDpcList(Prcb);
323 }
324
325 /* Re-enable interrupts */
326 _enable();
327
328 /* Check for quantum end */
329 if (Prcb->QuantumEnd)
330 {
331 /* Handle quantum end */
332 Prcb->QuantumEnd = FALSE;
333 KiQuantumEnd();
334 }
335 else if (Prcb->NextThread)
336 {
337 /* Acquire the PRCB lock */
338 KiAcquirePrcbLock(Prcb);
339
340 /* Capture current thread data */
341 OldThread = Prcb->CurrentThread;
342 NewThread = Prcb->NextThread;
343
344 /* Set new thread data */
345 Prcb->NextThread = NULL;
346 Prcb->CurrentThread = NewThread;
347
348 /* The thread is now running */
349 NewThread->State = Running;
350 OldThread->WaitReason = WrDispatchInt;
351
352 /* Make the old thread ready */
353 KxQueueReadyThread(OldThread, Prcb);
354
355 /* Swap to the new thread */
356 KiSwapContext(APC_LEVEL, OldThread);
357 }
358}
#define APC_LEVEL
Definition: env_spec_w32.h:695
void __cdecl _enable(void)
Definition: intrin_arm.h:373
FORCEINLINE VOID KiAcquirePrcbLock(IN PKPRCB Prcb)
Definition: ke_x.h:220
struct _KIPCR * PKIPCR
#define KeGetPcr()
Definition: ketypes.h:81
@ Running
Definition: ketypes.h:390
BOOLEAN FASTCALL KiSwapContext(IN KIRQL WaitIrql, IN PKTHREAD CurrentThread)
VOID NTAPI KiQuantumEnd(VOID)
VOID FASTCALL KiRetireDpcList(IN PKPRCB Prcb)
Definition: dpc.c:562
volatile ULONG DpcQueueDepth
Definition: ketypes.h:858
KPRCB Prcb
Definition: ketypes.h:965
UINT64 TimerRequest
Definition: ketypes.h:764
KDPC_DATA DpcData[2]
Definition: ketypes.h:749
UCHAR QuantumEnd
Definition: ketypes.h:769
struct _KTHREAD * CurrentThread
Definition: ketypes.h:639
struct _KTHREAD * NextThread
Definition: ketypes.h:640
SINGLE_LIST_ENTRY DeferredReadyListHead
Definition: ketypes.h:701
UCHAR WaitReason
Definition: ketypes.h:1964
volatile UCHAR State
Definition: ketypes.h:1789
struct _SINGLE_LIST_ENTRY * Next
Definition: ntbasedef.h:637
@ WrDispatchInt
Definition: ketypes.h:446

Referenced by _HalpDispatchInterruptHandler(), HalpDispatchInterruptHandler(), HalpLowerIrql(), and KiInitializePcr().

◆ KiIpiServiceRoutine()

BOOLEAN NTAPI KiIpiServiceRoutine ( _In_ PKTRAP_FRAME  TrapFrame,
_Reserved_ PKEXCEPTION_FRAME  ExceptionFrame 
)

◆ KiReleaseSpinLock()

VOID FASTCALL KiReleaseSpinLock ( _Inout_ PKSPIN_LOCK  SpinLock)

◆ KiUnexpectedInterrupt()

DECLSPEC_NORETURN VOID __cdecl KiUnexpectedInterrupt ( VOID  )

Definition at line 51 of file interrupt.c.

52{
53 /* Crash the machine */
54 KeBugCheck(TRAP_CAUSE_UNKNOWN);
55}
DECLSPEC_NORETURN VOID NTAPI KeBugCheck(ULONG BugCheckCode)
Definition: bug.c:1430

Referenced by KiInitializeKernel().

◆ NtCallbackReturn()

NTSYSCALLAPI NTSTATUS NTAPI NtCallbackReturn ( _In_ PVOID  Result,
_In_ ULONG  ResultLength,
_In_ NTSTATUS  Status 
)

Definition at line 329 of file usercall.c.

333{
334 PKTHREAD CurrentThread;
335 PKCALLOUT_FRAME CalloutFrame;
336 PKTRAP_FRAME CallbackTrapFrame, TrapFrame;
337 PKIPCR Pcr;
338
339 /* Get the current thread and make sure we have a callback stack */
340 CurrentThread = KeGetCurrentThread();
341 CalloutFrame = CurrentThread->CallbackStack;
342 if (CalloutFrame == NULL)
343 {
345 }
346
347 /* Store the results in the callback stack */
348 *((PVOID*)CalloutFrame->OutputBuffer) = Result;
349 *((ULONG*)CalloutFrame->OutputLength) = ResultLength;
350
351 /* Get the trap frame */
352 CallbackTrapFrame = CurrentThread->TrapFrame;
353
354 /* Disable interrupts for NPX save and stack switch */
355 _disable();
356
357 /* Restore the exception list */
358 Pcr = (PKIPCR)KeGetPcr();
359
360 /* Get the previous trap frame */
361 TrapFrame = (PKTRAP_FRAME)CalloutFrame->TrapFrame;
362
363 /* Check if we failed in user mode */
365 {
366 *TrapFrame = *CallbackTrapFrame;
367 }
368
369 /* Clear DR7 */
370 TrapFrame->Dr7 = 0;
371
372 /* Check if debugging was active */
373 if (CurrentThread->Header.DebugActive & 0xFF)
374 {
375 /* Copy debug registers data from it */
376 TrapFrame->Dr0 = CallbackTrapFrame->Dr0;
377 TrapFrame->Dr1 = CallbackTrapFrame->Dr1;
378 TrapFrame->Dr2 = CallbackTrapFrame->Dr2;
379 TrapFrame->Dr3 = CallbackTrapFrame->Dr3;
380 TrapFrame->Dr6 = CallbackTrapFrame->Dr6;
381 TrapFrame->Dr7 = CallbackTrapFrame->Dr7;
382 }
383
384 /* Switch the stack back to the previous value */
385 Pcr->TssBase->Rsp0 = CalloutFrame->InitialStack;
386 Pcr->Prcb.RspBase = CalloutFrame->InitialStack;
387
388 /* Get the initial stack and restore it */
389 CurrentThread->InitialStack = (PVOID)CalloutFrame->InitialStack;
390
391 /* Restore the trap frame and the previous callback stack */
392 CurrentThread->TrapFrame = TrapFrame;
393 CurrentThread->CallbackStack = (PVOID)CalloutFrame->CallbackStack;
394
395 /* Bring interrupts back */
396 _enable();
397
398 /* Now switch back to the old stack */
399 KiCallbackReturn(CalloutFrame, CallbackStatus);
400}
_In_ FLT_PREOP_CALLBACK_STATUS CallbackStatus
Definition: fltkernel.h:1020
if(dx< 0)
Definition: linetemp.h:194
struct _KTRAP_FRAME * PKTRAP_FRAME
DECLSPEC_NORETURN VOID FASTCALL KiCallbackReturn(IN PVOID Stack, IN NTSTATUS Status)
#define STATUS_CALLBACK_POP_STACK
Definition: ntstatus.h:961
#define STATUS_NO_CALLBACK_ACTIVE
Definition: ntstatus.h:726
BOOLEAN DebugActive
Definition: ketypes.h:793
ULONG64 OutputBuffer
Definition: ketypes.h:1027
ULONG64 OutputLength
Definition: ketypes.h:1028
ULONG64 TrapFrame
Definition: ketypes.h:1023
struct _KTSS64 * TssBase
Definition: ketypes.h:937
UINT64 RspBase
Definition: ketypes.h:649
PKTRAP_FRAME TrapFrame
Definition: ketypes.h:1774
PVOID InitialStack
Definition: ketypes.h:1664
DISPATCHER_HEADER Header
Definition: ketypes.h:1661
UINT64 Dr0
Definition: ketypes.h:416
UINT64 Dr6
Definition: ketypes.h:420
UINT64 Dr3
Definition: ketypes.h:419
UINT64 Dr7
Definition: ketypes.h:421
UINT64 Dr1
Definition: ketypes.h:417
UINT64 Dr2
Definition: ketypes.h:418
void * PVOID
Definition: typedefs.h:50
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
Definition: wdfdevice.h:3776
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

Referenced by KiCallbackReturnHandler(), and VectoredExceptionHandlerForUserModeCallback().

◆ NtContinue()

NTSYSCALLAPI NTSTATUS NTAPI NtContinue ( _In_ PCONTEXT  Context,
_In_ BOOLEAN  TestAlert 
)

Definition at line 216 of file except.c.

219{
222 PKTRAP_FRAME TrapFrame;
223#ifdef _M_IX86
224 PKEXCEPTION_FRAME ExceptionFrame = NULL;
225#else
226 KEXCEPTION_FRAME LocalExceptionFrame;
227 PKEXCEPTION_FRAME ExceptionFrame = &LocalExceptionFrame;
228#endif
229
230 /* Get trap frame and link previous one*/
232 TrapFrame = Thread->TrapFrame;
233 Thread->TrapFrame = KiGetLinkedTrapFrame(TrapFrame);
234
235 /* Continue from this point on */
236 Status = KiContinue(Context, ExceptionFrame, TrapFrame);
237 if (!NT_SUCCESS(Status))
238 {
239 DPRINT1("KiContinue failed. Status = 0x%lx\n", Status);
240 return Status;
241 }
242
243 /* Check if alert was requested */
244 if (TestAlert)
245 {
246 KeTestAlertThread(Thread->PreviousMode);
247 }
248
249 /* Exit to new context */
250 KiExceptionExit(TrapFrame, ExceptionFrame);
251}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
Status
Definition: gdiplustypes.h:25
DECLSPEC_NORETURN VOID KiExceptionExit(_In_ PKTRAP_FRAME TrapFrame, _In_ PKEXCEPTION_FRAME ExceptionFrame)
Definition: ke.h:685
#define KiGetLinkedTrapFrame(x)
Definition: ke.h:177
BOOLEAN NTAPI KeTestAlertThread(IN KPROCESSOR_MODE AlertMode)
Definition: thrdobj.c:722
NTSTATUS NTAPI KiContinue(IN PCONTEXT Context, IN PKEXCEPTION_FRAME ExceptionFrame, IN PKTRAP_FRAME TrapFrame)
Definition: except.c:42

Referenced by KiUserExceptionDispatcher(), and START_TEST().

◆ NtCreateProfile()

NTSYSCALLAPI NTSTATUS NTAPI NtCreateProfile ( _Out_ PHANDLE  ProfileHandle,
_In_ HANDLE  ProcessHandle,
_In_ PVOID  ImageBase,
_In_ SIZE_T  ImageSize,
_In_ ULONG  Granularity,
_Out_ PVOID  Buffer,
_In_ ULONG  ProfilingSize,
_In_ KPROFILE_SOURCE  Source,
_In_ KAFFINITY  ProcessorMask 
)

◆ NtCreateProfileEx()

NTSYSCALLAPI NTSTATUS NTAPI NtCreateProfileEx ( _Out_ PHANDLE  ProfileHandle,
_In_ HANDLE  ProcessHandle,
_In_ PVOID  ImageBase,
_In_ SIZE_T  ImageSize,
_In_ ULONG  Granularity,
_Out_ PVOID  Buffer,
_In_ ULONG  ProfilingSize,
_In_ KPROFILE_SOURCE  Source,
_In_ USHORT  GroupCount,
_In_reads_(GroupCount) PGROUP_AFFINITY  Affinity 
)

◆ NtDelayExecution()

NTSYSCALLAPI NTSTATUS NTAPI NtDelayExecution ( _In_ BOOLEAN  Alertable,
_In_ LARGE_INTEGER Interval 
)

◆ NtGetContextThread()

NTSYSCALLAPI NTSTATUS NTAPI NtGetContextThread ( _In_ HANDLE  ThreadHandle,
_Out_ PCONTEXT  Context 
)

◆ NtGetCurrentProcessorNumber()

ULONG NTAPI NtGetCurrentProcessorNumber ( VOID  )

Definition at line 3055 of file sysinfo.c.

3056{
3057 /* Just use Ke */
3059}
FORCEINLINE ULONG KeGetCurrentProcessorNumber(VOID)
Definition: ke.h:341

◆ NtGetTickCount()

NTSYSCALLAPI ULONG NTAPI NtGetTickCount ( VOID  )

◆ NtQueryIntervalProfile()

NTSYSCALLAPI NTSTATUS NTAPI NtQueryIntervalProfile ( _In_ KPROFILE_SOURCE  ProfileSource,
_Out_ PULONG  Interval 
)

◆ NtQueryPerformanceCounter()

NTSYSCALLAPI NTSTATUS NTAPI NtQueryPerformanceCounter ( _Out_ PLARGE_INTEGER  Counter,
_Out_opt_ PLARGE_INTEGER  Frequency 
)

◆ NtQuerySystemTime()

NTSYSCALLAPI NTSTATUS NTAPI NtQuerySystemTime ( _Out_ PLARGE_INTEGER  CurrentTime)

◆ NtQueryTimerResolution()

NTSYSCALLAPI NTSTATUS NTAPI NtQueryTimerResolution ( _Out_ PULONG  MinimumResolution,
_Out_ PULONG  MaximumResolution,
_Out_ PULONG  ActualResolution 
)

◆ NtQueueApcThread()

NTSYSCALLAPI NTSTATUS NTAPI NtQueueApcThread ( _In_ HANDLE  ThreadHandle,
_In_ PKNORMAL_ROUTINE  ApcRoutine,
_In_opt_ PVOID  NormalContext,
_In_opt_ PVOID  SystemArgument1,
_In_opt_ PVOID  SystemArgument2 
)

◆ NtQueueApcThreadEx()

NTSYSCALLAPI NTSTATUS NTAPI NtQueueApcThreadEx ( _In_ HANDLE  ThreadHandle,
_In_opt_ HANDLE  UserApcReserveHandle,
_In_ PKNORMAL_ROUTINE  ApcRoutine,
_In_opt_ PVOID  NormalContext,
_In_opt_ PVOID  SystemArgument1,
_In_opt_ PVOID  SystemArgument2 
)

◆ NtRaiseException()

NTSYSCALLAPI NTSTATUS NTAPI NtRaiseException ( _In_ PEXCEPTION_RECORD  ExceptionRecord,
_In_ PCONTEXT  Context,
_In_ BOOLEAN  SearchFrames 
)

Definition at line 173 of file except.c.

177{
180 PKTRAP_FRAME TrapFrame;
181#ifdef _M_IX86
182 PKEXCEPTION_FRAME ExceptionFrame = NULL;
183#else
184 KEXCEPTION_FRAME LocalExceptionFrame;
185 PKEXCEPTION_FRAME ExceptionFrame = &LocalExceptionFrame;
186#endif
187
188 /* Get trap frame and link previous one */
190 TrapFrame = Thread->TrapFrame;
191 Thread->TrapFrame = KiGetLinkedTrapFrame(TrapFrame);
192
193 /* Set exception list */
194#ifdef _M_IX86
195 KeGetPcr()->NtTib.ExceptionList = TrapFrame->ExceptionList;
196#endif
197
198 /* Raise the exception */
199 Status = KiRaiseException(ExceptionRecord,
200 Context,
201 ExceptionFrame,
202 TrapFrame,
203 FirstChance);
204 if (!NT_SUCCESS(Status))
205 {
206 DPRINT1("KiRaiseException failed. Status = 0x%lx\n", Status);
207 return Status;
208 }
209
210 /* It was handled, so exit restoring all state */
211 KiExceptionExit(TrapFrame, ExceptionFrame);
212}
NTSTATUS NTAPI KiRaiseException(_In_ PEXCEPTION_RECORD ExceptionRecord, _In_ PCONTEXT Context, _Out_ PKEXCEPTION_FRAME ExceptionFrame, _Out_ PKTRAP_FRAME TrapFrame, _In_ BOOLEAN SearchFrames)
Definition: except.c:90
struct _EXCEPTION_REGISTRATION_RECORD FAR * ExceptionList
Definition: ketypes.h:314

Referenced by KiUserExceptionDispatcher().

◆ NtSetContextThread()

NTSYSCALLAPI NTSTATUS NTAPI NtSetContextThread ( _In_ HANDLE  ThreadHandle,
_In_ PCONTEXT  Context 
)

◆ NtSetIntervalProfile()

NTSYSCALLAPI NTSTATUS NTAPI NtSetIntervalProfile ( _In_ ULONG  Interval,
_In_ KPROFILE_SOURCE  ClockSource 
)

◆ NtSetLdtEntries()

NTSYSCALLAPI NTSTATUS NTAPI NtSetLdtEntries ( _In_ ULONG  Selector1,
_In_ LDT_ENTRY  LdtEntry1,
_In_ ULONG  Selector2,
_In_ LDT_ENTRY  LdtEntry2 
)

◆ NtSetSystemTime()

NTSYSCALLAPI NTSTATUS NTAPI NtSetSystemTime ( _In_ PLARGE_INTEGER  SystemTime,
_In_opt_ PLARGE_INTEGER  NewSystemTime 
)

◆ NtSetTimerResolution()

NTSYSCALLAPI NTSTATUS NTAPI NtSetTimerResolution ( _In_ ULONG  RequestedResolution,
_In_ BOOLEAN  SetOrUnset,
_Out_ PULONG  ActualResolution 
)

◆ NtStartProfile()

NTSYSCALLAPI NTSTATUS NTAPI NtStartProfile ( _In_ HANDLE  ProfileHandle)

◆ NtStopProfile()

NTSYSCALLAPI NTSTATUS NTAPI NtStopProfile ( _In_ HANDLE  ProfileHandle)

◆ NtTestAlert()

NTSYSCALLAPI NTSTATUS NTAPI NtTestAlert ( VOID  )

Definition at line 465 of file state.c.

466{
467 /* Check and Alert Thread if needed */
470}
#define ExGetPreviousMode
Definition: ex.h:140
#define STATUS_ALERTED
Definition: ntstatus.h:80
#define STATUS_SUCCESS
Definition: shellext.h:65

◆ NtVdmControl()

NTSYSCALLAPI NTSTATUS NTAPI NtVdmControl ( _In_ ULONG  ControlCode,
_In_ PVOID  ControlData 
)

◆ NtW32Call()

NTSYSCALLAPI NTSTATUS NTAPI NtW32Call ( _In_ ULONG  RoutineIndex,
_In_ PVOID  Argument,
_In_ ULONG  ArgumentLength,
_Out_opt_ PVOID Result,
_Out_opt_ PULONG  ResultLength 
)

◆ NtYieldExecution()

NTSYSCALLAPI NTSTATUS NTAPI NtYieldExecution ( VOID  )

Definition at line 744 of file thrdschd.c.

745{
748 PKPRCB Prcb;
749 PKTHREAD Thread, NextThread;
750
751 /* NB: No instructions (other than entry code) should preceed this line */
752
753 /* Fail if there's no ready summary */
755
756 /* Now get the current thread, set the status... */
759
760 /* Raise IRQL to synch and get the KPRCB now */
762 Prcb = KeGetCurrentPrcb();
763
764 /* Now check if there's still a ready summary */
765 if (Prcb->ReadySummary)
766 {
767 /* Acquire thread and PRCB lock */
769 KiAcquirePrcbLock(Prcb);
770
771 /* Find a new thread to run if none was selected */
772 if (!Prcb->NextThread) Prcb->NextThread = KiSelectReadyThread(1, Prcb);
773
774 /* Make sure we still have a next thread to schedule */
775 NextThread = Prcb->NextThread;
776 if (NextThread)
777 {
778 /* Reset quantum and recalculate priority */
779 Thread->Quantum = Thread->QuantumReset;
780 Thread->Priority = KiComputeNewPriority(Thread, 1);
781
782 /* Release the thread lock */
784
785 /* Set context swap busy */
787
788 /* Set the new thread as running */
789 Prcb->NextThread = NULL;
790 Prcb->CurrentThread = NextThread;
791 NextThread->State = Running;
792
793 /* Setup a yield wait and queue the thread */
794 Thread->WaitReason = WrYieldExecution;
795 KxQueueReadyThread(Thread, Prcb);
796
797 /* Make it wait at APC_LEVEL */
798 Thread->WaitIrql = APC_LEVEL;
799
800 /* Sanity check */
802
803 /* Swap to new thread */
806 }
807 else
808 {
809 /* Release the PRCB and thread lock */
810 KiReleasePrcbLock(Prcb);
812 }
813 }
814
815 /* Lower IRQL and return */
817 return Status;
818}
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define KeLowerIrql(oldIrql)
Definition: env_spec_w32.h:602
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
KIRQL NTAPI KeRaiseIrqlToSynchLevel(VOID)
Definition: pic.c:156
FORCEINLINE PKTHREAD KiSelectReadyThread(IN KPRIORITY Priority, IN PKPRCB Prcb)
Definition: ke_x.h:1422
FORCEINLINE VOID KiSetThreadSwapBusy(IN PKTHREAD Thread)
Definition: ke_x.h:210
FORCEINLINE VOID KiReleasePrcbLock(IN PKPRCB Prcb)
Definition: ke_x.h:230
FORCEINLINE VOID KiAcquireThreadLock(IN PKTHREAD Thread)
Definition: ke_x.h:240
FORCEINLINE VOID KiReleaseThreadLock(IN PKTHREAD Thread)
Definition: ke_x.h:250
FORCEINLINE SCHAR KiComputeNewPriority(IN PKTHREAD Thread, IN SCHAR Adjustment)
Definition: ke_x.h:1472
#define STATUS_NO_YIELD_PERFORMED
Definition: ntstatus.h:150
ULONG ReadySummary
Definition: ketypes.h:799
#define KiGetCurrentReadySummary()
Definition: thrdschd.c:736
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:778
@ WrYieldExecution
Definition: ketypes.h:448

◆ ZwCallbackReturn()

◆ ZwContinue()

NTSYSAPI NTSTATUS NTAPI ZwContinue ( _In_ PCONTEXT  Context,
_In_ BOOLEAN  TestAlert 
)

Referenced by RtlRaiseException(), and RtlUnwind().

◆ ZwCreateProfile()

NTSYSAPI NTSTATUS NTAPI ZwCreateProfile ( _Out_ PHANDLE  ProfileHandle,
_In_ HANDLE  ProcessHandle,
_In_ PVOID  ImageBase,
_In_ ULONG  ImageSize,
_In_ ULONG  Granularity,
_Out_ PVOID  Buffer,
_In_ ULONG  ProfilingSize,
_In_ KPROFILE_SOURCE  Source,
_In_ KAFFINITY  ProcessorMask 
)

◆ ZwDelayExecution()

NTSYSAPI NTSTATUS NTAPI ZwDelayExecution ( _In_ BOOLEAN  Alertable,
_In_ LARGE_INTEGER Interval 
)

Referenced by LdrpInit().

◆ ZwFlushInstructionCache()

NTSYSAPI NTSTATUS NTAPI ZwFlushInstructionCache ( _In_ HANDLE  ProcessHandle,
_In_ PVOID  BaseAddress,
_In_ ULONG  NumberOfBytesToFlush 
)

◆ ZwGetContextThread()

NTSYSAPI NTSTATUS NTAPI ZwGetContextThread ( _In_ HANDLE  ThreadHandle,
_Out_ PCONTEXT  Context 
)

◆ ZwGetTickCount()

NTSYSAPI ULONG NTAPI ZwGetTickCount ( VOID  )

◆ ZwQueryIntervalProfile()

NTSYSAPI NTSTATUS NTAPI ZwQueryIntervalProfile ( _In_ KPROFILE_SOURCE  ProfileSource,
_Out_ PULONG  Interval 
)

◆ ZwQueryPerformanceCounter()

NTSYSAPI NTSTATUS NTAPI ZwQueryPerformanceCounter ( _Out_ PLARGE_INTEGER  Counter,
_Out_opt_ PLARGE_INTEGER  Frequency 
)

Referenced by RtlpPageHeapCreate().

◆ ZwQuerySystemTime()

NTSYSAPI NTSTATUS NTAPI ZwQuerySystemTime ( _Out_ PLARGE_INTEGER  CurrentTime)

◆ ZwQueryTimerResolution()

NTSYSAPI NTSTATUS NTAPI ZwQueryTimerResolution ( _Out_ PULONG  MinimumResolution,
_Out_ PULONG  MaximumResolution,
_Out_ PULONG  ActualResolution 
)

◆ ZwQueueApcThread()

NTSYSAPI NTSTATUS NTAPI ZwQueueApcThread ( _In_ HANDLE  ThreadHandle,
_In_ PKNORMAL_ROUTINE  ApcRoutine,
_In_opt_ PVOID  NormalContext,
_In_opt_ PVOID  SystemArgument1,
_In_opt_ PVOID  SystemArgument2 
)

◆ ZwRaiseException()

NTSYSAPI NTSTATUS NTAPI ZwRaiseException ( _In_ PEXCEPTION_RECORD  ExceptionRecord,
_In_ PCONTEXT  Context,
_In_ BOOLEAN  SearchFrames 
)

◆ ZwSetContextThread()

NTSYSAPI NTSTATUS NTAPI ZwSetContextThread ( _In_ HANDLE  ThreadHandle,
_In_ PCONTEXT  Context 
)

◆ ZwSetIntervalProfile()

NTSYSAPI NTSTATUS NTAPI ZwSetIntervalProfile ( _In_ ULONG  Interval,
_In_ KPROFILE_SOURCE  ClockSource 
)

◆ ZwSetLdtEntries()

NTSYSAPI NTSTATUS NTAPI ZwSetLdtEntries ( _In_ ULONG  Selector1,
_In_ LDT_ENTRY  LdtEntry1,
_In_ ULONG  Selector2,
_In_ LDT_ENTRY  LdtEntry2 
)

◆ ZwSetSystemTime()

NTSYSAPI NTSTATUS NTAPI ZwSetSystemTime ( _In_ PLARGE_INTEGER  SystemTime,
_In_opt_ PLARGE_INTEGER  NewSystemTime 
)

◆ ZwSetTimerResolution()

NTSYSAPI NTSTATUS NTAPI ZwSetTimerResolution ( _In_ ULONG  RequestedResolution,
_In_ BOOLEAN  SetOrUnset,
_Out_ PULONG  ActualResolution 
)

Referenced by PspExitProcess().

◆ ZwStartProfile()

NTSYSAPI NTSTATUS NTAPI ZwStartProfile ( _In_ HANDLE  ProfileHandle)

◆ ZwStopProfile()

NTSYSAPI NTSTATUS NTAPI ZwStopProfile ( _In_ HANDLE  ProfileHandle)

◆ ZwTestAlert()

NTSYSAPI NTSTATUS NTAPI ZwTestAlert ( VOID  )

◆ ZwVdmControl()

NTSYSAPI NTSTATUS NTAPI ZwVdmControl ( _In_ ULONG  ControlCode,
_In_ PVOID  ControlData 
)

◆ ZwW32Call()

NTSYSAPI NTSTATUS NTAPI ZwW32Call ( _In_ ULONG  RoutineIndex,
_In_ PVOID  Argument,
_In_ ULONG  ArgumentLength,
_Out_opt_ PVOID Result,
_Out_opt_ PULONG  ResultLength 
)

◆ ZwYieldExecution()