[CSRSRV/BASESRV/CONSRV/WINSRV]
[reactos.git] / include / reactos / subsys / win / basemsg.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Client/Server Runtime SubSystem
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 NT 4 table, adapted from http://j00ru.vexillium.org/csrss_list/api_list.html#Windows_NT
19 // It is for testing purposes. After that I will update it to 2k3 version and add stubs.
20 typedef enum _BASESRV_API_NUMBER
21 {
22 BasepCreateProcess = BASESRV_FIRST_API_NUMBER,
23 BasepCreateThread,
24 BasepGetTempFile,
25 BasepExitProcess,
26 // BasepDebugProcess,
27 // BasepCheckVDM,
28 // BasepUpdateVDMEntry,
29 // BasepGetNextVDMCommand,
30 // BasepExitVDM,
31 // BasepIsFirstVDM,
32 // BasepGetVDMExitCode,
33 // BasepSetReenterCount,
34 BasepSetProcessShutdownParam,
35 BasepGetProcessShutdownParam,
36 // BasepNlsSetUserInfo,
37 // BasepNlsSetMultipleUserInfo,
38 // BasepNlsCreateSortSection,
39 // BasepNlsPreserveSection,
40 // BasepSetVDMCurDirs,
41 // BasepGetVDMCurDirs,
42 // BasepBatNotification,
43 // BasepRegisterWowExec,
44 BasepSoundSentryNotification,
45 // BasepRefreshIniFileMapping,
46 BasepDefineDosDevice,
47
48 BasepMaxApiNumber
49 } BASESRV_API_NUMBER, *PBASESRV_API_NUMBER;
50
51 typedef struct _BASE_SXS_CREATEPROCESS_MSG
52 {
53 ULONG Flags;
54 ULONG ProcessParameterFlags;
55 HANDLE FileHandle;
56 UNICODE_STRING SxsWin32ExePath;
57 UNICODE_STRING SxsNtExePath;
58 SIZE_T OverrideManifestOffset;
59 ULONG OverrideManifestSize;
60 SIZE_T OverridePolicyOffset;
61 ULONG OverridePolicySize;
62 PVOID PEManifestAddress;
63 ULONG PEManifestSize;
64 UNICODE_STRING CultureFallbacks;
65 ULONG Unknown[7];
66 UNICODE_STRING AssemblyName;
67 } BASE_SXS_CREATEPROCESS_MSG, *PBASE_SXS_CREATEPROCESS_MSG;
68
69 typedef struct
70 {
71 //
72 // NT-type structure (BASE_CREATEPROCESS_MSG)
73 //
74 HANDLE ProcessHandle;
75 HANDLE ThreadHandle;
76 CLIENT_ID ClientId;
77 ULONG CreationFlags;
78 ULONG VdmBinaryType;
79 ULONG VdmTask;
80 HANDLE hVDM;
81 BASE_SXS_CREATEPROCESS_MSG Sxs;
82 PVOID PebAddressNative;
83 ULONG PebAddressWow64;
84 USHORT ProcessorArchitecture;
85
86 //
87 // ReactOS Data
88 //
89 BOOL bInheritHandles;
90 } BASE_CREATE_PROCESS, *PBASE_CREATE_PROCESS;
91
92 typedef struct
93 {
94 CLIENT_ID ClientId;
95 HANDLE ThreadHandle;
96 } BASE_CREATE_THREAD, *PBASE_CREATE_THREAD;
97
98 typedef struct
99 {
100 UINT uExitCode;
101 } BASE_EXIT_PROCESS, *PBASE_EXIT_PROCESS;
102
103 typedef struct
104 {
105 UINT UniqueID;
106 } BASE_GET_TEMP_FILE, *PBASE_GET_TEMP_FILE;
107
108 typedef struct
109 {
110 ULONG iTask;
111 HANDLE ConsoleHandle;
112 ULONG BinaryType;
113 HANDLE WaitObjectForParent;
114 HANDLE StdIn;
115 HANDLE StdOut;
116 HANDLE StdErr;
117 ULONG CodePage;
118 ULONG dwCreationFlags;
119 PCHAR CmdLine;
120 PCHAR appName;
121 PCHAR PifFile;
122 PCHAR CurDirectory;
123 PCHAR Env;
124 ULONG EnvLen;
125 PVOID StartupInfo;
126 PCHAR Desktop;
127 ULONG DesktopLen;
128 PCHAR Title;
129 ULONG TitleLen;
130 PCHAR Reserved;
131 ULONG ReservedLen;
132 USHORT CmdLen;
133 USHORT AppLen;
134 USHORT PifLen;
135 USHORT CurDirectoryLen;
136 USHORT CurDrive;
137 USHORT VDMState;
138 } BASE_CHECK_VDM, *PBASE_CHECK_VDM;
139
140 typedef struct
141 {
142 ULONG iTask;
143 ULONG BinaryType;
144 HANDLE ConsoleHandle;
145 HANDLE VDMProcessHandle;
146 HANDLE WaitObjectForParent;
147 USHORT EntryIndex;
148 USHORT VDMCreationState;
149 } BASE_UPDATE_VDM_ENTRY, *PBASE_UPDATE_VDM_ENTRY;
150
151 typedef struct
152 {
153 HANDLE ConsoleHandle;
154 HANDLE hParent;
155 ULONG ExitCode;
156 } BASE_GET_VDM_EXIT_CODE, *PBASE_GET_VDM_EXIT_CODE;
157
158 typedef struct
159 {
160 DWORD Level;
161 DWORD Flags;
162 } BASE_SET_PROCESS_SHUTDOWN_PARAMS, *PBASE_SET_PROCESS_SHUTDOWN_PARAMS;
163
164 typedef struct
165 {
166 DWORD Level;
167 DWORD Flags;
168 } BASE_GET_PROCESS_SHUTDOWN_PARAMS, *PBASE_GET_PROCESS_SHUTDOWN_PARAMS;
169
170 typedef struct
171 {
172 ULONG VideoMode;
173 } BASE_SOUND_SENTRY, *PBASE_SOUND_SENTRY;
174
175 typedef struct
176 {
177 UNICODE_STRING DeviceName;
178 UNICODE_STRING TargetName;
179 DWORD dwFlags;
180 } BASE_DEFINE_DOS_DEVICE, *PBASE_DEFINE_DOS_DEVICE;
181
182 typedef struct _BASE_API_MESSAGE
183 {
184 PORT_MESSAGE Header;
185
186 PCSR_CAPTURE_BUFFER CsrCaptureData;
187 CSR_API_NUMBER ApiNumber;
188 ULONG Status; // ReturnValue; // NTSTATUS Status
189 ULONG Reserved;
190 union
191 {
192 BASE_CREATE_PROCESS CreateProcessRequest;
193 BASE_CREATE_THREAD CreateThreadRequest;
194 BASE_EXIT_PROCESS ExitProcessRequest;
195 BASE_GET_TEMP_FILE GetTempFile;
196 BASE_CHECK_VDM CheckVdm;
197 BASE_UPDATE_VDM_ENTRY UpdateVdmEntry;
198 BASE_GET_VDM_EXIT_CODE GetVdmExitCode;
199 BASE_SET_PROCESS_SHUTDOWN_PARAMS SetShutdownParametersRequest;
200 BASE_GET_PROCESS_SHUTDOWN_PARAMS GetShutdownParametersRequest;
201 BASE_SOUND_SENTRY SoundSentryRequest;
202 BASE_DEFINE_DOS_DEVICE DefineDosDeviceRequest;
203 } Data;
204 } BASE_API_MESSAGE, *PBASE_API_MESSAGE;
205
206 // Check that a BASE_API_MESSAGE can hold in a CSR_API_MESSAGE.
207 CHECK_API_MSG_SIZE(BASE_API_MESSAGE);
208
209 #endif // _BASEMSG_H
210
211 /* EOF */