ReactOS 0.4.16-dev-2473-gb34a1f1
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 Event Types
47//
48typedef enum _VdmEventClass
49{
58
59//
60// VDM Interrupt and Fault Handler Definitions
61//
63{
68
69typedef struct _Vdm_FaultHandler
70{
77
78//
79// VDM Event Information
80//
81typedef struct _VdmEventInfo
82{
86 union
87 {
88 //VDMIOINFO IoInfo;
89 //VDMSTRINGIOINFO StringIoInfo;
91 //VDMFAULTINFO FaultInfo;
94 };
96
97//
98// VDM Printer Information
99//
100typedef struct _Vdm_Printer_Info
101{
103 // TODO
105
106//
107// VDM Trace Information
108//
109typedef struct _VdmTraceInfo
110{
111 // TODO
113 // TODO
115
116//
117// VDM Family Table
118//
119typedef struct _tagFAMILY_TABLE
120{
122 // TODO
124
125//
126// Thread Information Block for VDM Threads
127//
128typedef struct _Vdm_Tib
129{
145
146//
147// Process Information Block for VDM Processes
148//
150{
151 PVOID VdmIoListHead; // PVDM_IO_LISTHEAD
157 PVOID pIcaUserData; // VDMICAUSERDATA
174
175//
176// Functions
177//
179NTAPI
181 VOID
182);
183
184//
185// Global data inside the VDM
186//
187
188
unsigned char BOOLEAN
Definition: actypes.h:127
LONG NTSTATUS
Definition: precomp.h:26
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
_VdmEventClass
Definition: vdm.h:49
@ VdmBop
Definition: vdm.h:54
@ VdmIrq13
Definition: vdm.h:56
@ VdmIntAck
Definition: vdm.h:53
@ VdmStringIO
Definition: vdm.h:51
@ VdmMemAccess
Definition: vdm.h:52
@ VdmError
Definition: vdm.h:55
@ VdmIO
Definition: vdm.h:50
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:599
Definition: typedefs.h:120
UCHAR PrinterHostState
Definition: vdm.h:163
USHORT AdlibVirtPortEnd
Definition: vdm.h:169
PVDM_TIB VdmTib
Definition: vdm.h:159
LIST_ENTRY DelayIntListHead
Definition: vdm.h:156
PETHREAD MainThread
Definition: vdm.h:158
FAST_MUTEX DelayIntFastMutex
Definition: vdm.h:154
PVOID pIcaUserData
Definition: vdm.h:157
PVOID VdmIoListHead
Definition: vdm.h:151
KSPIN_LOCK DelayIntSpinLock
Definition: vdm.h:155
USHORT AdlibVirtPortStart
Definition: vdm.h:168
KAPC QueuedIntApc
Definition: vdm.h:152
UCHAR PrinterState
Definition: vdm.h:160
USHORT AdlibPhysPortStart
Definition: vdm.h:166
USHORT AdlibIndexRegister
Definition: vdm.h:165
USHORT AdlibAction
Definition: vdm.h:170
USHORT AdlibPhysPortEnd
Definition: vdm.h:167
ULONG PMCliTimeStamp
Definition: vdm.h:172
UCHAR PrinterStatus
Definition: vdm.h:162
KAPC QueuedIntUserApc
Definition: vdm.h:153
USHORT VdmControl
Definition: vdm.h:171
UCHAR PrinterControl
Definition: vdm.h:161
USHORT AdlibStatus
Definition: vdm.h:164
ULONG BopNumber
Definition: vdm.h:90
ULONG Size
Definition: vdm.h:83
VDMEVENTCLASS Event
Definition: vdm.h:84
LONG ErrorStatus
Definition: vdm.h:92
ULONG InstructionSize
Definition: vdm.h:85
ULONG IntAckInfo
Definition: vdm.h:93
UCHAR Flags
Definition: vdm.h:112
USHORT SsSelector
Definition: vdm.h:72
ULONG Esp
Definition: vdm.h:74
ULONG Flags
Definition: vdm.h:75
ULONG Eip
Definition: vdm.h:73
USHORT CsSelector
Definition: vdm.h:71
USHORT Flags
Definition: vdm.h:65
USHORT CsSelector
Definition: vdm.h:64
PUCHAR prt_state
Definition: vdm.h:102
Definition: vdm.h:129
PFAMILY_TABLE * pDpmFamTbls
Definition: vdm.h:142
PVDM_INTERRUPTHANDLER VdmInterruptTable
Definition: vdm.h:131
PVDM_FAULTHANDLER VdmFaultTable
Definition: vdm.h:132
ULONG Size
Definition: vdm.h:130
CONTEXT VdmContext
Definition: vdm.h:134
VDMTRACEINFO TraceInfo
Definition: vdm.h:139
ULONG IntelMSW
Definition: vdm.h:140
CONTEXT MonitorContext
Definition: vdm.h:133
LONG NumTasks
Definition: vdm.h:141
ULONG TempArea2[2]
Definition: vdm.h:138
BOOLEAN ContinueExecution
Definition: vdm.h:143
VDMEVENTINFO EventInfo
Definition: vdm.h:135
VDM_PRINTER_INFO PrinterInfo
Definition: vdm.h:136
ULONG TempArea1[2]
Definition: vdm.h:137
INT numHookedAPIs
Definition: vdm.h:121
#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