xref: /reactos/sdk/include/reactos/subsys/win/vdm.h (revision 8a978a17)
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 Flags
52 //
53 #define VDM_FLAG_FIRST_TASK     0x01
54 #define VDM_FLAG_WOW            0x02
55 #define VDM_FLAG_DOS            0x04
56 #define VDM_FLAG_RETRY          0x08
57 #define VDM_INC_REENTER_COUNT   0x10
58 #define VDM_DEC_REENTER_COUNT   0x20
59 #define VDM_FLAG_NESTED_TASK    0x40
60 #define VDM_FLAG_DONT_WAIT      0x80
61 #define VDM_GET_FIRST_COMMAND   0x100
62 #define VDM_GET_ENVIRONMENT     0x400
63 #define VDM_FLAG_SEPARATE_WOW   0x800
64 #define VDM_LIST_WOW_PROCESSES  0x1000
65 #define VDM_LIST_WOW_TASKS      0x4000
66 #define VDM_ADD_WOW_TASK        0x8000
67 
68 typedef struct
69 {
70     ULONG TaskId;
71     ULONG CreationFlags;
72     ULONG ExitCode;
73     ULONG CodePage;
74     HANDLE StdIn;
75     HANDLE StdOut;
76     HANDLE StdErr;
77     LPSTR CmdLine;
78     LPSTR AppName;
79     LPSTR PifFile;
80     LPSTR CurDirectory;
81     LPSTR Env;
82     ULONG EnvLen;
83     STARTUPINFOA StartupInfo;
84     LPSTR Desktop;
85     ULONG DesktopLen;
86     LPSTR Title;
87     ULONG TitleLen;
88     LPVOID Reserved;
89     ULONG ReservedLen;
90     USHORT CmdLen;
91     USHORT AppLen;
92     USHORT PifLen;
93     USHORT CurDirectoryLen;
94     USHORT VDMState;
95     USHORT CurrentDrive;
96     BOOLEAN ComingFromBat;
97 } VDM_COMMAND_INFO, *PVDM_COMMAND_INFO;
98 
99 
100 /* FUNCTION PROTOTYPES ********************************************************/
101 
102 BOOL
103 WINAPI
104 GetNextVDMCommand(
105     IN OUT PVDM_COMMAND_INFO CommandData OPTIONAL
106 );
107 
108 VOID
109 WINAPI
110 ExitVDM(
111     IN BOOL IsWow,
112     IN ULONG iWowTask
113 );
114 
115 #endif // _VDM_H
116 
117 /* EOF */
118