16#define KiVdmGetInstructionSize(x) ((x) & 0xFF)
17#define KiVdmGetPrefixFlags(x) ((x) & 0xFFFFFF00)
54 ULONG Esp, V86EFlags, TrapEFlags;
58 V86EFlags &= ~EFLAGS_INTERRUPT_MASK;
61 TrapEFlags = TrapFrame->EFlags;
66 TrapEFlags &= ~EFLAGS_INTERRUPT_MASK;
74 V86EFlags |= TrapEFlags;
78 Esp = (TrapFrame->HardwareSegSs << 4) + (
USHORT)TrapFrame->HardwareEsp;
95 TrapFrame->HardwareEsp = Esp - (TrapFrame->HardwareSegSs << 4);
107 ULONG Esp, V86EFlags, EFlags, TrapEFlags;
110 Esp = (TrapFrame->HardwareSegSs << 4) + (
USHORT)TrapFrame->HardwareEsp;
127 TrapFrame->HardwareEsp = Esp - (TrapFrame->HardwareSegSs << 4);
130 EFlags &= ~EFLAGS_IOPL;
133 V86EFlags = EFlags & ~EFLAGS_NESTED_TASK;
139 TrapEFlags = TrapFrame->EFlags;
145 V86EFlags &= ~EFLAGS_VIF;
150 V86EFlags &= ~EFLAGS_INTERRUPT_MASK;
158 TrapFrame->EFlags |= V86EFlags;
184 TrapEFlags = TrapFrame->EFlags;
197 V86EFlags |= (TrapEFlags & ~EFLAGS_INTERRUPT_MASK);
206 Esp = (TrapFrame->HardwareSegSs << 4) + TrapFrame->HardwareEsp;
221 TrapFrame->HardwareEsp = (
USHORT)Esp;
224 Eip = (TrapFrame->SegCs << 4) + TrapFrame->Eip;
270 ULONG Esp, V86EFlags, EFlags, TrapEFlags, Eip;
273 Esp = (TrapFrame->HardwareSegSs << 4) + TrapFrame->HardwareEsp;
279 TrapFrame->Eip = *(
PULONG)Esp;
280 TrapFrame->SegCs = *(
PUSHORT)(Esp + 4);
283 TrapFrame->HardwareEsp += 12;
286 EFlags = *(
PULONG)(Esp + 8);
291 TrapFrame->Eip = *(
PUSHORT)Esp;
292 TrapFrame->SegCs = *(
PUSHORT)(Esp + 2);
295 TrapFrame->HardwareEsp += 6;
312 TrapEFlags = TrapFrame->EFlags;
313 TrapFrame->EFlags = (TrapFrame->EFlags &
EFLAGS_VIP) | EFlags;
323 Eip = (TrapFrame->SegCs << 4) + TrapFrame->Eip;
332 DPRINT(
"FIXME: Check for VDM interrupts\n");
385 Eip = (TrapFrame->SegCs << 4) + TrapFrame->Eip;
459 TrapFrame->Eip &= 0xFFFF;
460 TrapFrame->HardwareEsp &= 0xFFFF;
478 StackFrameUnaligned = TrapFrame->Esi;
481 NpxFrame = &StackFrame->
NpxArea;
502 return StackFrameUnaligned;
534 TrapFrame->
Esi = StackFrameUnaligned;
563 Thread->InitialStack = V86Frame;
625 USHORT OldOffset, OldBase;
631 *Trampoline++ = 0xCD;
663 VdmProcessObjects->
VdmTib = VdmTib;
676 OldOffset =
Process->IopmOffset;
686 Process->IopmOffset = OldOffset;
721 Process->IopmOffset = MapOffset;
723 TargetProcessors =
Process->ActiveProcessors;
726 KeGetPcr()->TSS->IoMapBase = MapOffset;
749 pt = &(
KeGetPcr()->TSS->IoMaps[MapNumber-1].IoMap);
#define EFLAGS_INTERRUPT_MASK
#define ExAllocatePoolWithTag(hernya, size, tag)
#define ROUND_UP(n, align)
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T ContextSize
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define KeGetCurrentThread
void __cdecl _disable(void)
void __cdecl _enable(void)
#define _AddressOfReturnAddress()
__INTRIN_INLINE uintptr_t __readeflags(void)
#define ExFreePoolWithTag(_P, _T)
#define KiComputeIopmOffset(MapNumber)
#define IO_ACCESS_MAP_NONE
#define EFLAGS_NESTED_TASK
#define EFLAGS_USER_SANITIZE
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
#define EFLAGS_ALIGN_CHECK
#define FIXED_NTVDMSTATE_LINEAR_PC_AT
struct _FX_SAVE_AREA FX_SAVE_AREA
KIO_ACCESS_MAP * PKIO_ACCESS_MAP
#define EXCEPTION_CHAIN_END
#define KeGetTrapFrame(Thread)
#define KiCallVdmPrefixHandler(x)
BOOLEAN NTAPI VdmDispatchBop(IN PKTRAP_FRAME TrapFrame)
#define KiVdmClearVdmEFlags(x)
#define KiVdmSetVdmEFlags(x)
DECLSPEC_NORETURN VOID FASTCALL KiEoiHelper(IN PKTRAP_FRAME TrapFrame)
#define KiCallVdmHandler(x)
#define KiVdmUnhandledOpcode(x)
FORCEINLINE VOID KiSetTebBase(PKPCR Pcr, PNT_TIB TebAddress)
VOID NTAPI Ki386SetupAndExitToV86Mode(OUT PTEB VdmTeb)
VOID NTAPI Ki386AdjustEsp0(IN PKTRAP_FRAME TrapFrame)
FORCEINLINE PFX_SAVE_AREA KiGetThreadNpxArea(IN PKTHREAD Thread)
struct _KV8086_STACK_FRAME * PKV8086_STACK_FRAME
VOID FASTCALL Ki386BiosCallReturnAddress(IN PKTRAP_FRAME TrapFrame)
VOID NTAPI KeTrapFrameToContext(IN PKTRAP_FRAME TrapFrame, IN PKEXCEPTION_FRAME ExceptionFrame, IN OUT PCONTEXT Context)
VOID NTAPI KeContextToTrapFrame(PCONTEXT Context, PKEXCEPTION_FRAME ExeptionFrame, PKTRAP_FRAME TrapFrame, ULONG ContextFlags, KPROCESSOR_MODE PreviousMode)
struct _Vdm_Tib * PVDM_TIB
NTSTATUS NTAPI NtVdmControl(IN ULONG ControlCode, IN PVOID ControlData)
struct _KTHREAD * CurrentThread
struct _EXCEPTION_REGISTRATION_RECORD FAR * ExceptionList
KIIO_ACCESS_MAP IoMaps[IOPM_COUNT]
VOID NTAPI KeSetSystemAffinityThread(IN KAFFINITY Affinity)
VOID NTAPI KeRevertToUserAffinityThread(VOID)
#define KiFillTrapFrameDebug(x)
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define RtlMoveMemory(Destination, Source, Length)
BOOLEAN NTAPI Ke386SetIoAccessMap(IN ULONG MapNumber, IN PKIO_ACCESS_MAP IopmBuffer)
BOOLEAN FASTCALL KiVdmHandleOpcode(IN PKTRAP_FRAME TrapFrame, IN ULONG Flags)
BOOLEAN FASTCALL KiVdmOpcodePUSHF(IN PKTRAP_FRAME TrapFrame, IN ULONG Flags)
BOOLEAN FASTCALL KiVdmOpcodePrefix(IN PKTRAP_FRAME TrapFrame, IN ULONG Flags)
BOOLEAN FASTCALL Ki386HandleOpcodeV86(IN PKTRAP_FRAME TrapFrame)
BOOLEAN FASTCALL KiVdmOpcodePOPF(IN PKTRAP_FRAME TrapFrame, IN ULONG Flags)
BOOLEAN KeI386VirtualIntExtensions
ULONG KeI386EFlagsAndMaskV86
VOID NTAPI Ke386SetIOPL(VOID)
BOOLEAN NTAPI Ke386IoSetAccessProcess(IN PKPROCESS Process, IN ULONG MapNumber)
BOOLEAN FASTCALL KiVdmOpcodeINTnn(IN PKTRAP_FRAME TrapFrame, IN ULONG Flags)
BOOLEAN NTAPI Ke386QueryIoAccessMap(IN ULONG MapNumber, IN PKIO_ACCESS_MAP IopmBuffer)
ULONG KeI386EFlagsOrMaskV86
VOID FASTCALL KiEnterV86Mode(IN ULONG_PTR StackFrameUnaligned)
#define KiVdmGetPrefixFlags(x)
BOOLEAN FASTCALL KiVdmOpcodeIRET(IN PKTRAP_FRAME TrapFrame, IN ULONG Flags)
#define KiVdmGetInstructionSize(x)
NTSTATUS NTAPI Ke386CallBios(IN ULONG Int, OUT PCONTEXT Context)
ULONG_PTR FASTCALL KiExitV86Mode(IN PKTRAP_FRAME TrapFrame)
BOOLEAN FASTCALL KiVdmOpcodeCLI(IN PKTRAP_FRAME TrapFrame, IN ULONG Flags)
const PULONG KiNtVdmState
BOOLEAN FASTCALL KiVdmOpcodeSTI(IN PKTRAP_FRAME TrapFrame, IN ULONG Flags)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFINTERRUPT * Interrupt
_Must_inspect_result_ _In_ ULONG Flags
#define PsGetCurrentProcess