5faa435255716648d39116a7087a13172271e6f1
[reactos.git] / include / reactos / subsys / win / vdm.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Base API Server DLL
4 * FILE: include/reactos/subsys/win/vdm.h
5 * PURPOSE: Public definitions for the Virtual Dos Machine
6 * PROGRAMMERS: Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
7 * Alex Ionescu (alex.ionescu@reactos.org)
8 */
9
10 #ifndef _VDM_H
11 #define _VDM_H
12
13 #pragma once
14
15 /* CONSTANTS & TYPES **********************************************************/
16
17 typedef enum _VDM_ENTRY_CODE
18 {
19 VdmEntryUndo,
20 VdmEntryUpdateProcess,
21 VdmEntryUpdateControlCHandler
22 } VDM_ENTRY_CODE;
23
24 //
25 // Undo States
26 //
27 #define VDM_UNDO_PARTIAL 0x01
28 #define VDM_UNDO_FULL 0x02
29 #define VDM_UNDO_REUSE 0x04
30 #define VDM_UNDO_COMPLETED 0x08
31
32 //
33 // Binary Types to share with VDM
34 //
35 #define BINARY_TYPE_EXE 0x01
36 #define BINARY_TYPE_COM 0x02
37 #define BINARY_TYPE_PIF 0x03
38 #define BINARY_TYPE_DOS 0x10
39 #define BINARY_TYPE_SEPARATE_WOW 0x20
40 #define BINARY_TYPE_WOW 0x40
41 #define BINARY_TYPE_WOW_EX 0x80
42
43 //
44 // VDM States
45 //
46 #define VDM_NOT_LOADED 0x01
47 #define VDM_NOT_READY 0x02
48 #define VDM_READY 0x04
49
50 //
51 // VDM Magic Values
52 //
53 #define VDM_FLAG_WOW 0x02
54 #define VDM_INC_REENTER_COUNT 0x10
55 #define VDM_DEC_REENTER_COUNT 0x20
56
57 typedef struct
58 {
59 ULONG TaskId;
60 ULONG CreationFlags;
61 ULONG ExitCode;
62 ULONG CodePage;
63 HANDLE StdIn;
64 HANDLE StdOut;
65 HANDLE StdErr;
66 LPSTR CmdLine;
67 LPSTR AppName;
68 LPSTR PifFile;
69 LPSTR CurDirectory;
70 LPSTR Env;
71 ULONG EnvLen;
72 STARTUPINFOA StartupInfo;
73 LPSTR Desktop;
74 ULONG DesktopLen;
75 LPSTR Title;
76 ULONG TitleLen;
77 LPVOID Reserved;
78 ULONG ReservedLen;
79 USHORT CmdLen;
80 USHORT AppLen;
81 USHORT PifLen;
82 USHORT CurDirectoryLen;
83 USHORT VDMState;
84 USHORT CurrentDrive;
85 BOOLEAN ComingFromBat;
86 } VDM_COMMAND_INFO, *PVDM_COMMAND_INFO;
87
88
89 /* FUNCTION PROTOTYPES ********************************************************/
90
91 BOOL
92 WINAPI
93 GetNextVDMCommand(
94 IN OUT PVDM_COMMAND_INFO CommandData OPTIONAL
95 );
96
97 VOID
98 WINAPI
99 ExitVDM(
100 IN BOOL IsWow,
101 IN ULONG iWowTask
102 );
103
104 #endif // _VDM_H
105
106 /* EOF */