Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

434 lines
14 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. basemsg.h
  5. Abstract:
  6. This include file defines the message formats used to communicate
  7. between the client and server portions of the BASE portion of the
  8. Windows subsystem.
  9. Author:
  10. Steve Wood (stevewo) 25-Oct-1990
  11. Revision History:
  12. --*/
  13. #ifndef _WINDOWS_BASEMSG_
  14. #define _WINDOWS_BASEMSG_
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif
  18. //
  19. // Message format for messages sent from the client to the server
  20. //
  21. typedef enum _BASESRV_API_NUMBER {
  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. BasepNlsCreateSection,
  39. BasepSetVDMCurDirs,
  40. BasepGetVDMCurDirs,
  41. BasepBatNotification,
  42. BasepRegisterWowExec,
  43. BasepSoundSentryNotification,
  44. BasepRefreshIniFileMapping,
  45. BasepDefineDosDevice,
  46. BasepSetTermsrvAppInstallMode,
  47. BasepNlsUpdateCacheCount,
  48. BasepSetTermsrvClientTimeZone,
  49. BasepSxsCreateActivationContext,
  50. BasepDebugProcessStop,
  51. BasepRegisterThread,
  52. BasepCheckApplicationCompatibility,
  53. BasepNlsGetUserInfo,
  54. BasepMaxApiNumber
  55. } BASESRV_API_NUMBER, *PBASESRV_API_NUMBER;
  56. #ifndef NTOSKRNL_WMI // Don't include this in kernel mode WMI code
  57. typedef struct _BASE_NLS_SET_USER_INFO_MSG {
  58. LCTYPE LCType;
  59. LPWSTR pData;
  60. ULONG DataLength;
  61. } BASE_NLS_SET_USER_INFO_MSG, *PBASE_NLS_SET_USER_INFO_MSG;
  62. typedef struct _BASE_NLS_GET_USER_INFO_MSG {
  63. PNLS_USER_INFO pData;
  64. ULONG DataLength;
  65. } BASE_NLS_GET_USER_INFO_MSG, *PBASE_NLS_GET_USER_INFO_MSG;
  66. typedef struct _BASE_NLS_SET_MULTIPLE_USER_INFO_MSG {
  67. ULONG Flags;
  68. ULONG DataLength;
  69. LPWSTR pPicture;
  70. LPWSTR pSeparator;
  71. LPWSTR pOrder;
  72. LPWSTR pTLZero;
  73. LPWSTR pTimeMarkPosn;
  74. } BASE_NLS_SET_MULTIPLE_USER_INFO_MSG, *PBASE_NLS_SET_MULTIPLE_USER_INFO_MSG;
  75. typedef struct _BASE_NLS_CREATE_SECTION_MSG {
  76. HANDLE hNewSection;
  77. UINT uiType;
  78. LCID Locale;
  79. } BASE_NLS_CREATE_SECTION_MSG, *PBASE_NLS_CREATE_SECTION_MSG;
  80. #define NLS_CREATE_SECTION_UNICODE 1
  81. #define NLS_CREATE_SECTION_LOCALE 2
  82. #define NLS_CREATE_SECTION_CTYPE 3
  83. #define NLS_CREATE_SECTION_SORTKEY 4
  84. #define NLS_CREATE_SECTION_SORTTBLS 5
  85. #define NLS_CREATE_SECTION_DEFAULT_OEMCP 6
  86. #define NLS_CREATE_SECTION_DEFAULT_ACP 7
  87. #define NLS_CREATE_SECTION_LANG_EXCEPT 8
  88. #define NLS_CREATE_SORT_SECTION 9
  89. #define NLS_CREATE_LANG_EXCEPTION_SECTION 10
  90. #define NLS_CREATE_CODEPAGE_SECTION 11
  91. #define NLS_CREATE_SECTION_GEO 12
  92. typedef struct _BASE_NLS_UPDATE_CACHE_COUNT_MSG {
  93. ULONG Reserved;
  94. } BASE_NLS_UPDATE_CACHE_COUNT_MSG, *PBASE_NLS_UPDATE_CACHE_COUNT_MSG;
  95. typedef struct _BASE_SHUTDOWNPARAM_MSG {
  96. ULONG ShutdownLevel;
  97. ULONG ShutdownFlags;
  98. } BASE_SHUTDOWNPARAM_MSG, *PBASE_SHUTDOWNPARAM_MSG;
  99. // NONE must be 0 due to RtlZeroMemory use.
  100. #define BASE_MSG_PATHTYPE_NONE (0)
  101. #define BASE_MSG_PATHTYPE_FILE (1)
  102. #define BASE_MSG_PATHTYPE_URL (2)
  103. #define BASE_MSG_PATHTYPE_OVERRIDE (3)
  104. // NONE must be 0 due to RtlZeroMemory use.
  105. #define BASE_MSG_FILETYPE_NONE (0)
  106. #define BASE_MSG_FILETYPE_XML (1)
  107. #define BASE_MSG_FILETYPE_PRECOMPILED_XML (2)
  108. // NONE must be 0 due to RtlZeroMemory use.
  109. #define BASE_MSG_HANDLETYPE_NONE (0)
  110. #define BASE_MSG_HANDLETYPE_PROCESS (1)
  111. #define BASE_MSG_HANDLETYPE_CLIENT_PROCESS (2)
  112. #define BASE_MSG_HANDLETYPE_SECTION (3)
  113. #define BASE_MSG_SXS_MANIFEST_PRESENT (0x0001)
  114. #define BASE_MSG_SXS_POLICY_PRESENT (0x0002)
  115. #define BASE_MSG_SXS_SYSTEM_DEFAULT_TEXTUAL_ASSEMBLY_IDENTITY_PRESENT (0x0004)
  116. #define BASE_MSG_SXS_TEXTUAL_ASSEMBLY_IDENTITY_PRESENT (0x0008)
  117. #define BASE_MSG_SXS_APP_RUNNING_IN_SAFEMODE (0x0010)
  118. #define SXS_APPCOMPACT_FLAG_APP_RUNNING_SAFEMODE (0x0001)
  119. typedef struct _BASE_MSG_SXS_STREAM {
  120. IN UCHAR FileType;
  121. IN UCHAR PathType;
  122. IN UCHAR HandleType;
  123. IN UNICODE_STRING Path;
  124. IN HANDLE FileHandle;
  125. IN HANDLE Handle;
  126. IN ULONGLONG Offset; // big enough to hold file offsets in the future
  127. IN SIZE_T Size;
  128. } BASE_MSG_SXS_STREAM, *PBASE_MSG_SXS_STREAM;
  129. typedef const BASE_MSG_SXS_STREAM* PCBASE_MSG_SXS_STREAM;
  130. typedef struct _BASE_SXS_CREATEPROCESS_MSG {
  131. IN ULONG Flags;
  132. IN BASE_MSG_SXS_STREAM Manifest;
  133. IN BASE_MSG_SXS_STREAM Policy;
  134. IN UNICODE_STRING AssemblyDirectory;
  135. } BASE_SXS_CREATEPROCESS_MSG, *PBASE_SXS_CREATEPROCESS_MSG;
  136. typedef const BASE_SXS_CREATEPROCESS_MSG* PCBASE_SXS_CREATEPROCESS_MSG;
  137. typedef struct _BASE_CREATEPROCESS_MSG {
  138. HANDLE ProcessHandle;
  139. HANDLE ThreadHandle;
  140. CLIENT_ID ClientId;
  141. ULONG CreationFlags;
  142. ULONG VdmBinaryType;
  143. ULONG VdmTask;
  144. HANDLE hVDM;
  145. BASE_SXS_CREATEPROCESS_MSG Sxs;
  146. ULONGLONG Peb;
  147. ULONG_PTR RealPeb;
  148. USHORT ProcessorArchitecture;
  149. } BASE_CREATEPROCESS_MSG, *PBASE_CREATEPROCESS_MSG;
  150. #endif
  151. typedef struct _BASE_CREATETHREAD_MSG {
  152. HANDLE ThreadHandle;
  153. CLIENT_ID ClientId;
  154. } BASE_CREATETHREAD_MSG, *PBASE_CREATETHREAD_MSG;
  155. #ifndef NTOSKRNL_WMI // Don't include this in kernel mode WMI code
  156. typedef struct _BASE_GETTEMPFILE_MSG {
  157. UINT uUnique;
  158. } BASE_GETTEMPFILE_MSG, *PBASE_GETTEMPFILE_MSG;
  159. typedef struct _BASE_EXITPROCESS_MSG {
  160. UINT uExitCode;
  161. } BASE_EXITPROCESS_MSG, *PBASE_EXITPROCESS_MSG;
  162. typedef struct _BASE_DEBUGPROCESS_MSG {
  163. DWORD dwProcessId;
  164. CLIENT_ID DebuggerClientId;
  165. PVOID AttachCompleteRoutine;
  166. } BASE_DEBUGPROCESS_MSG, *PBASE_DEBUGPROCESS_MSG;
  167. typedef struct _BASE_CHECKVDM_MSG {
  168. ULONG iTask;
  169. HANDLE ConsoleHandle;
  170. ULONG BinaryType;
  171. HANDLE WaitObjectForParent;
  172. HANDLE StdIn;
  173. HANDLE StdOut;
  174. HANDLE StdErr;
  175. ULONG CodePage;
  176. ULONG dwCreationFlags;
  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 CmdLen;
  191. USHORT AppLen;
  192. USHORT PifLen;
  193. USHORT CurDirectoryLen;
  194. USHORT CurDrive;
  195. USHORT VDMState;
  196. PLUID UserLuid;
  197. } BASE_CHECKVDM_MSG, *PBASE_CHECKVDM_MSG;
  198. typedef struct _BASE_UPDATE_VDM_ENTRY_MSG {
  199. ULONG iTask;
  200. ULONG BinaryType;
  201. HANDLE ConsoleHandle;
  202. HANDLE VDMProcessHandle;
  203. HANDLE WaitObjectForParent;
  204. WORD EntryIndex;
  205. WORD VDMCreationState;
  206. } BASE_UPDATE_VDM_ENTRY_MSG, *PBASE_UPDATE_VDM_ENTRY_MSG;
  207. typedef struct _BASE_GET_NEXT_VDM_COMMAND_MSG {
  208. ULONG iTask;
  209. HANDLE ConsoleHandle;
  210. HANDLE WaitObjectForVDM;
  211. HANDLE StdIn;
  212. HANDLE StdOut;
  213. HANDLE StdErr;
  214. ULONG CodePage;
  215. ULONG dwCreationFlags;
  216. ULONG ExitCode;
  217. PCHAR CmdLine;
  218. PCHAR AppName;
  219. PCHAR PifFile;
  220. PCHAR CurDirectory;
  221. PCHAR Env;
  222. ULONG EnvLen;
  223. LPSTARTUPINFOA StartupInfo;
  224. PCHAR Desktop;
  225. ULONG DesktopLen;
  226. PCHAR Title;
  227. ULONG TitleLen;
  228. PCHAR Reserved;
  229. ULONG ReservedLen;
  230. USHORT CurrentDrive;
  231. USHORT CmdLen;
  232. USHORT AppLen;
  233. USHORT PifLen;
  234. USHORT CurDirectoryLen;
  235. USHORT VDMState;
  236. BOOLEAN fComingFromBat;
  237. } BASE_GET_NEXT_VDM_COMMAND_MSG, *PBASE_GET_NEXT_VDM_COMMAND_MSG;
  238. typedef struct _BASE_EXIT_VDM_MSG {
  239. HANDLE ConsoleHandle;
  240. ULONG iWowTask;
  241. HANDLE WaitObjectForVDM;
  242. } BASE_EXIT_VDM_MSG, *PBASE_EXIT_VDM_MSG;
  243. typedef struct _BASE_SET_REENTER_COUNT {
  244. HANDLE ConsoleHandle;
  245. ULONG fIncDec;
  246. } BASE_SET_REENTER_COUNT_MSG, *PBASE_SET_REENTER_COUNT_MSG;
  247. typedef struct _BASE_IS_FIRST_VDM_MSG {
  248. BOOL FirstVDM;
  249. } BASE_IS_FIRST_VDM_MSG, *PBASE_IS_FIRST_VDM_MSG;
  250. typedef struct _BASE_GET_VDM_EXIT_CODE_MSG {
  251. HANDLE ConsoleHandle;
  252. HANDLE hParent;
  253. ULONG ExitCode;
  254. } BASE_GET_VDM_EXIT_CODE_MSG, *PBASE_GET_VDM_EXIT_CODE_MSG;
  255. typedef struct _BASE_GET_SET_VDM_CUR_DIRS_MSG {
  256. HANDLE ConsoleHandle;
  257. PCHAR lpszzCurDirs;
  258. ULONG cchCurDirs;
  259. } BASE_GET_SET_VDM_CUR_DIRS_MSG, *PBASE_GET_SET_VDM_CUR_DIRS_MSG;
  260. typedef struct _BASE_BAT_NOTIFICATION_MSG {
  261. HANDLE ConsoleHandle;
  262. ULONG fBeginEnd;
  263. } BASE_BAT_NOTIFICATION_MSG, *PBASE_BAT_NOTIFICATION_MSG;
  264. typedef struct _BASE_REGISTER_WOWEXEC_MSG {
  265. HANDLE hwndWowExec;
  266. HANDLE ConsoleHandle;
  267. } BASE_REGISTER_WOWEXEC_MSG, *PBASE_REGISTER_WOWEXEC_MSG;
  268. typedef struct _BASE_SOUNDSENTRY_NOTIFICATION_MSG {
  269. ULONG VideoMode;
  270. } BASE_SOUNDSENTRY_NOTIFICATION_MSG, *PBASE_SOUNDSENTRY_NOTIFICATION_MSG;
  271. typedef struct _BASE_REFRESHINIFILEMAPPING_MSG {
  272. UNICODE_STRING IniFileName;
  273. } BASE_REFRESHINIFILEMAPPING_MSG, *PBASE_REFRESHINIFILEMAPPING_MSG;
  274. typedef struct _BASE_DEFINEDOSDEVICE_MSG {
  275. ULONG Flags;
  276. UNICODE_STRING DeviceName;
  277. UNICODE_STRING TargetPath;
  278. } BASE_DEFINEDOSDEVICE_MSG, *PBASE_DEFINEDOSDEVICE_MSG;
  279. typedef struct _BASE_SET_TERMSRVAPPINSTALLMODE {
  280. BOOL bState;
  281. } BASE_SET_TERMSRVAPPINSTALLMODE, *PBASE_SET_TERMSRVAPPINSTALLMODE;
  282. //struct for transferring time zone information
  283. typedef struct _BASE_SET_TERMSRVCLIENTTIMEZONE {
  284. BOOL fFirstChunk; //TRUE if it is first chunk of information
  285. //(StandardX values)
  286. LONG Bias; //current bias
  287. WCHAR Name[32];//StandardName or DaylightName
  288. SYSTEMTIME Date;//StandardDate or DaylightDate
  289. LONG Bias1; //StandardBias or DaylightBias
  290. KSYSTEM_TIME RealBias; //current bias which is used in GetLocalTime etc.
  291. ULONG TimeZoneId;
  292. } BASE_SET_TERMSRVCLIENTTIMEZONE, *PBASE_SET_TERMSRVCLIENTTIMEZONE;
  293. typedef struct _BASE_SXS_CREATE_ACTIVATION_CONTEXT_MSG {
  294. IN ULONG Flags;
  295. IN USHORT ProcessorArchitecture;
  296. IN LANGID LangId;
  297. IN BASE_MSG_SXS_STREAM Manifest;
  298. IN BASE_MSG_SXS_STREAM Policy;
  299. IN UNICODE_STRING AssemblyDirectory;
  300. IN UNICODE_STRING TextualAssemblyIdentity;
  301. //
  302. // Csrss writes a PVOID through this PVOID.
  303. // It assumes the PVOID to write is of native size;
  304. // for a while it was. Now, it often is not, so
  305. // we do some manual marshalling in base\win32\client\csrsxs.c
  306. // to make it right. We leave this as plain PVOID
  307. // instead of say PVOID* (as it was for a while) to
  308. // defeat the wow64 thunk generator.
  309. //
  310. // The thunks can be seen in
  311. // base\wow64\whbase\obj\ia64\whbase.c
  312. //
  313. PVOID ActivationContextData;
  314. } BASE_SXS_CREATE_ACTIVATION_CONTEXT_MSG, *PBASE_SXS_CREATE_ACTIVATION_CONTEXT_MSG;
  315. typedef const BASE_SXS_CREATE_ACTIVATION_CONTEXT_MSG* PCBASE_SXS_CREATE_ACTIVATION_CONTEXT_MSG;
  316. typedef struct _BASE_CHECK_APPLICATION_COMPATIBILITY_MSG {
  317. IN UNICODE_STRING FileName;
  318. IN HANDLE FileHandle;
  319. IN DWORD CacheCookie;
  320. IN USHORT ExeType;
  321. IN PVOID pEnvironment;
  322. IN ULONG EnvironmentSize;
  323. OUT PVOID pAppCompatData;
  324. OUT DWORD cbAppCompatData;
  325. OUT PVOID pSxsData;
  326. OUT DWORD cbSxsData;
  327. OUT BOOL bRunApp;
  328. OUT DWORD FusionFlags;
  329. } BASE_CHECK_APPLICATION_COMPATIBILITY_MSG, *PBASE_CHECK_APPLICATION_COMPATIBILITY_MSG;
  330. #endif
  331. typedef struct _BASE_API_MSG {
  332. PORT_MESSAGE h;
  333. PCSR_CAPTURE_HEADER CaptureBuffer;
  334. CSR_API_NUMBER ApiNumber;
  335. ULONG ReturnValue;
  336. ULONG Reserved;
  337. union {
  338. #ifndef NTOSKRNL_WMI // Don't include this in kernel mode WMI code
  339. BASE_NLS_SET_USER_INFO_MSG NlsSetUserInfo;
  340. BASE_NLS_GET_USER_INFO_MSG NlsGetUserInfo;
  341. BASE_NLS_SET_MULTIPLE_USER_INFO_MSG NlsSetMultipleUserInfo;
  342. BASE_NLS_UPDATE_CACHE_COUNT_MSG NlsCacheUpdateCount;
  343. BASE_NLS_CREATE_SECTION_MSG NlsCreateSection;
  344. BASE_SHUTDOWNPARAM_MSG ShutdownParam;
  345. BASE_CREATEPROCESS_MSG CreateProcess;
  346. #endif
  347. BASE_CREATETHREAD_MSG CreateThread;
  348. #ifndef NTOSKRNL_WMI // Don't include this in kernel mode WMI code
  349. BASE_GETTEMPFILE_MSG GetTempFile;
  350. BASE_EXITPROCESS_MSG ExitProcess;
  351. BASE_DEBUGPROCESS_MSG DebugProcess;
  352. BASE_CHECKVDM_MSG CheckVDM;
  353. BASE_UPDATE_VDM_ENTRY_MSG UpdateVDMEntry;
  354. BASE_GET_NEXT_VDM_COMMAND_MSG GetNextVDMCommand;
  355. BASE_EXIT_VDM_MSG ExitVDM;
  356. BASE_IS_FIRST_VDM_MSG IsFirstVDM;
  357. BASE_GET_VDM_EXIT_CODE_MSG GetVDMExitCode;
  358. BASE_SET_REENTER_COUNT_MSG SetReenterCount;
  359. BASE_GET_SET_VDM_CUR_DIRS_MSG GetSetVDMCurDirs;
  360. BASE_BAT_NOTIFICATION_MSG BatNotification;
  361. BASE_REGISTER_WOWEXEC_MSG RegisterWowExec;
  362. BASE_SOUNDSENTRY_NOTIFICATION_MSG SoundSentryNotification;
  363. BASE_REFRESHINIFILEMAPPING_MSG RefreshIniFileMapping;
  364. BASE_DEFINEDOSDEVICE_MSG DefineDosDeviceApi;
  365. BASE_SET_TERMSRVAPPINSTALLMODE SetTermsrvAppInstallMode;
  366. BASE_SET_TERMSRVCLIENTTIMEZONE SetTermsrvClientTimeZone;
  367. BASE_SXS_CREATE_ACTIVATION_CONTEXT_MSG SxsCreateActivationContext;
  368. BASE_CHECK_APPLICATION_COMPATIBILITY_MSG CheckApplicationCompatibility;
  369. #endif
  370. } u;
  371. } BASE_API_MSG, *PBASE_API_MSG;
  372. #if !defined(SORTPP_PASS) // The Wow64 thunk generation tools don't like this.
  373. C_ASSERT(sizeof(BASE_API_MSG) <= sizeof(CSR_API_MSG));
  374. #endif
  375. #endif //_WINDOWS_BASEMSG_