22130d959965e5f990a8455e7b9a3732f90eb3e9
[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 BasepDebugProcess,
50 BasepRegisterThread,
51 BasepNlsGetUserInfo,
52
53 BasepMaxApiNumber
54 } BASESRV_API_NUMBER, *PBASESRV_API_NUMBER;
55
56
57 typedef struct _BASESRV_API_CONNECTINFO
58 {
59 ULONG ExpectedVersion;
60 HANDLE DefaultObjectDirectory;
61 ULONG WindowsVersion;
62 ULONG CurrentVersion;
63 ULONG DebugFlags;
64 WCHAR WindowsDirectory[MAX_PATH];
65 WCHAR WindowsSystemDirectory[MAX_PATH];
66 } BASESRV_API_CONNECTINFO, *PBASESRV_API_CONNECTINFO;
67
68 #define BASESRV_VERSION 0x10000
69
70
71 typedef struct _BASE_SXS_CREATEPROCESS_MSG
72 {
73 ULONG Flags;
74 ULONG ProcessParameterFlags;
75 HANDLE FileHandle;
76 UNICODE_STRING SxsWin32ExePath;
77 UNICODE_STRING SxsNtExePath;
78 SIZE_T OverrideManifestOffset;
79 ULONG OverrideManifestSize;
80 SIZE_T OverridePolicyOffset;
81 ULONG OverridePolicySize;
82 PVOID PEManifestAddress;
83 ULONG PEManifestSize;
84 UNICODE_STRING CultureFallbacks;
85 ULONG Unknown[7];
86 UNICODE_STRING AssemblyName;
87 } BASE_SXS_CREATEPROCESS_MSG, *PBASE_SXS_CREATEPROCESS_MSG;
88
89 typedef struct
90 {
91 //
92 // NT-type structure (BASE_CREATEPROCESS_MSG)
93 //
94 HANDLE ProcessHandle;
95 HANDLE ThreadHandle;
96 CLIENT_ID ClientId;
97 ULONG CreationFlags;
98 ULONG VdmBinaryType;
99 ULONG VdmTask;
100 HANDLE hVDM;
101 BASE_SXS_CREATEPROCESS_MSG Sxs;
102 PVOID PebAddressNative;
103 ULONG PebAddressWow64;
104 USHORT ProcessorArchitecture;
105 } BASE_CREATE_PROCESS, *PBASE_CREATE_PROCESS;
106
107 typedef struct
108 {
109 CLIENT_ID ClientId;
110 HANDLE ThreadHandle;
111 } BASE_CREATE_THREAD, *PBASE_CREATE_THREAD;
112
113 typedef struct
114 {
115 UINT UniqueID;
116 } BASE_GET_TEMP_FILE, *PBASE_GET_TEMP_FILE;
117
118 typedef struct
119 {
120 UINT uExitCode;
121 } BASE_EXIT_PROCESS, *PBASE_EXIT_PROCESS;
122
123 typedef struct
124 {
125 ULONG iTask;
126 HANDLE ConsoleHandle;
127 ULONG BinaryType;
128 HANDLE WaitObjectForParent;
129 HANDLE StdIn;
130 HANDLE StdOut;
131 HANDLE StdErr;
132 ULONG CodePage;
133 ULONG dwCreationFlags;
134 PCHAR CmdLine;
135 PCHAR AppName;
136 PCHAR PifFile;
137 PCHAR CurDirectory;
138 PCHAR Env;
139 ULONG EnvLen;
140 LPSTARTUPINFOA StartupInfo;
141 PCHAR Desktop;
142 ULONG DesktopLen;
143 PCHAR Title;
144 ULONG TitleLen;
145 PCHAR Reserved;
146 ULONG ReservedLen;
147 USHORT CmdLen;
148 USHORT AppLen;
149 USHORT PifLen;
150 USHORT CurDirectoryLen;
151 USHORT CurDrive;
152 USHORT VDMState;
153 } BASE_CHECK_VDM, *PBASE_CHECK_VDM;
154
155 typedef struct
156 {
157 ULONG iTask;
158 ULONG BinaryType;
159 HANDLE ConsoleHandle;
160 HANDLE VDMProcessHandle;
161 HANDLE WaitObjectForParent;
162 USHORT EntryIndex;
163 USHORT VDMCreationState;
164 } BASE_UPDATE_VDM_ENTRY, *PBASE_UPDATE_VDM_ENTRY;
165
166 typedef struct
167 {
168 ULONG iTask;
169 HANDLE ConsoleHandle;
170 HANDLE WaitObjectForVDM;
171 HANDLE StdIn;
172 HANDLE StdOut;
173 HANDLE StdErr;
174 ULONG CodePage;
175 ULONG dwCreationFlags;
176 ULONG ExitCode;
177 PCHAR CmdLine;
178 PCHAR AppName;
179 PCHAR PifFile;
180 PCHAR CurDirectory;
181 PCHAR Env;
182 ULONG EnvLen;
183 LPSTARTUPINFOA StartupInfo;
184 PCHAR Desktop;
185 ULONG DesktopLen;
186 PCHAR Title;
187 ULONG TitleLen;
188 PCHAR Reserved;
189 ULONG ReservedLen;
190 USHORT CurrentDrive;
191 USHORT CmdLen;
192 USHORT AppLen;
193 USHORT PifLen;
194 USHORT CurDirectoryLen;
195 USHORT VDMState;
196 ULONG fComingFromBat;
197 } BASE_GET_NEXT_VDM_COMMAND, *PBASE_GET_NEXT_VDM_COMMAND;
198
199 typedef struct
200 {
201 HANDLE ConsoleHandle;
202 ULONG iWowTask;
203 HANDLE WaitObjectForVDM;
204 } BASE_EXIT_VDM, *PBASE_EXIT_VDM;
205
206 typedef struct
207 {
208 ULONG FirstVDM;
209 } BASE_IS_FIRST_VDM, *PBASE_IS_FIRST_VDM;
210
211 typedef struct
212 {
213 HANDLE ConsoleHandle;
214 HANDLE hParent;
215 ULONG ExitCode;
216 } BASE_GET_VDM_EXIT_CODE, *PBASE_GET_VDM_EXIT_CODE;
217
218 typedef struct
219 {
220 HANDLE ConsoleHandle;
221 ULONG fIncDec;
222 } BASE_SET_REENTER_COUNT, *PBASE_SET_REENTER_COUNT;
223
224 typedef struct
225 {
226 ULONG ShutdownLevel;
227 ULONG ShutdownFlags;
228 } BASE_GETSET_PROCESS_SHUTDOWN_PARAMS, *PBASE_GETSET_PROCESS_SHUTDOWN_PARAMS;
229
230 typedef struct
231 {
232 HANDLE ConsoleHandle;
233 PCHAR lpszzCurDirs;
234 ULONG cchCurDirs;
235 } BASE_GETSET_VDM_CURDIRS, *PBASE_GETSET_VDM_CURDIRS;
236
237 typedef struct
238 {
239 HANDLE ConsoleHandle;
240 ULONG fBeginEnd;
241 } BASE_BAT_NOTIFICATION, *PBASE_BAT_NOTIFICATION;
242
243 typedef struct
244 {
245 HANDLE hwndWowExec;
246 } BASE_REGISTER_WOWEXEC, *PBASE_REGISTER_WOWEXEC;
247
248 typedef struct
249 {
250 ULONG VideoMode;
251 } BASE_SOUND_SENTRY, *PBASE_SOUND_SENTRY;
252
253 typedef struct
254 {
255 UNICODE_STRING IniFileName;
256 } BASE_REFRESH_INIFILE_MAPPING, *PBASE_REFRESH_INIFILE_MAPPING;
257
258 typedef struct
259 {
260 ULONG Flags;
261 UNICODE_STRING DeviceName;
262 UNICODE_STRING TargetPath;
263 } BASE_DEFINE_DOS_DEVICE, *PBASE_DEFINE_DOS_DEVICE;
264
265 typedef struct
266 {
267 HANDLE SectionHandle;
268 ULONG Type;
269 ULONG LocaleId;
270 } BASE_NLS_CREATE_SECTION, *PBASE_NLS_CREATE_SECTION;
271
272 typedef struct
273 {
274 PVOID /*PNLS_USER_INFO*/ NlsUserInfo;
275 ULONG Size;
276 } BASE_NLS_GET_USER_INFO, *PBASE_NLS_GET_USER_INFO;
277
278 typedef struct _BASE_API_MESSAGE
279 {
280 PORT_MESSAGE Header;
281
282 PCSR_CAPTURE_BUFFER CsrCaptureData;
283 CSR_API_NUMBER ApiNumber;
284 NTSTATUS Status;
285 ULONG Reserved;
286 union
287 {
288 BASE_CREATE_PROCESS CreateProcessRequest;
289 BASE_CREATE_THREAD CreateThreadRequest;
290 BASE_GET_TEMP_FILE GetTempFileRequest;
291 BASE_EXIT_PROCESS ExitProcessRequest;
292 BASE_CHECK_VDM CheckVDMRequest;
293 BASE_UPDATE_VDM_ENTRY UpdateVDMEntryRequest;
294 BASE_GET_NEXT_VDM_COMMAND GetNextVDMCommandRequest;
295 BASE_EXIT_VDM ExitVDMRequest;
296 BASE_IS_FIRST_VDM IsFirstVDMRequest;
297 BASE_GET_VDM_EXIT_CODE GetVDMExitCodeRequest;
298 BASE_SET_REENTER_COUNT SetReenterCountRequest;
299 BASE_GETSET_PROCESS_SHUTDOWN_PARAMS ShutdownParametersRequest;
300 BASE_GETSET_VDM_CURDIRS VDMCurrentDirsRequest;
301 BASE_BAT_NOTIFICATION BatNotificationRequest;
302 BASE_REGISTER_WOWEXEC RegisterWowExecRequest;
303 BASE_SOUND_SENTRY SoundSentryRequest;
304 BASE_REFRESH_INIFILE_MAPPING RefreshIniFileMappingRequest;
305 BASE_DEFINE_DOS_DEVICE DefineDosDeviceRequest;
306 BASE_NLS_CREATE_SECTION NlsCreateSection;
307 BASE_NLS_GET_USER_INFO NlsGetUserInfo;
308 } Data;
309 } BASE_API_MESSAGE, *PBASE_API_MESSAGE;
310
311 // Check that a BASE_API_MESSAGE can hold in a CSR_API_MESSAGE.
312 CHECK_API_MSG_SIZE(BASE_API_MESSAGE);
313
314 #endif // _BASEMSG_H
315
316 /* EOF */