719fd15d4feb81d07a2f37dcfe4332dfd1234e5a
[reactos.git] / reactos / include / reactos / subsys / win / basemsg.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Base API Server DLL
4 * FILE: include/reactos/subsys/win/basemsg.h
5 * PURPOSE: Public definitions for communication
6 * between Base API Clients and Servers
7 * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca@sfr.fr)
8 */
9
10 #ifndef _BASEMSG_H
11 #define _BASEMSG_H
12
13 #pragma once
14
15 #define BASESRV_SERVERDLL_INDEX 1
16 #define BASESRV_FIRST_API_NUMBER 0
17
18 // Windows Server 2003 table from http://j00ru.vexillium.org/csrss_list/api_list.html#Windows_2k3
19 typedef enum _BASESRV_API_NUMBER
20 {
21 BasepCreateProcess = BASESRV_FIRST_API_NUMBER,
22 BasepCreateThread,
23 BasepGetTempFile,
24 BasepExitProcess,
25 BasepDebugProcess,
26 BasepCheckVDM,
27 BasepUpdateVDMEntry,
28 BasepGetNextVDMCommand,
29 BasepExitVDM,
30 BasepIsFirstVDM,
31 BasepGetVDMExitCode,
32 BasepSetReenterCount,
33 BasepSetProcessShutdownParam,
34 BasepGetProcessShutdownParam,
35 BasepNlsSetUserInfo,
36 BasepNlsSetMultipleUserInfo,
37 BasepNlsCreateSection,
38 BasepSetVDMCurDirs,
39 BasepGetVDMCurDirs,
40 BasepBatNotification,
41 BasepRegisterWowExec,
42 BasepSoundSentryNotification,
43 BasepRefreshIniFileMapping,
44 BasepDefineDosDevice,
45 BasepSetTermsrvAppInstallMode,
46 BasepNlsUpdateCacheCount,
47 BasepSetTermsrvClientTimeZone,
48 BasepSxsCreateActivationContext,
49 BasepUnknown,
50 BasepRegisterThread,
51 BasepNlsGetUserInfo,
52 BasepMaxApiNumber
53 } BASESRV_API_NUMBER, *PBASESRV_API_NUMBER;
54
55
56 typedef struct _BASESRV_API_CONNECTINFO
57 {
58 ULONG ExpectedVersion;
59 HANDLE DefaultObjectDirectory;
60 ULONG WindowsVersion;
61 ULONG CurrentVersion;
62 ULONG DebugFlags;
63 WCHAR WindowsDirectory[MAX_PATH];
64 WCHAR WindowsSystemDirectory[MAX_PATH];
65 } BASESRV_API_CONNECTINFO, *PBASESRV_API_CONNECTINFO;
66
67 #define BASESRV_VERSION 0x10000
68
69
70 typedef struct _BASE_SXS_CREATEPROCESS_MSG
71 {
72 ULONG Flags;
73 ULONG ProcessParameterFlags;
74 HANDLE FileHandle;
75 UNICODE_STRING SxsWin32ExePath;
76 UNICODE_STRING SxsNtExePath;
77 SIZE_T OverrideManifestOffset;
78 ULONG OverrideManifestSize;
79 SIZE_T OverridePolicyOffset;
80 ULONG OverridePolicySize;
81 PVOID PEManifestAddress;
82 ULONG PEManifestSize;
83 UNICODE_STRING CultureFallbacks;
84 ULONG Unknown[7];
85 UNICODE_STRING AssemblyName;
86 } BASE_SXS_CREATEPROCESS_MSG, *PBASE_SXS_CREATEPROCESS_MSG;
87
88 typedef struct
89 {
90 //
91 // NT-type structure (BASE_CREATEPROCESS_MSG)
92 //
93 HANDLE ProcessHandle;
94 HANDLE ThreadHandle;
95 CLIENT_ID ClientId;
96 ULONG CreationFlags;
97 ULONG VdmBinaryType;
98 ULONG VdmTask;
99 HANDLE hVDM;
100 BASE_SXS_CREATEPROCESS_MSG Sxs;
101 PVOID PebAddressNative;
102 ULONG PebAddressWow64;
103 USHORT ProcessorArchitecture;
104 } BASE_CREATE_PROCESS, *PBASE_CREATE_PROCESS;
105
106 typedef struct
107 {
108 CLIENT_ID ClientId;
109 HANDLE ThreadHandle;
110 } BASE_CREATE_THREAD, *PBASE_CREATE_THREAD;
111
112 typedef struct
113 {
114 UINT UniqueID;
115 } BASE_GET_TEMP_FILE, *PBASE_GET_TEMP_FILE;
116
117 typedef struct
118 {
119 UINT uExitCode;
120 } BASE_EXIT_PROCESS, *PBASE_EXIT_PROCESS;
121
122 typedef struct
123 {
124 ULONG iTask;
125 HANDLE ConsoleHandle;
126 ULONG BinaryType;
127 HANDLE WaitObjectForParent;
128 HANDLE StdIn;
129 HANDLE StdOut;
130 HANDLE StdErr;
131 ULONG CodePage;
132 ULONG dwCreationFlags;
133 PCHAR CmdLine;
134 PCHAR AppName;
135 PCHAR PifFile;
136 PCHAR CurDirectory;
137 PCHAR Env;
138 ULONG EnvLen;
139 LPSTARTUPINFOA StartupInfo;
140 PCHAR Desktop;
141 ULONG DesktopLen;
142 PCHAR Title;
143 ULONG TitleLen;
144 PCHAR Reserved;
145 ULONG ReservedLen;
146 USHORT CmdLen;
147 USHORT AppLen;
148 USHORT PifLen;
149 USHORT CurDirectoryLen;
150 USHORT CurDrive;
151 USHORT VDMState;
152 } BASE_CHECK_VDM, *PBASE_CHECK_VDM;
153
154 typedef struct
155 {
156 ULONG iTask;
157 ULONG BinaryType;
158 HANDLE ConsoleHandle;
159 HANDLE VDMProcessHandle;
160 HANDLE WaitObjectForParent;
161 USHORT EntryIndex;
162 USHORT VDMCreationState;
163 } BASE_UPDATE_VDM_ENTRY, *PBASE_UPDATE_VDM_ENTRY;
164
165 typedef struct
166 {
167 ULONG iTask;
168 HANDLE ConsoleHandle;
169 HANDLE WaitObjectForVDM;
170 HANDLE StdIn;
171 HANDLE StdOut;
172 HANDLE StdErr;
173 ULONG CodePage;
174 ULONG dwCreationFlags;
175 ULONG ExitCode;
176 PCHAR CmdLine;
177 PCHAR AppName;
178 PCHAR PifFile;
179 PCHAR CurDirectory;
180 PCHAR Env;
181 ULONG EnvLen;
182 LPSTARTUPINFOA StartupInfo;
183 PCHAR Desktop;
184 ULONG DesktopLen;
185 PCHAR Title;
186 ULONG TitleLen;
187 PCHAR Reserved;
188 ULONG ReservedLen;
189 USHORT CurrentDrive;
190 USHORT CmdLen;
191 USHORT AppLen;
192 USHORT PifLen;
193 USHORT CurDirectoryLen;
194 USHORT VDMState;
195 ULONG fComingFromBat;
196 } BASE_GET_NEXT_VDM_COMMAND, *PBASE_GET_NEXT_VDM_COMMAND;
197
198 typedef struct
199 {
200 HANDLE ConsoleHandle;
201 ULONG iWowTask;
202 HANDLE WaitObjectForVDM;
203 } BASE_EXIT_VDM, *PBASE_EXIT_VDM;
204
205 typedef struct
206 {
207 ULONG FirstVDM;
208 } BASE_IS_FIRST_VDM, *PBASE_IS_FIRST_VDM;
209
210 typedef struct
211 {
212 HANDLE ConsoleHandle;
213 HANDLE hParent;
214 ULONG ExitCode;
215 } BASE_GET_VDM_EXIT_CODE, *PBASE_GET_VDM_EXIT_CODE;
216
217 typedef struct
218 {
219 HANDLE ConsoleHandle;
220 ULONG fIncDec;
221 } BASE_SET_REENTER_COUNT, *PBASE_SET_REENTER_COUNT;
222
223 typedef struct
224 {
225 ULONG ShutdownLevel;
226 ULONG ShutdownFlags;
227 } BASE_GETSET_PROCESS_SHUTDOWN_PARAMS, *PBASE_GETSET_PROCESS_SHUTDOWN_PARAMS;
228
229 typedef struct
230 {
231 HANDLE ConsoleHandle;
232 PCHAR lpszzCurDirs;
233 ULONG cchCurDirs;
234 } BASE_GETSET_VDM_CURDIRS, *PBASE_GETSET_VDM_CURDIRS;
235
236 typedef struct
237 {
238 HANDLE ConsoleHandle;
239 ULONG fBeginEnd;
240 } BASE_BAT_NOTIFICATION, *PBASE_BAT_NOTIFICATION;
241
242 typedef struct
243 {
244 HANDLE hwndWowExec;
245 } BASE_REGISTER_WOWEXEC, *PBASE_REGISTER_WOWEXEC;
246
247 typedef struct
248 {
249 ULONG VideoMode;
250 } BASE_SOUND_SENTRY, *PBASE_SOUND_SENTRY;
251
252 typedef struct
253 {
254 UNICODE_STRING IniFileName;
255 } BASE_REFRESH_INIFILE_MAPPING, *PBASE_REFRESH_INIFILE_MAPPING;
256
257 typedef struct
258 {
259 ULONG Flags;
260 UNICODE_STRING DeviceName;
261 UNICODE_STRING TargetPath;
262 } BASE_DEFINE_DOS_DEVICE, *PBASE_DEFINE_DOS_DEVICE;
263
264 typedef struct
265 {
266 HANDLE SectionHandle;
267 ULONG Type;
268 ULONG LocaleId;
269 } BASE_NLS_CREATE_SECTION, *PBASE_NLS_CREATE_SECTION;
270
271 typedef struct
272 {
273 PVOID /*PNLS_USER_INFO*/ NlsUserInfo;
274 ULONG Size;
275 } BASE_NLS_GET_USER_INFO, *PBASE_NLS_GET_USER_INFO;
276
277 typedef struct _BASE_API_MESSAGE
278 {
279 PORT_MESSAGE Header;
280
281 PCSR_CAPTURE_BUFFER CsrCaptureData;
282 CSR_API_NUMBER ApiNumber;
283 NTSTATUS Status;
284 ULONG Reserved;
285 union
286 {
287 BASE_CREATE_PROCESS CreateProcessRequest;
288 BASE_CREATE_THREAD CreateThreadRequest;
289 BASE_GET_TEMP_FILE GetTempFileRequest;
290 BASE_EXIT_PROCESS ExitProcessRequest;
291 BASE_CHECK_VDM CheckVDMRequest;
292 BASE_UPDATE_VDM_ENTRY UpdateVDMEntryRequest;
293 BASE_GET_NEXT_VDM_COMMAND GetNextVDMCommandRequest;
294 BASE_EXIT_VDM ExitVDMRequest;
295 BASE_IS_FIRST_VDM IsFirstVDMRequest;
296 BASE_GET_VDM_EXIT_CODE GetVDMExitCodeRequest;
297 BASE_SET_REENTER_COUNT SetReenterCountRequest;
298 BASE_GETSET_PROCESS_SHUTDOWN_PARAMS ShutdownParametersRequest;
299 BASE_GETSET_VDM_CURDIRS VDMCurrentDirsRequest;
300 BASE_BAT_NOTIFICATION BatNotificationRequest;
301 BASE_REGISTER_WOWEXEC RegisterWowExecRequest;
302 BASE_SOUND_SENTRY SoundSentryRequest;
303 BASE_REFRESH_INIFILE_MAPPING RefreshIniFileMappingRequest;
304 BASE_DEFINE_DOS_DEVICE DefineDosDeviceRequest;
305 BASE_NLS_CREATE_SECTION NlsCreateSection;
306 BASE_NLS_GET_USER_INFO NlsGetUserInfo;
307 } Data;
308 } BASE_API_MESSAGE, *PBASE_API_MESSAGE;
309
310 // Check that a BASE_API_MESSAGE can hold in a CSR_API_MESSAGE.
311 CHECK_API_MSG_SIZE(BASE_API_MESSAGE);
312
313 #endif // _BASEMSG_H
314
315 /* EOF */