ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

vdm.h
Go to the documentation of this file.
00001 /*
00002 * PROJECT:         ReactOS Kernel
00003 * LICENSE:         GPL - See COPYING in the top level directory
00004 * FILE:            ntoskrnl/include/vdm.h
00005 * PURPOSE:         Internal header for V86 and VDM Support
00006 * PROGRAMMERS:     Alex Ionescu (alex.ionescu@reactos.org)
00007 */
00008 
00009 //
00010 // Define this if you want debugging support
00011 //
00012 #define _VM_DEBUG_                                      0x00
00013 
00014 //
00015 // These define the Debug Masks Supported
00016 //
00017 #define VM_EXEC_DEBUG                                   0x01
00018 
00019 //
00020 // Debug/Tracing support
00021 //
00022 #if _VM_DEBUG_
00023 #ifdef NEW_DEBUG_SYSTEM_IMPLEMENTED // enable when Debug Filters are implemented
00024 #define VMTRACE DbgPrintEx
00025 #else
00026 #define VMTRACE(x, ...)                                 \
00027     if (x & VdmpTraceLevel) DbgPrint(__VA_ARGS__)
00028 #endif
00029 #else
00030 #define VMTRACE(x, fmt, ...) DPRINT(fmt, ##__VA_ARGS__)
00031 #endif
00032 
00033 //
00034 // Memory addresses inside CSRSS for V86 Support
00035 //
00036 #define TRAMPOLINE_BASE                                 0x10000
00037 #define TRAMPOLINE_TIB                                  0x12000
00038 #define TRAMPOLINE_TEB                                  0x13000
00039 
00040 //
00041 // BOP (Magic Opcode) to exit V86 Mode
00042 //
00043 #define TRAMPOLINE_BOP                                  0xFEC4C4
00044 
00045 //
00046 // VDM State Pointer
00047 //
00048 #define VdmState                                        \
00049     (PULONG)FIXED_NTVDMSTATE_LINEAR_PC_AT
00050 
00051 //
00052 // VDM Event Types
00053 //
00054 typedef enum _VdmEventClass
00055 {
00056     VdmIO,
00057     VdmStringIO,
00058     VdmMemAccess,
00059     VdmIntAck,
00060     VdmBop,
00061     VdmError,
00062     VdmIrq13
00063 } VDMEVENTCLASS, *PVDMEVENTCLASS;
00064 
00065 //
00066 // VDM Interrupt and Fault Handler Definitions
00067 //
00068 typedef struct _Vdm_InterruptHandler
00069 {
00070     USHORT CsSelector;
00071     USHORT Flags;
00072     ULONG Eip;
00073 } VDM_INTERRUPTHANDLER, *PVDM_INTERRUPTHANDLER;
00074 
00075 typedef struct _Vdm_FaultHandler
00076 {
00077     USHORT CsSelector;
00078     USHORT SsSelector;
00079     ULONG Eip;
00080     ULONG Esp;
00081     ULONG Flags;
00082 } VDM_FAULTHANDLER, *PVDM_FAULTHANDLER;
00083 
00084 //
00085 // VDM Event Information
00086 //
00087 typedef struct _VdmEventInfo
00088 {
00089     ULONG Size;
00090     VDMEVENTCLASS Event;
00091     ULONG InstructionSize;
00092     union
00093     {
00094         //VDMIOINFO IoInfo;
00095         //VDMSTRINGIOINFO StringIoInfo;
00096         ULONG BopNumber;
00097         //VDMFAULTINFO FaultInfo;
00098         LONG ErrorStatus;
00099         ULONG IntAckInfo;
00100     };
00101 } VDMEVENTINFO, *PVDMEVENTINFO;
00102 
00103 //
00104 // VDM Printer Information
00105 //
00106 typedef struct _Vdm_Printer_Info
00107 {
00108     PUCHAR prt_state;
00109     // TODO
00110 } VDM_PRINTER_INFO, *PVDM_PRINTER_INFO;
00111 
00112 //
00113 // VDM Trace Information
00114 //
00115 typedef struct _VdmTraceInfo
00116 {
00117     // TODO
00118     UCHAR Flags;
00119     // TODO
00120 } VDMTRACEINFO, *PVDMTRACEINFO;
00121 
00122 //
00123 // VDM Family Table
00124 //
00125 typedef struct _tagFAMILY_TABLE
00126 {
00127     INT numHookedAPIs;
00128     // TODO
00129 } FAMILY_TABLE, *PFAMILY_TABLE;
00130 
00131 //
00132 // Thread Information Block for VDM Threads
00133 //
00134 typedef struct _Vdm_Tib
00135 {
00136     ULONG Size;
00137     PVDM_INTERRUPTHANDLER VdmInterruptTable;
00138     PVDM_FAULTHANDLER VdmFaultTable;
00139     CONTEXT MonitorContext;
00140     CONTEXT VdmContext;
00141     VDMEVENTINFO EventInfo;
00142     VDM_PRINTER_INFO PrinterInfo;
00143     ULONG TempArea1[2];
00144     ULONG TempArea2[2];
00145     VDMTRACEINFO TraceInfo;
00146     ULONG IntelMSW;
00147     LONG NumTasks;
00148     PFAMILY_TABLE *pDpmFamTbls;
00149     BOOLEAN ContinueExecution;
00150 } VDM_TIB, *PVDM_TIB;
00151 
00152 //
00153 // Process Information Block for VDM Processes
00154 //
00155 typedef struct _VDM_PROCESS_OBJECTS
00156 {
00157     PVOID VdmIoListHead; // PVDM_IO_LISTHEAD
00158     KAPC QueuedIntApc;
00159     KAPC QueuedIntUserApc;
00160     FAST_MUTEX DelayIntFastMutex;
00161     KSPIN_LOCK DelayIntSpinLock;
00162     LIST_ENTRY DelayIntListHead;
00163     PVOID pIcaUserData; // VDMICAUSERDATA
00164     PETHREAD MainThread;
00165     PVDM_TIB VdmTib;
00166     UCHAR PrinterState;
00167     UCHAR PrinterControl;
00168     UCHAR PrinterStatus;
00169     UCHAR PrinterHostState;
00170     USHORT AdlibStatus;
00171     USHORT AdlibIndexRegister;
00172     USHORT AdlibPhysPortStart;
00173     USHORT AdlibPhysPortEnd;
00174     USHORT AdlibVirtPortStart;
00175     USHORT AdlibVirtPortEnd;
00176     USHORT AdlibAction;
00177     USHORT VdmControl;
00178     ULONG PMCliTimeStamp;
00179 } VDM_PROCESS_OBJECTS, *PVDM_PROCESS_OBJECTS;
00180 
00181 //
00182 // Functions
00183 //
00184 NTSTATUS
00185 NTAPI
00186 VdmpStartExecution(
00187     VOID
00188 );
00189 
00190 //
00191 // Global data inside the VDM
00192 //
00193 
00194 

Generated on Sun May 27 2012 04:37:15 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.