646298c0d0c9b0b5511c0c2c73018eab4f13741f
[reactos.git] / dll / win32 / kernel32 / include / vdm.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS System Libraries
4 * FILE: dll/win32/kernel32/include/vdm.h
5 * PURPOSE: Virtual DOS Machines (VDM) Support Definitions
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7 */
8
9 #pragma once
10
11 /* CONSTANTS ******************************************************************/
12
13 typedef enum _VDM_ENTRY_CODE
14 {
15 VdmEntryUndo,
16 VdmEntryUpdateProcess,
17 VdmEntryUpdateControlCHandler
18 } VDM_ENTRY_CODE;
19
20 //
21 // Undo States
22 //
23 #define VDM_UNDO_PARTIAL 0x01
24 #define VDM_UNDO_FULL 0x02
25 #define VDM_UNDO_REUSE 0x04
26 #define VDM_UNDO_COMPLETED 0x08
27
28 //
29 // Binary Types to share with VDM
30 //
31 #define BINARY_TYPE_EXE 0x01
32 #define BINARY_TYPE_COM 0x02
33 #define BINARY_TYPE_PIF 0x03
34 #define BINARY_TYPE_DOS 0x10
35 #define BINARY_TYPE_SEPARATE_WOW 0x20
36 #define BINARY_TYPE_WOW 0x40
37 #define BINARY_TYPE_WOW_EX 0x80
38
39 //
40 // VDM States
41 //
42 #define VDM_NOT_LOADED 0x01
43 #define VDM_NOT_READY 0x02
44 #define VDM_READY 0x04
45
46 /* STRUCTURES *****************************************************************/
47
48 typedef struct _GET_NEXT_VDM_COMMAND_DATA
49 {
50 ULONG iTask;
51 ULONG dwUnused;
52 ULONG dwExitCode;
53 ULONG dwCodePage;
54 HANDLE hStdIn;
55 HANDLE hStdOut;
56 HANDLE hStdErr;
57 LPSTR lpCmdLine;
58 LPSTR lpAppName;
59 LPSTR lpPifFile;
60 LPSTR lpCurDirectory;
61 LPSTR lpEnv;
62 ULONG dwEnvLen;
63 STARTUPINFOA StartupInfo;
64 LPSTR lpDesktop;
65 ULONG dwDesktopLen;
66 LPSTR lpTitle;
67 ULONG dwTitleLen;
68 LPVOID lpReserved;
69 ULONG dwReservedLen;
70 USHORT wCmdLen;
71 USHORT wAppLen;
72 USHORT wPifLen;
73 USHORT wCurDirectoryLen;
74 USHORT wVDMState;
75 USHORT wCurrentDrive;
76 BOOLEAN fComingFromBat;
77 } GET_NEXT_VDM_COMMAND_DATA, *PGET_NEXT_VDM_COMMAND_DATA;
78
79 /* FUNCTION PROTOTYPES ********************************************************/
80
81 BOOL
82 NTAPI
83 BaseDestroyVDMEnvironment(
84 IN PANSI_STRING AnsiEnv,
85 IN PUNICODE_STRING UnicodeEnv
86 );
87
88 BOOL
89 WINAPI
90 BaseGetVdmConfigInfo(
91 IN LPCWSTR CommandLineReserved,
92 IN ULONG DosSeqId,
93 IN ULONG BinaryType,
94 IN PUNICODE_STRING CmdLineString,
95 OUT PULONG VdmSize
96 );
97
98 BOOL
99 NTAPI
100 BaseCreateVDMEnvironment(
101 IN PWCHAR lpEnvironment,
102 IN PANSI_STRING AnsiEnv,
103 IN PUNICODE_STRING UnicodeEnv
104 );
105
106 BOOL
107 WINAPI
108 BaseUpdateVDMEntry(
109 IN ULONG UpdateIndex,
110 IN OUT PHANDLE WaitHandle,
111 IN ULONG IndexInfo,
112 IN ULONG BinaryType
113 );
114
115 BOOL
116 WINAPI
117 BaseCheckForVDM(
118 IN HANDLE ProcessHandle,
119 OUT LPDWORD ExitCode
120 );
121
122 NTSTATUS
123 WINAPI
124 BaseCheckVDM(
125 IN ULONG BinaryType,
126 IN PCWCH ApplicationName,
127 IN PCWCH CommandLine,
128 IN PCWCH CurrentDirectory,
129 IN PANSI_STRING AnsiEnvironment,
130 IN PBASE_API_MESSAGE ApiMessage,
131 IN OUT PULONG iTask,
132 IN DWORD CreationFlags,
133 IN LPSTARTUPINFOW StartupInfo,
134 IN HANDLE hUserToken OPTIONAL
135 );
136
137 /* EOF */