Source code of Windows XP (NT5)
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.

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