169 CalloutFrame->CallbackStack = (
ULONG_PTR)CurrentThread->CallbackStack;
177 CurrentThread->CallbackStack = CalloutFrame;
186 CallbackTrapFrame = *TrapFrame;
192 Pcr->
TssBase->Rsp0 = InitialStack;
212 CalloutFrame->Reserved = 0;
213 CalloutFrame->ApiNumber = ApiNumber;
214 CalloutFrame->Buffer = (
ULONG_PTR)NewStack;
215 CalloutFrame->Length = ArgumentLength;
216#elif defined(_M_AMD64)
217 UserCalloutFrame->Buffer = (
PVOID)(UserCalloutFrame + 1);
219 UserCalloutFrame->ApiNumber = ApiNumber;
220 UserCalloutFrame->MachineFrame.Rip = TrapFrame->Rip;
221 UserCalloutFrame->MachineFrame.Rsp = TrapFrame->Rsp;
223#error "KiSetupUserCalloutFrame not implemented!"
245 ULONG GdiBatchCount = 0;
251 OldStack = *UserStackPointer;
287 *UserStackPointer = (
ULONG_PTR)CalloutFrame;
299 OldStack = *UserStackPointer;
315 *UserStackPointer -= 256;
320 *UserStackPointer = OldStack;
341 CalloutFrame = CurrentThread->CallbackStack;
342 if (CalloutFrame ==
NULL)
352 CallbackTrapFrame = CurrentThread->
TrapFrame;
366 *TrapFrame = *CallbackTrapFrame;
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;
385 Pcr->
TssBase->Rsp0 = CalloutFrame->InitialStack;
393 CurrentThread->CallbackStack = (
PVOID)CalloutFrame->CallbackStack;
#define EFLAGS_INTERRUPT_MASK
NTSTATUS FASTCALL KiUserModeCallout(_Out_ PKCALLOUT_FRAME CalloutFrame)
NTSTATUS NTAPI KeUserModeCallback(IN ULONG RoutineIndex, IN PVOID Argument, IN ULONG ArgumentLength, OUT PVOID *Result, OUT PULONG ResultLength)
VOID NTAPI KiInitializeUserApc(_In_ PKEXCEPTION_FRAME ExceptionFrame, _Inout_ PKTRAP_FRAME TrapFrame, _In_ PKNORMAL_ROUTINE NormalRoutine, _In_ PVOID NormalContext, _In_ PVOID SystemArgument1, _In_ PVOID SystemArgument2)
VOID KiSetupUserCalloutFrame(_Out_ PUCALLOUT_FRAME UserCalloutFrame, _In_ PKTRAP_FRAME TrapFrame, _In_ ULONG ApiNumber, _In_ PVOID Buffer, _In_ ULONG BufferLength)
NTSTATUS NTAPI NtCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS CallbackStatus)
#define NT_SUCCESS(StatCode)
#define KeGetCurrentIrql()
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
_In_ FLT_PREOP_CALLBACK_STATUS CallbackStatus
#define KeGetCurrentThread
#define EXCEPTION_EXECUTE_HANDLER
void __cdecl _disable(void)
void __cdecl _enable(void)
#define EFLAGS_USER_SANITIZE
struct _UCALLOUT_FRAME * PUCALLOUT_FRAME
struct _KTRAP_FRAME * PKTRAP_FRAME
#define KeGetPreviousMode()
VOID(NTAPI * PKNORMAL_ROUTINE)(IN PVOID NormalContext OPTIONAL, IN PVOID SystemArgument1 OPTIONAL, IN PVOID SystemArgument2 OPTIONAL)
#define CONTEXT_DEBUG_REGISTERS
DECLSPEC_NORETURN VOID KiUserCallbackExit(_In_ PKTRAP_FRAME TrapFrame)
FORCEINLINE PULONG_PTR KiGetUserModeStackAddress(void)
DECLSPEC_NORETURN VOID FASTCALL KiCallbackReturn(IN PVOID Stack, IN NTSTATUS Status)
VOID NTAPI KeTrapFrameToContext(IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame, IN OUT PCONTEXT Context)
PVOID KeUserCallbackDispatcher
PGDI_BATCHFLUSH_ROUTINE KeGdiFlushUserBatch
NTSTATUS NTAPI KiCallUserMode(IN PVOID *OutputBuffer, IN PULONG OutputLength)
VOID NTAPI KiDispatchException(PEXCEPTION_RECORD ExceptionRecord, PKEXCEPTION_FRAME ExceptionFrame, PKTRAP_FRAME Tf, KPROCESSOR_MODE PreviousMode, BOOLEAN SearchFrames)
PVOID KeUserApcDispatcher
NTSTATUS NTAPI MmGrowKernelStack(IN PVOID StackPointer)
_Out_ PKAPC_STATE ApcState
#define STATUS_CALLBACK_POP_STACK
#define STATUS_NO_CALLBACK_ACTIVE
#define _SEH2_GetExceptionCode()
#define _SEH2_EXCEPT(...)
#define _SEH2_GetExceptionInformation()
#define _SEH2_YIELD(__stmt)
#define KERNEL_STACK_SIZE
volatile VOID * StackLimit
struct _EXCEPTION_REGISTRATION_RECORD * ExceptionList
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define ALIGN_DOWN_POINTER_BY(ptr, align)
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
_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
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2