ReactOS  0.4.15-dev-489-g75a0787
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 //
54 typedef enum _VdmEventClass
55 {
64 
65 //
66 // VDM Interrupt and Fault Handler Definitions
67 //
68 typedef struct _Vdm_InterruptHandler
69 {
74 
75 typedef struct _Vdm_FaultHandler
76 {
83 
84 //
85 // VDM Event Information
86 //
87 typedef struct _VdmEventInfo
88 {
92  union
93  {
94  //VDMIOINFO IoInfo;
95  //VDMSTRINGIOINFO StringIoInfo;
97  //VDMFAULTINFO FaultInfo;
100  };
102 
103 //
104 // VDM Printer Information
105 //
106 typedef struct _Vdm_Printer_Info
107 {
109  // TODO
111 
112 //
113 // VDM Trace Information
114 //
115 typedef struct _VdmTraceInfo
116 {
117  // TODO
119  // TODO
121 
122 //
123 // VDM Family Table
124 //
125 typedef struct _tagFAMILY_TABLE
126 {
128  // TODO
130 
131 //
132 // Thread Information Block for VDM Threads
133 //
134 typedef struct _Vdm_Tib
135 {
150 } VDM_TIB, *PVDM_TIB;
151 
152 //
153 // Process Information Block for VDM Processes
154 //
155 typedef struct _VDM_PROCESS_OBJECTS
156 {
157  PVOID VdmIoListHead; // PVDM_IO_LISTHEAD
163  PVOID pIcaUserData; // VDMICAUSERDATA
180 
181 //
182 // Functions
183 //
184 NTSTATUS
185 NTAPI
187  VOID
188 );
189 
190 //
191 // Global data inside the VDM
192 //
193 
194 
UCHAR Flags
Definition: vdm.h:118
struct _VdmEventInfo VDMEVENTINFO
struct _VdmTraceInfo VDMTRACEINFO
ULONG Eip
Definition: vdm.h:79
PFAMILY_TABLE * pDpmFamTbls
Definition: vdm.h:148
_VdmEventClass
Definition: vdm.h:54
ULONG PMCliTimeStamp
Definition: vdm.h:178
struct _VdmEventInfo * PVDMEVENTINFO
USHORT AdlibPhysPortStart
Definition: vdm.h:172
Definition: vdm.h:134
USHORT AdlibPhysPortEnd
Definition: vdm.h:173
ULONG BopNumber
Definition: vdm.h:96
ULONG TempArea2[2]
Definition: vdm.h:144
VDMEVENTCLASS Event
Definition: vdm.h:90
USHORT AdlibIndexRegister
Definition: vdm.h:171
KSPIN_LOCK DelayIntSpinLock
Definition: vdm.h:161
UCHAR PrinterState
Definition: vdm.h:166
Definition: vdm.h:62
unsigned char * PUCHAR
Definition: retypes.h:3
CONTEXT VdmContext
Definition: vdm.h:140
LONG NTSTATUS
Definition: precomp.h:26
Definition: vdm.h:56
BOOLEAN ContinueExecution
Definition: vdm.h:149
struct _VDM_PROCESS_OBJECTS VDM_PROCESS_OBJECTS
int32_t INT
Definition: typedefs.h:57
ULONG Size
Definition: vdm.h:136
PVDM_TIB VdmTib
Definition: vdm.h:165
struct _Vdm_InterruptHandler * PVDM_INTERRUPTHANDLER
INT numHookedAPIs
Definition: vdm.h:127
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
ULONG Flags
Definition: vdm.h:81
long LONG
Definition: pedump.c:60
struct _VdmTraceInfo * PVDMTRACEINFO
LONG NumTasks
Definition: vdm.h:147
struct _tagFAMILY_TABLE * PFAMILY_TABLE
unsigned char BOOLEAN
PVDM_INTERRUPTHANDLER VdmInterruptTable
Definition: vdm.h:137
enum _VdmEventClass VDMEVENTCLASS
USHORT AdlibVirtPortEnd
Definition: vdm.h:175
USHORT AdlibStatus
Definition: vdm.h:170
FAST_MUTEX
Definition: extypes.h:17
ULONG Size
Definition: vdm.h:89
struct _Vdm_Tib * PVDM_TIB
VDMEVENTINFO EventInfo
Definition: vdm.h:141
USHORT AdlibAction
Definition: vdm.h:176
struct _Vdm_InterruptHandler VDM_INTERRUPTHANDLER
KAPC QueuedIntUserApc
Definition: vdm.h:159
Definition: vdm.h:60
USHORT CsSelector
Definition: vdm.h:70
PETHREAD MainThread
Definition: vdm.h:164
enum _VdmEventClass * PVDMEVENTCLASS
ULONG IntelMSW
Definition: vdm.h:146
struct _Vdm_Printer_Info VDM_PRINTER_INFO
USHORT SsSelector
Definition: vdm.h:78
CONTEXT MonitorContext
Definition: vdm.h:139
UCHAR PrinterControl
Definition: vdm.h:167
unsigned char UCHAR
Definition: xmlstorage.h:181
Definition: vdm.h:59
struct _VDM_PROCESS_OBJECTS * PVDM_PROCESS_OBJECTS
VDM_PRINTER_INFO PrinterInfo
Definition: vdm.h:142
ULONG Esp
Definition: vdm.h:80
Definition: ketypes.h:535
Definition: typedefs.h:118
struct _Vdm_Printer_Info * PVDM_PRINTER_INFO
ULONG IntAckInfo
Definition: vdm.h:99
USHORT Flags
Definition: vdm.h:71
UCHAR PrinterStatus
Definition: vdm.h:168
USHORT VdmControl
Definition: vdm.h:177
struct _tagFAMILY_TABLE FAMILY_TABLE
LONG ErrorStatus
Definition: vdm.h:98
unsigned short USHORT
Definition: pedump.c:61
PVOID VdmIoListHead
Definition: vdm.h:157
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
struct _Vdm_FaultHandler * PVDM_FAULTHANDLER
VDMTRACEINFO TraceInfo
Definition: vdm.h:145
struct _Vdm_FaultHandler VDM_FAULTHANDLER
ULONG TempArea1[2]
Definition: vdm.h:143
ULONG InstructionSize
Definition: vdm.h:91
unsigned int ULONG
Definition: retypes.h:1
USHORT AdlibVirtPortStart
Definition: vdm.h:174
Definition: vdm.h:61
PVOID pIcaUserData
Definition: vdm.h:163
LIST_ENTRY DelayIntListHead
Definition: vdm.h:162
KAPC QueuedIntApc
Definition: vdm.h:158
PUCHAR prt_state
Definition: vdm.h:108
USHORT CsSelector
Definition: vdm.h:77
struct _Vdm_Tib VDM_TIB
PVDM_FAULTHANDLER VdmFaultTable
Definition: vdm.h:138
UCHAR PrinterHostState
Definition: vdm.h:169
NTSTATUS NTAPI VdmpStartExecution(VOID)
Definition: vdmexec.c:171
FAST_MUTEX DelayIntFastMutex
Definition: vdm.h:160