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