#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 614 of file v86vdm.c.
616{
625 USHORT OldOffset, OldBase;
626
627
629
630
631 *Trampoline++ = 0xCD;
634
635
639
640
642
643
651
652
654
655
660
661
663 VdmProcessObjects->
VdmTib = VdmTib;
665
666
668
669
674
675
676 OldOffset =
Process->IopmOffset;
680
681
683
684
686 Process->IopmOffset = OldOffset;
688
689
691
692
695
696
699
700
702}
#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 709 of file v86vdm.c.
711{
715
718
720
721 Process->IopmOffset = MapOffset;
722
723 TargetProcessors =
Process->ActiveProcessors;
726 KeGetPcr()->TSS->IoMapBase = MapOffset;
727
729}
#define KiComputeIopmOffset(MapNumber)
FORCEINLINE struct _KPRCB * KeGetCurrentPrcb(VOID)
◆ Ke386QueryIoAccessMap()
Definition at line 762 of file v86vdm.c.
764{
768
771
773 {
774
778 }
779 }
780 else
781 {
782
785 }
786
788}
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 736 of file v86vdm.c.
738{
742
745
747
748
749 pt = &(
KeGetPcr()->TSS->IoMaps[MapNumber-1].IoMap);
753
755}
struct _KTHREAD * CurrentThread
◆ Ke386SetIOPL()
Definition at line 581 of file v86vdm.c.
582{
583
588
589
592
593
595
596
599
600
602
603
605}
#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 456 of file v86vdm.c.
457{
458
459 TrapFrame->Eip &= 0xFFFF;
460 TrapFrame->HardwareEsp &= 0xFFFF;
461
462
464}
BOOLEAN FASTCALL KiVdmHandleOpcode(IN PKTRAP_FRAME TrapFrame, IN ULONG Flags)
Referenced by KiTrap0DHandler().
◆ KiEnterV86Mode()
Definition at line 507 of file v86vdm.c.
508{
514
516
517
521
522
525
526
529
530
532
533
534 TrapFrame->
Esi = StackFrameUnaligned;
536
537
540
541
546
547
549
550
552
553
555
556
558
559
561
562
563 Thread->InitialStack = V86Frame;
564
565
568
569
571
572
574
575
577}
#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 468 of file v86vdm.c.
469{
476
477
478 StackFrameUnaligned = TrapFrame->Esi;
481 NpxFrame = &StackFrame->
NpxArea;
483
484
487
488
490
491
495
496
499
500
502 return StackFrameUnaligned;
503}
struct _FX_SAVE_AREA FX_SAVE_AREA
◆ KiVdmHandleOpcode()
Definition at line 379 of file v86vdm.c.
381{
383
384
385 Eip = (TrapFrame->SegCs << 4) + TrapFrame->Eip;
387
388
390 {
432 default:
435 }
436}
#define KiCallVdmPrefixHandler(x)
#define KiCallVdmHandler(x)
#define KiVdmGetInstructionSize(x)
_Must_inspect_result_ _In_ ULONG Flags
Referenced by Ki386HandleOpcodeV86(), and KiVdmOpcodePrefix().
◆ KiVdmOpcodeCLI()
Definition at line 341 of file v86vdm.c.
343{
344
346
347
349
350
352
353
355}
#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 |= (TrapEFlags & ~EFLAGS_INTERRUPT_MASK);
198
199
201
202
204
205
206 Esp = (TrapFrame->HardwareSegSs << 4) + TrapFrame->HardwareEsp;
207
208
209 Esp -= 2;
211
212
213 Esp -= 2;
215
216
217 Esp -= 2;
219
220
221 TrapFrame->HardwareEsp = (
USHORT)Esp;
222
223
224 Eip = (TrapFrame->SegCs << 4) + TrapFrame->Eip;
225
226
228
229
231
232
235
236
238
239
241 {
242
245 {
246
248 }
249 else
250 {
251
253 }
254 }
255 else
256 {
257
259 }
260
261
263}
#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 267 of file v86vdm.c.
269{
270 ULONG Esp, V86EFlags, EFlags, TrapEFlags, Eip;
271
272
273 Esp = (TrapFrame->HardwareSegSs << 4) + TrapFrame->HardwareEsp;
274
275
277 {
278
279 TrapFrame->Eip = *(
PULONG)Esp;
280 TrapFrame->SegCs = *(
PUSHORT)(Esp + 4);
281
282
283 TrapFrame->HardwareEsp += 12;
284
285
286 EFlags = *(
PULONG)(Esp + 8);
287 }
288 else
289 {
290
291 TrapFrame->Eip = *(
PUSHORT)Esp;
292 TrapFrame->SegCs = *(
PUSHORT)(Esp + 2);
293
294
295 TrapFrame->HardwareEsp += 6;
296
297
299 }
300
301
303 V86EFlags = EFlags;
304
305
307
308
310
311
312 TrapEFlags = TrapFrame->EFlags;
313 TrapFrame->EFlags = (TrapFrame->EFlags &
EFLAGS_VIP) | EFlags;
314
315
317
318
321
322
323 Eip = (TrapFrame->SegCs << 4) + TrapFrame->Eip;
325 {
326
328 }
329 else
330 {
331
332 DPRINT(
"FIXME: Check for VDM interrupts\n");
333 }
334
335
337}
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 359 of file v86vdm.c.
361{
362
364
365
367
368
370
371
373}
◆ 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