ReactOS 0.4.16-dev-321-g63bb46a
vdm.h
Go to the documentation of this file.
1/*
2* PROJECT: ReactOS Kernel
3* LICENSE: GPL - See COPYING in the top level directory
4* FILE: ntoskrnl/include/internal/vdm.h
5* PURPOSE: Internal header for V86 and VDM Support
6* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7*/
8
9//
10// Define this if you want debugging support
11//
12#define _VM_DEBUG_ 0x00
13
14//
15// These define the Debug Masks Supported
16//
17#define VM_EXEC_DEBUG 0x01
18
19//
20// Debug/Tracing support
21//
22#if _VM_DEBUG_
23#ifdef NEW_DEBUG_SYSTEM_IMPLEMENTED // enable when Debug Filters are implemented
24#define VMTRACE DbgPrintEx
25#else
26#define VMTRACE(x, ...) \
27 if (x & VdmpTraceLevel) DbgPrint(__VA_ARGS__)
28#endif
29#else
30#define VMTRACE(x, fmt, ...) DPRINT(fmt, ##__VA_ARGS__)
31#endif
32
33//
34// Memory addresses inside CSRSS for V86 Support
35//
36#define TRAMPOLINE_BASE 0x10000
37#define TRAMPOLINE_TIB 0x12000
38#define TRAMPOLINE_TEB 0x13000
39
40//
41// BOP (Magic Opcode) to exit V86 Mode
42//
43#define TRAMPOLINE_BOP 0xFEC4C4
44
45//
46// VDM State Pointer
47//
48#define VdmState \
49 (PULONG)FIXED_NTVDMSTATE_LINEAR_PC_AT
50
51//
52// VDM Event Types
53//
54typedef enum _VdmEventClass
55{
64
65//
66// VDM Interrupt and Fault Handler Definitions
67//
69{
74
75typedef struct _Vdm_FaultHandler
76{
83
84//
85// VDM Event Information
86//
87typedef struct _VdmEventInfo
88{
92 union
93 {
94 //VDMIOINFO IoInfo;
95 //VDMSTRINGIOINFO StringIoInfo;
97 //VDMFAULTINFO FaultInfo;
100 };
102
103//
104// VDM Printer Information
105//
106typedef struct _Vdm_Printer_Info
107{
109 // TODO
111
112//
113// VDM Trace Information
114//
115typedef struct _VdmTraceInfo
116{
117 // TODO
119 // TODO
121
122//
123// VDM Family Table
124//
125typedef struct _tagFAMILY_TABLE
126{
128 // TODO
130
131//
132// Thread Information Block for VDM Threads
133//
134typedef struct _Vdm_Tib
135{
151
152//
153// Process Information Block for VDM Processes
154//
156{
157 PVOID VdmIoListHead; // PVDM_IO_LISTHEAD
163 PVOID pIcaUserData; // VDMICAUSERDATA
180
181//
182// Functions
183//
185NTAPI
187 VOID
188);
189
190//
191// Global data inside the VDM
192//
193
194
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
_VdmEventClass
Definition: vdm.h:55
@ VdmBop
Definition: vdm.h:60
@ VdmIrq13
Definition: vdm.h:62
@ VdmIntAck
Definition: vdm.h:59
@ VdmStringIO
Definition: vdm.h:57
@ VdmMemAccess
Definition: vdm.h:58
@ VdmError
Definition: vdm.h:61
@ VdmIO
Definition: vdm.h:56
struct _Vdm_FaultHandler VDM_FAULTHANDLER
struct _Vdm_InterruptHandler VDM_INTERRUPTHANDLER
struct _VdmEventInfo VDMEVENTINFO
struct _tagFAMILY_TABLE FAMILY_TABLE
struct _tagFAMILY_TABLE * PFAMILY_TABLE
struct _Vdm_Printer_Info * PVDM_PRINTER_INFO
struct _VdmTraceInfo * PVDMTRACEINFO
NTSTATUS NTAPI VdmpStartExecution(VOID)
Definition: vdmexec.c:171
struct _Vdm_Printer_Info VDM_PRINTER_INFO
struct _Vdm_InterruptHandler * PVDM_INTERRUPTHANDLER
struct _VdmTraceInfo VDMTRACEINFO
struct _Vdm_FaultHandler * PVDM_FAULTHANDLER
struct _Vdm_Tib * PVDM_TIB
struct _Vdm_Tib VDM_TIB
enum _VdmEventClass * PVDMEVENTCLASS
struct _VDM_PROCESS_OBJECTS VDM_PROCESS_OBJECTS
struct _VdmEventInfo * PVDMEVENTINFO
enum _VdmEventClass VDMEVENTCLASS
struct _VDM_PROCESS_OBJECTS * PVDM_PROCESS_OBJECTS
long LONG
Definition: pedump.c:60
unsigned short USHORT
Definition: pedump.c:61
Definition: ketypes.h:547
Definition: typedefs.h:120
UCHAR PrinterHostState
Definition: vdm.h:169
USHORT AdlibVirtPortEnd
Definition: vdm.h:175
PVDM_TIB VdmTib
Definition: vdm.h:165
LIST_ENTRY DelayIntListHead
Definition: vdm.h:162
PETHREAD MainThread
Definition: vdm.h:164
FAST_MUTEX DelayIntFastMutex
Definition: vdm.h:160
PVOID pIcaUserData
Definition: vdm.h:163
PVOID VdmIoListHead
Definition: vdm.h:157
KSPIN_LOCK DelayIntSpinLock
Definition: vdm.h:161
USHORT AdlibVirtPortStart
Definition: vdm.h:174
KAPC QueuedIntApc
Definition: vdm.h:158
UCHAR PrinterState
Definition: vdm.h:166
USHORT AdlibPhysPortStart
Definition: vdm.h:172
USHORT AdlibIndexRegister
Definition: vdm.h:171
USHORT AdlibAction
Definition: vdm.h:176
USHORT AdlibPhysPortEnd
Definition: vdm.h:173
ULONG PMCliTimeStamp
Definition: vdm.h:178
UCHAR PrinterStatus
Definition: vdm.h:168
KAPC QueuedIntUserApc
Definition: vdm.h:159
USHORT VdmControl
Definition: vdm.h:177
UCHAR PrinterControl
Definition: vdm.h:167
USHORT AdlibStatus
Definition: vdm.h:170
ULONG BopNumber
Definition: vdm.h:96
ULONG Size
Definition: vdm.h:89
VDMEVENTCLASS Event
Definition: vdm.h:90
LONG ErrorStatus
Definition: vdm.h:98
ULONG InstructionSize
Definition: vdm.h:91
ULONG IntAckInfo
Definition: vdm.h:99
UCHAR Flags
Definition: vdm.h:118
USHORT SsSelector
Definition: vdm.h:78
ULONG Esp
Definition: vdm.h:80
ULONG Flags
Definition: vdm.h:81
ULONG Eip
Definition: vdm.h:79
USHORT CsSelector
Definition: vdm.h:77
USHORT Flags
Definition: vdm.h:71
USHORT CsSelector
Definition: vdm.h:70
PUCHAR prt_state
Definition: vdm.h:108
Definition: vdm.h:135
PFAMILY_TABLE * pDpmFamTbls
Definition: vdm.h:148
PVDM_INTERRUPTHANDLER VdmInterruptTable
Definition: vdm.h:137
PVDM_FAULTHANDLER VdmFaultTable
Definition: vdm.h:138
ULONG Size
Definition: vdm.h:136
CONTEXT VdmContext
Definition: vdm.h:140
VDMTRACEINFO TraceInfo
Definition: vdm.h:145
ULONG IntelMSW
Definition: vdm.h:146
CONTEXT MonitorContext
Definition: vdm.h:139
LONG NumTasks
Definition: vdm.h:147
ULONG TempArea2[2]
Definition: vdm.h:144
BOOLEAN ContinueExecution
Definition: vdm.h:149
VDMEVENTINFO EventInfo
Definition: vdm.h:141
VDM_PRINTER_INFO PrinterInfo
Definition: vdm.h:142
ULONG TempArea1[2]
Definition: vdm.h:143
INT numHookedAPIs
Definition: vdm.h:127
#define NTAPI
Definition: typedefs.h:36
int32_t INT
Definition: typedefs.h:58
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
FAST_MUTEX
Definition: extypes.h:17
unsigned char UCHAR
Definition: xmlstorage.h:181