#include <ntoskrnl.h>
#include <debug.h>
Go to the source code of this file.
|
| KiVdmUnhandledOpcode (F) |
|
| KiVdmUnhandledOpcode (OUTSW) |
|
| KiVdmUnhandledOpcode (OUTSB) |
|
| KiVdmUnhandledOpcode (INSB) |
|
| KiVdmUnhandledOpcode (INSW) |
|
| KiVdmUnhandledOpcode (NPX) |
|
| KiVdmUnhandledOpcode (INBimm) |
|
| KiVdmUnhandledOpcode (INWimm) |
|
| KiVdmUnhandledOpcode (OUTBimm) |
|
| KiVdmUnhandledOpcode (OUTWimm) |
|
| KiVdmUnhandledOpcode (INB) |
|
| KiVdmUnhandledOpcode (INW) |
|
| KiVdmUnhandledOpcode (OUTB) |
|
| KiVdmUnhandledOpcode (OUTW) |
|
| KiVdmUnhandledOpcode (HLT) |
|
| KiVdmUnhandledOpcode (INTO) |
|
| KiVdmUnhandledOpcode (INV) |
|
BOOLEAN FASTCALL | KiVdmOpcodePUSHF (IN PKTRAP_FRAME TrapFrame, IN ULONG Flags) |
|
BOOLEAN FASTCALL | KiVdmOpcodePOPF (IN PKTRAP_FRAME TrapFrame, IN ULONG Flags) |
|
BOOLEAN FASTCALL | KiVdmOpcodeINTnn (IN PKTRAP_FRAME TrapFrame, IN ULONG Flags) |
|
BOOLEAN FASTCALL | KiVdmOpcodeIRET (IN PKTRAP_FRAME TrapFrame, IN ULONG Flags) |
|
BOOLEAN FASTCALL | KiVdmOpcodeCLI (IN PKTRAP_FRAME TrapFrame, IN ULONG Flags) |
|
BOOLEAN FASTCALL | KiVdmOpcodeSTI (IN PKTRAP_FRAME TrapFrame, IN ULONG Flags) |
|
BOOLEAN FASTCALL | KiVdmHandleOpcode (IN PKTRAP_FRAME TrapFrame, IN ULONG Flags) |
|
BOOLEAN FASTCALL | KiVdmOpcodePrefix (IN PKTRAP_FRAME TrapFrame, IN ULONG Flags) |
|
BOOLEAN FASTCALL | Ki386HandleOpcodeV86 (IN PKTRAP_FRAME TrapFrame) |
|
ULONG_PTR FASTCALL | KiExitV86Mode (IN PKTRAP_FRAME TrapFrame) |
|
VOID FASTCALL | KiEnterV86Mode (IN ULONG_PTR StackFrameUnaligned) |
|
VOID NTAPI | Ke386SetIOPL (VOID) |
|
NTSTATUS NTAPI | Ke386CallBios (IN ULONG Int, OUT PCONTEXT Context) |
|
BOOLEAN NTAPI | Ke386IoSetAccessProcess (IN PKPROCESS Process, IN ULONG MapNumber) |
|
BOOLEAN NTAPI | Ke386SetIoAccessMap (IN ULONG MapNumber, IN PKIO_ACCESS_MAP IopmBuffer) |
|
BOOLEAN NTAPI | Ke386QueryIoAccessMap (IN ULONG MapNumber, IN PKIO_ACCESS_MAP IopmBuffer) |
|
◆ KiVdmGetInstructionSize
#define KiVdmGetInstructionSize |
( |
|
x | ) |
((x) & 0xFF) |
◆ KiVdmGetPrefixFlags
#define KiVdmGetPrefixFlags |
( |
|
x | ) |
((x) & 0xFFFFFF00) |
◆ NDEBUG
◆ Ke386CallBios()
Definition at line 628 of file v86vdm.c.
630{
639 USHORT OldOffset, OldBase;
640
641
643
644
645 *Trampoline++ = 0xCD;
648
649
653
654
656
657
665
666
668
669
674
675
677 VdmProcessObjects->
VdmTib = VdmTib;
679
680
682
683
688
689
690 OldOffset =
Process->IopmOffset;
694
695
697
698
700 Process->IopmOffset = OldOffset;
702
703
705
706
709
710
713
714
716}
#define EFLAGS_INTERRUPT_MASK
#define ExAllocatePoolWithTag(hernya, size, tag)
_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
#define KeGetCurrentThread
#define ExFreePoolWithTag(_P, _T)
VOID NTAPI Ki386SetupAndExitToV86Mode(OUT PTEB VdmTeb)
struct _Vdm_Tib * PVDM_TIB
KIIO_ACCESS_MAP IoMaps[IOPM_COUNT]
VOID NTAPI KeSetSystemAffinityThread(IN KAFFINITY Affinity)
VOID NTAPI KeRevertToUserAffinityThread(VOID)
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define PsGetCurrentProcess
Referenced by IntInt10CallBios().
◆ Ke386IoSetAccessProcess()
Definition at line 723 of file v86vdm.c.
725{
729
732
734
735 Process->IopmOffset = MapOffset;
736
737 TargetProcessors =
Process->ActiveProcessors;
740 KeGetPcr()->TSS->IoMapBase = MapOffset;
741
743}
#define KiComputeIopmOffset(MapNumber)
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
◆ Ke386QueryIoAccessMap()
Definition at line 776 of file v86vdm.c.
778{
782
785
787 {
788
792 }
793 }
794 else
795 {
796
799 }
800
802}
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 IO_ACCESS_MAP_NONE
#define RtlMoveMemory(Destination, Source, Length)
◆ Ke386SetIoAccessMap()
Definition at line 750 of file v86vdm.c.
752{
756
759
761
762
763 pt = &(
KeGetPcr()->TSS->IoMaps[MapNumber-1].IoMap);
767
769}
struct _KTHREAD * CurrentThread
◆ Ke386SetIOPL()
Definition at line 595 of file v86vdm.c.
596{
597
602
603
606
607
609
610
613
614
616
617
619}
#define KeGetTrapFrame(Thread)
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)
Referenced by NtSetInformationProcess().
◆ Ki386HandleOpcodeV86()
Definition at line 470 of file v86vdm.c.
471{
472
473 TrapFrame->Eip &= 0xFFFF;
474 TrapFrame->HardwareEsp &= 0xFFFF;
475
476
478}
BOOLEAN FASTCALL KiVdmHandleOpcode(IN PKTRAP_FRAME TrapFrame, IN ULONG Flags)
Referenced by KiTrap0DHandler().
◆ KiEnterV86Mode()
Definition at line 521 of file v86vdm.c.
522{
528
530
531
535
536
539
540
543
544
546
547
548 TrapFrame->
Esi = StackFrameUnaligned;
550
551
554
555
560
561
563
564
566
567
569
570
572
573
575
576
577 Thread->InitialStack = V86Frame;
578
579
582
583
585
586
588
589
591}
#define ROUND_UP(n, align)
void __cdecl _disable(void)
void __cdecl _enable(void)
#define _AddressOfReturnAddress()
__INTRIN_INLINE uintptr_t __readeflags(void)
#define EXCEPTION_CHAIN_END
DECLSPEC_NORETURN VOID FASTCALL KiEoiHelper(IN PKTRAP_FRAME TrapFrame)
FORCEINLINE VOID KiSetTebBase(PKPCR Pcr, PNT_TIB TebAddress)
FORCEINLINE PFX_SAVE_AREA KiGetThreadNpxArea(IN PKTHREAD Thread)
struct _KV8086_STACK_FRAME * PKV8086_STACK_FRAME
VOID FASTCALL Ki386BiosCallReturnAddress(IN PKTRAP_FRAME TrapFrame)
NTSTATUS NTAPI NtVdmControl(IN ULONG ControlCode, IN PVOID ControlData)
struct _EXCEPTION_REGISTRATION_RECORD FAR * ExceptionList
#define KiFillTrapFrameDebug(x)
◆ KiExitV86Mode()
Definition at line 482 of file v86vdm.c.
483{
490
491
492 StackFrameUnaligned = TrapFrame->Esi;
495 NpxFrame = &StackFrame->
NpxArea;
497
498
501
502
504
505
509
510
513
514
516 return StackFrameUnaligned;
517}
struct _FX_SAVE_AREA FX_SAVE_AREA
◆ KiVdmHandleOpcode()
Definition at line 393 of file v86vdm.c.
395{
397
398
399 Eip = (TrapFrame->SegCs << 4) + TrapFrame->Eip;
401
402
404 {
446 default:
449 }
450}
#define KiCallVdmPrefixHandler(x)
#define KiCallVdmHandler(x)
#define KiVdmGetInstructionSize(x)
_Must_inspect_result_ _In_ ULONG Flags
Referenced by Ki386HandleOpcodeV86(), and KiVdmOpcodePrefix().
◆ KiVdmOpcodeCLI()
Definition at line 355 of file v86vdm.c.
357{
358
360
361
363
364
366
367
369}
#define KiVdmClearVdmEFlags(x)
BOOLEAN KeI386VirtualIntExtensions
◆ KiVdmOpcodeINTnn()
Definition at line 178 of file v86vdm.c.
180{
182
183
184 TrapEFlags = TrapFrame->EFlags;
185
186
189
190
192
193
195 {
196
197 V86EFlags &= ~EFLAGS_INTERRUPT_MASK;
199 {
201 }
202 }
203
204
205 V86EFlags |= (TrapEFlags & ~EFLAGS_INTERRUPT_MASK);
206
207
209
210
212
213
214 Esp = (TrapFrame->HardwareSegSs << 4) + TrapFrame->HardwareEsp;
215
216
217 Esp -= 2;
219
220
221 Esp -= 2;
223
224
225 Esp -= 2;
227
228
229 TrapFrame->HardwareEsp = (
USHORT)Esp;
230
231
232 Eip = (TrapFrame->SegCs << 4) + TrapFrame->Eip;
233
234
236
237
239
240
243
244
246
247
249 {
250
253 {
254
256 }
257 else
258 {
259
261 }
262 }
263 else
264 {
265
267 }
268
269
271}
#define EFLAGS_NESTED_TASK
#define EFLAGS_ALIGN_CHECK
const PULONG KiNtVdmState
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFINTERRUPT * Interrupt
◆ KiVdmOpcodeIRET()
Definition at line 275 of file v86vdm.c.
277{
278 ULONG Esp, V86EFlags, EFlags, TrapEFlags, Eip;
279
280
281 Esp = (TrapFrame->HardwareSegSs << 4) + TrapFrame->HardwareEsp;
282
283
285 {
286
287 TrapFrame->Eip = *(
PULONG)Esp;
288 TrapFrame->SegCs = *(
PUSHORT)(Esp + 4);
289
290
291 TrapFrame->HardwareEsp += 12;
292
293
294 EFlags = *(
PULONG)(Esp + 8);
295 }
296 else
297 {
298
299 TrapFrame->Eip = *(
PUSHORT)Esp;
300 TrapFrame->SegCs = *(
PUSHORT)(Esp + 2);
301
302
303 TrapFrame->HardwareEsp += 6;
304
305
307 }
308
309
311 V86EFlags = EFlags;
312
313
315 {
317 {
319 }
320 }
321
322
324
325
326 TrapEFlags = TrapFrame->EFlags;
327 TrapFrame->EFlags = (TrapFrame->EFlags &
EFLAGS_VIP) | EFlags;
328
329
331
332
335
336
337 Eip = (TrapFrame->SegCs << 4) + TrapFrame->Eip;
339 {
340
342 }
343 else
344 {
345
346 DPRINT(
"FIXME: Check for VDM interrupts\n");
347 }
348
349
351}
BOOLEAN NTAPI VdmDispatchBop(IN PKTRAP_FRAME TrapFrame)
#define KiVdmSetVdmEFlags(x)
VOID NTAPI Ki386AdjustEsp0(IN PKTRAP_FRAME TrapFrame)
#define KiVdmGetPrefixFlags(x)
◆ KiVdmOpcodePOPF()
Definition at line 104 of file v86vdm.c.
106{
107 ULONG Esp, V86EFlags, EFlags, TrapEFlags;
108
109
110 Esp = (TrapFrame->HardwareSegSs << 4) + (
USHORT)TrapFrame->HardwareEsp;
111
112
114 {
115
117 Esp += 4;
118 }
119 else
120 {
121
123 Esp += 2;
124 }
125
126
127 TrapFrame->HardwareEsp = Esp - (TrapFrame->HardwareSegSs << 4);
128
129
130 EFlags &= ~EFLAGS_IOPL;
131
132
133 V86EFlags = EFlags & ~EFLAGS_NESTED_TASK;
134
135
137
138
139 TrapEFlags = TrapFrame->EFlags;
140
141
143 {
144
145 V86EFlags &= ~EFLAGS_VIF;
147 {
149
150 V86EFlags &= ~EFLAGS_INTERRUPT_MASK;
151 }
152 }
153
154
156
157
158 TrapFrame->EFlags |= V86EFlags;
159
160
162
163
166
167
168
169
171
172
174}
◆ KiVdmOpcodePrefix()
◆ KiVdmOpcodePUSHF()
Definition at line 51 of file v86vdm.c.
53{
54 ULONG Esp, V86EFlags, TrapEFlags;
55
56
58 V86EFlags &= ~EFLAGS_INTERRUPT_MASK;
59
60
61 TrapEFlags = TrapFrame->EFlags;
62
64 {
65
66 TrapEFlags &= ~EFLAGS_INTERRUPT_MASK;
69 }
70
72
73
74 V86EFlags |= TrapEFlags;
76
77
78 Esp = (TrapFrame->HardwareSegSs << 4) + (
USHORT)TrapFrame->HardwareEsp;
79
80
82 {
83
84 Esp -= 4;
86 }
87 else
88 {
89
90 Esp -= 2;
92 }
93
94
95 TrapFrame->HardwareEsp = Esp - (TrapFrame->HardwareSegSs << 4);
97
98
100}
◆ KiVdmOpcodeSTI()
Definition at line 373 of file v86vdm.c.
375{
376
378
379
381
382
384
385
387}
◆ KiVdmUnhandledOpcode() [1/17]
KiVdmUnhandledOpcode |
( |
F |
| ) |
|
◆ KiVdmUnhandledOpcode() [2/17]
KiVdmUnhandledOpcode |
( |
HLT |
| ) |
|
◆ KiVdmUnhandledOpcode() [3/17]
KiVdmUnhandledOpcode |
( |
INB |
| ) |
|
◆ KiVdmUnhandledOpcode() [4/17]
KiVdmUnhandledOpcode |
( |
INBimm |
| ) |
|
◆ KiVdmUnhandledOpcode() [5/17]
KiVdmUnhandledOpcode |
( |
INSB |
| ) |
|
◆ KiVdmUnhandledOpcode() [6/17]
KiVdmUnhandledOpcode |
( |
INSW |
| ) |
|
◆ KiVdmUnhandledOpcode() [7/17]
KiVdmUnhandledOpcode |
( |
INTO |
| ) |
|
◆ KiVdmUnhandledOpcode() [8/17]
KiVdmUnhandledOpcode |
( |
INV |
| ) |
|
◆ KiVdmUnhandledOpcode() [9/17]
KiVdmUnhandledOpcode |
( |
INW |
| ) |
|
◆ KiVdmUnhandledOpcode() [10/17]
KiVdmUnhandledOpcode |
( |
INWimm |
| ) |
|
◆ KiVdmUnhandledOpcode() [11/17]
KiVdmUnhandledOpcode |
( |
NPX |
| ) |
|
◆ KiVdmUnhandledOpcode() [12/17]
KiVdmUnhandledOpcode |
( |
OUTB |
| ) |
|
◆ KiVdmUnhandledOpcode() [13/17]
KiVdmUnhandledOpcode |
( |
OUTBimm |
| ) |
|
◆ KiVdmUnhandledOpcode() [14/17]
KiVdmUnhandledOpcode |
( |
OUTSB |
| ) |
|
◆ KiVdmUnhandledOpcode() [15/17]
KiVdmUnhandledOpcode |
( |
OUTSW |
| ) |
|
◆ KiVdmUnhandledOpcode() [16/17]
KiVdmUnhandledOpcode |
( |
OUTW |
| ) |
|
◆ KiVdmUnhandledOpcode() [17/17]
KiVdmUnhandledOpcode |
( |
OUTWimm |
| ) |
|
◆ KeI386EFlagsAndMaskV86
◆ KeI386EFlagsOrMaskV86
◆ KeI386VirtualIntExtensions
◆ Ki386IopmSaveArea
◆ KiNtVdmState