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.

676 lines
29 KiB

  1. // begin_sxstypes
  2. /*++ BUILD Version: 0005 // Increment this if a change has global effects
  3. Copyright (c) Microsoft Corporation. All rights reserved.
  4. Module Name:
  5. sxstypes.h
  6. Abstract:
  7. Include file with definitions for data structures used for side-by-side
  8. binding.
  9. Author:
  10. Michael Grier (MGrier) 28-Mar-2000
  11. Environment:
  12. Revision History:
  13. --*/
  14. #ifndef _SXSTYPES_
  15. #define _SXSTYPES_
  16. #if (_MSC_VER > 1020)
  17. #pragma once
  18. #endif
  19. #if defined(__cplusplus)
  20. extern "C" {
  21. #endif
  22. typedef struct _ACTIVATION_CONTEXT_DATA ACTIVATION_CONTEXT_DATA;
  23. typedef const ACTIVATION_CONTEXT_DATA *PCACTIVATION_CONTEXT_DATA;
  24. //
  25. // These data structures have to line up in a number of different run-time
  26. // environments, so we explicitly set the alignment.
  27. //
  28. #include "pshpack4.h"
  29. //
  30. // These data structures may be generated by 64bit code and consumed
  31. // in 32bit code, as in the case of 32bit processes on Win64.
  32. // Therefore they have no pointers and no SIZE_Ts.
  33. //
  34. // Besides that, they are created in a different process than they
  35. // are consumed. They are position independent.
  36. //
  37. //
  38. // ASSEMBLY_VERSION represents a traditional four-part version
  39. // as in Major.Minor.Revision.Build.
  40. //
  41. // They are laid out so that you can perform a simple ULONGLONG-
  42. // based comparison on them.
  43. //
  44. // They are interpreted as:
  45. //
  46. // Major.Minor.Build.Revision
  47. //
  48. // So for example you might have "5.1.2505.2" (where 5.1 is the major
  49. // minor, 2505 represents the daily build number and 2 is the number
  50. // of updates to the build since its initial build).
  51. //
  52. // Overloaded comparison operators are provided for C++ clients.
  53. //
  54. #include "pshpack1.h"
  55. typedef union _ASSEMBLY_VERSION {
  56. struct {
  57. USHORT Build;
  58. USHORT Revision;
  59. USHORT Minor;
  60. USHORT Major;
  61. };
  62. ULONGLONG QuadPart;
  63. } ASSEMBLY_VERSION, *PASSEMBLY_VERSION;
  64. #include "poppack.h"
  65. typedef const ASSEMBLY_VERSION *PCASSEMBLY_VERSION;
  66. #if defined(__cplusplus)
  67. extern "C++" {
  68. inline bool operator ==(const ASSEMBLY_VERSION &av1, const ASSEMBLY_VERSION &av2) { return av1.QuadPart == av2.QuadPart; }
  69. inline bool operator !=(const ASSEMBLY_VERSION &av1, const ASSEMBLY_VERSION &av2) { return av1.QuadPart != av2.QuadPart; }
  70. inline bool operator <(const ASSEMBLY_VERSION &av1, const ASSEMBLY_VERSION &av2) { return av1.QuadPart < av2.QuadPart; }
  71. inline bool operator >(const ASSEMBLY_VERSION &av1, const ASSEMBLY_VERSION &av2) { return av1.QuadPart > av2.QuadPart; }
  72. inline bool operator <=(const ASSEMBLY_VERSION &av1, const ASSEMBLY_VERSION &av2) { return av1.QuadPart <= av2.QuadPart; }
  73. inline bool operator >=(const ASSEMBLY_VERSION &av1, const ASSEMBLY_VERSION &av2) { return av1.QuadPart >= av2.QuadPart; }
  74. } /* extern "C++" */
  75. #endif /* __cplusplus */
  76. //
  77. // Standard Activation Context section IDs:
  78. //
  79. // begin_winnt
  80. #if (_WIN32_WINNT > 0x0500) || (_WIN32_FUSION >= 0x0100) || ISOLATION_AWARE_ENABLED // winnt_only
  81. #define ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION (1)
  82. #define ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION (2)
  83. #define ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION (3)
  84. #define ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION (4)
  85. #define ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION (5)
  86. #define ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION (6)
  87. #define ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION (7)
  88. #define ACTIVATION_CONTEXT_SECTION_GLOBAL_OBJECT_RENAME_TABLE (8)
  89. #define ACTIVATION_CONTEXT_SECTION_CLR_SURROGATES (9)
  90. #endif // winnt_only
  91. // end_winnt
  92. //
  93. // Activation Context section format identifiers:
  94. //
  95. #define ACTIVATION_CONTEXT_SECTION_FORMAT_UNKNOWN (0)
  96. #define ACTIVATION_CONTEXT_SECTION_FORMAT_STRING_TABLE (1)
  97. #define ACTIVATION_CONTEXT_SECTION_FORMAT_GUID_TABLE (2)
  98. typedef struct _ACTIVATION_CONTEXT_DATA {
  99. ULONG Magic;
  100. ULONG HeaderSize;
  101. ULONG FormatVersion;
  102. ULONG TotalSize;
  103. ULONG DefaultTocOffset;
  104. ULONG ExtendedTocOffset;
  105. ULONG AssemblyRosterOffset;
  106. ULONG Flags;
  107. } ACTIVATION_CONTEXT_DATA, *PACTIVATION_CONTEXT_DATA;
  108. typedef const ACTIVATION_CONTEXT_DATA *PCACTIVATION_CONTEXT_DATA;
  109. #define ACTIVATION_CONTEXT_DATA_MAGIC ((ULONG) 'xtcA')
  110. #define ACTIVATION_CONTEXT_DATA_FORMAT_WHISTLER (1)
  111. // Internally this is associated with the data, but externally
  112. // the data is usually opaque and it is associated with the activation context.
  113. #define ACTIVATION_CONTEXT_FLAG_NO_INHERIT (0x00000001)
  114. typedef struct _ACTIVATION_CONTEXT_DATA_TOC_HEADER {
  115. ULONG HeaderSize;
  116. ULONG EntryCount;
  117. ULONG FirstEntryOffset;
  118. ULONG Flags;
  119. } ACTIVATION_CONTEXT_DATA_TOC_HEADER, *PACTIVATION_CONTEXT_DATA_TOC_HEADER;
  120. typedef const struct _ACTIVATION_CONTEXT_DATA_TOC_HEADER *PCACTIVATION_CONTEXT_DATA_TOC_HEADER;
  121. #define ACTIVATION_CONTEXT_DATA_TOC_HEADER_DENSE (0x00000001)
  122. #define ACTIVATION_CONTEXT_DATA_TOC_HEADER_INORDER (0x00000002)
  123. typedef struct _ACTIVATION_CONTEXT_DATA_TOC_ENTRY {
  124. ULONG Id;
  125. ULONG Offset; // from ACTIVATION_CONTEXT_DATA base
  126. ULONG Length; // in bytes
  127. ULONG Format; // ACTIVATION_CONTEXT_SECTION_FORMAT_*
  128. } ACTIVATION_CONTEXT_DATA_TOC_ENTRY, *PACTIVATION_CONTEXT_DATA_TOC_ENTRY;
  129. typedef const struct _ACTIVATION_CONTEXT_DATA_TOC_ENTRY *PCACTIVATION_CONTEXT_DATA_TOC_ENTRY;
  130. typedef struct _ACTIVATION_CONTEXT_DATA_EXTENDED_TOC_HEADER {
  131. ULONG HeaderSize;
  132. ULONG EntryCount;
  133. ULONG FirstEntryOffset; // from ACTIVATION_CONTEXT_DATA base
  134. ULONG Flags;
  135. } ACTIVATION_CONTEXT_DATA_EXTENDED_TOC_HEADER, *PACTIVATION_CONTEXT_DATA_EXTENDED_TOC_HEADER;
  136. typedef const struct _ACTIVATION_CONTEXT_DATA_EXTENDED_TOC_HEADER *PCACTIVATION_CONTEXT_DATA_EXTENDED_TOC_HEADER;
  137. typedef struct _ACTIVATION_CONTEXT_DATA_EXTENDED_TOC_ENTRY {
  138. GUID ExtensionGuid;
  139. ULONG TocOffset; // from ACTIVATION_CONTEXT_DATA base
  140. ULONG Length;
  141. } ACTIVATION_CONTEXT_DATA_EXTENDED_TOC_ENTRY, *PACTIVATION_CONTEXT_DATA_EXTENDED_TOC_ENTRY;
  142. typedef const struct _ACTIVATION_CONTEXT_DATA_EXTENDED_TOC_ENTRY *PCACTIVATION_CONTEXT_DATA_EXTENDED_TOC_ENTRY;
  143. typedef struct _ACTIVATION_CONTEXT_DATA_ASSEMBLY_ROSTER_HEADER {
  144. ULONG HeaderSize;
  145. ULONG HashAlgorithm;
  146. ULONG EntryCount; // Entry 0 is reserved; this is the number of assemblies plus 1.
  147. ULONG FirstEntryOffset; // From ACTIVATION_CONTEXT_DATA base
  148. ULONG AssemblyInformationSectionOffset; // Offset from the ACTIVATION_CONTEXT_DATA base to the
  149. // header of the assembly information string section. Needed because
  150. // the roster entries contain the offsets from the ACTIVATION_CONTEXT_DATA
  151. // to the assembly information structs, but those structs contain offsets
  152. // from their section base to the strings etc.
  153. } ACTIVATION_CONTEXT_DATA_ASSEMBLY_ROSTER_HEADER, *PACTIVATION_CONTEXT_DATA_ASSEMBLY_ROSTER_HEADER;
  154. typedef const struct _ACTIVATION_CONTEXT_DATA_ASSEMBLY_ROSTER_HEADER *PCACTIVATION_CONTEXT_DATA_ASSEMBLY_ROSTER_HEADER;
  155. #define ACTIVATION_CONTEXT_DATA_ASSEMBLY_ROSTER_ENTRY_INVALID (0x00000001)
  156. #define ACTIVATION_CONTEXT_DATA_ASSEMBLY_ROSTER_ENTRY_ROOT (0x00000002)
  157. typedef struct _ACTIVATION_CONTEXT_DATA_ASSEMBLY_ROSTER_ENTRY {
  158. ULONG Flags;
  159. ULONG PseudoKey; // case-insentively-hashed assembly name
  160. ULONG AssemblyNameOffset; // from ACTIVATION_CONTEXT_DATA base
  161. ULONG AssemblyNameLength; // length in bytes
  162. ULONG AssemblyInformationOffset; // from ACTIVATION_CONTEXT_DATA base to ACTIVATION_CONTEXT_DATA_ASSEMBLY_INFORMATION
  163. ULONG AssemblyInformationLength; // length in bytes
  164. } ACTIVATION_CONTEXT_DATA_ASSEMBLY_ROSTER_ENTRY, *PACTIVATION_CONTEXT_DATA_ASSEMBLY_ROSTER_ENTRY;
  165. typedef const struct _ACTIVATION_CONTEXT_DATA_ASSEMBLY_ROSTER_ENTRY *PCACTIVATION_CONTEXT_DATA_ASSEMBLY_ROSTER_ENTRY;
  166. //
  167. // ActivationContext string sections are organized as follows:
  168. //
  169. // Header
  170. // Hash structure (optional)
  171. // List of subelements
  172. // Variable length data
  173. //
  174. //
  175. // If you don't recognize the FormatVersion, you should still
  176. // be able to navigate to the list of subelements; once there
  177. // you can still do a very fast linear search avoiding many
  178. // string comparisons if the hash algorithms align.
  179. //
  180. // If you can't even use the hash algorithm, you can still do
  181. // string comparisons.
  182. //
  183. typedef struct _ACTIVATION_CONTEXT_STRING_SECTION_HEADER {
  184. ULONG Magic;
  185. ULONG HeaderSize; // in bytes
  186. ULONG FormatVersion;
  187. ULONG DataFormatVersion;
  188. ULONG Flags;
  189. ULONG ElementCount;
  190. ULONG ElementListOffset; // offset from section header
  191. ULONG HashAlgorithm;
  192. ULONG SearchStructureOffset; // offset from section header
  193. ULONG UserDataOffset; // offset from section header
  194. ULONG UserDataSize; // in bytes
  195. } ACTIVATION_CONTEXT_STRING_SECTION_HEADER, *PACTIVATION_CONTEXT_STRING_SECTION_HEADER;
  196. typedef const ACTIVATION_CONTEXT_STRING_SECTION_HEADER *PCACTIVATION_CONTEXT_STRING_SECTION_HEADER;
  197. #define ACTIVATION_CONTEXT_STRING_SECTION_MAGIC ((ULONG) 'dHsS')
  198. #define ACTIVATION_CONTEXT_STRING_SECTION_FORMAT_WHISTLER (1)
  199. #define ACTIVATION_CONTEXT_STRING_SECTION_CASE_INSENSITIVE (0x00000001)
  200. #define ACTIVATION_CONTEXT_STRING_SECTION_ENTRIES_IN_PSEUDOKEY_ORDER (0x00000002)
  201. typedef struct _ACTIVATION_CONTEXT_STRING_SECTION_HASH_TABLE {
  202. ULONG BucketTableEntryCount;
  203. ULONG BucketTableOffset; // offset from section header
  204. } ACTIVATION_CONTEXT_STRING_SECTION_HASH_TABLE, *PACTIVATION_CONTEXT_STRING_SECTION_HASH_TABLE;
  205. typedef const ACTIVATION_CONTEXT_STRING_SECTION_HASH_TABLE *PCACTIVATION_CONTEXT_STRING_SECTION_HASH_TABLE;
  206. typedef struct _ACTIVATION_CONTEXT_STRING_SECTION_HASH_BUCKET {
  207. ULONG ChainCount;
  208. ULONG ChainOffset; // offset from section header
  209. } ACTIVATION_CONTEXT_STRING_SECTION_HASH_BUCKET, *PACTIVATION_CONTEXT_STRING_SECTION_HASH_BUCKET;
  210. typedef const ACTIVATION_CONTEXT_STRING_SECTION_HASH_BUCKET *PCACTIVATION_CONTEXT_STRING_SECTION_HASH_BUCKET;
  211. // The hash table bucket chain is then a list of offsets from the section header to
  212. // the section entries for the chain.
  213. typedef struct _ACTIVATION_CONTEXT_STRING_SECTION_ENTRY {
  214. ULONG PseudoKey;
  215. ULONG KeyOffset; // offset from the section header
  216. ULONG KeyLength; // in bytes
  217. ULONG Offset; // offset from the section header
  218. ULONG Length; // in bytes
  219. ULONG AssemblyRosterIndex; // 1-based index into the assembly roster for the assembly that
  220. // provided this entry. If the entry is not associated with
  221. // an assembly, zero.
  222. } ACTIVATION_CONTEXT_STRING_SECTION_ENTRY, *PACTIVATION_CONTEXT_STRING_SECTION_ENTRY;
  223. typedef const ACTIVATION_CONTEXT_STRING_SECTION_ENTRY *PCACTIVATION_CONTEXT_STRING_SECTION_ENTRY;
  224. //
  225. // ActivationContext GUID sections are organized as follows:
  226. //
  227. // Header
  228. // Hash structure (optional)
  229. // List of subelements
  230. // Variable length data
  231. //
  232. // If you don't recognize the FormatVersion, you should still
  233. // be able to navigate to the list of subelements; once there
  234. // you can still do a very fast linear search avoiding many
  235. // GUID comparisons.
  236. //
  237. typedef struct _ACTIVATION_CONTEXT_GUID_SECTION_HEADER {
  238. ULONG Magic;
  239. ULONG HeaderSize;
  240. ULONG FormatVersion;
  241. ULONG DataFormatVersion;
  242. ULONG Flags;
  243. ULONG ElementCount;
  244. ULONG ElementListOffset; // offset from section header
  245. ULONG SearchStructureOffset; // offset from section header
  246. ULONG UserDataOffset; // offset from section header
  247. ULONG UserDataSize; // in bytes
  248. } ACTIVATION_CONTEXT_GUID_SECTION_HEADER, *PACTIVATION_CONTEXT_GUID_SECTION_HEADER;
  249. typedef const ACTIVATION_CONTEXT_GUID_SECTION_HEADER *PCACTIVATION_CONTEXT_GUID_SECTION_HEADER;
  250. #define ACTIVATION_CONTEXT_GUID_SECTION_MAGIC ((ULONG) 'dHsG')
  251. #define ACTIVATION_CONTEXT_GUID_SECTION_FORMAT_WHISTLER (1)
  252. #define ACTIVATION_CONTEXT_GUID_SECTION_ENTRIES_IN_ORDER (0x00000001)
  253. typedef struct _ACTIVATION_CONTEXT_GUID_SECTION_HASH_TABLE {
  254. ULONG BucketTableEntryCount;
  255. ULONG BucketTableOffset; // offset from section header
  256. } ACTIVATION_CONTEXT_GUID_SECTION_HASH_TABLE, *PACTIVATION_CONTEXT_GUID_SECTION_HASH_TABLE;
  257. typedef const ACTIVATION_CONTEXT_GUID_SECTION_HASH_TABLE *PCACTIVATION_CONTEXT_GUID_SECTION_HASH_TABLE;
  258. typedef struct _ACTIVATION_CONTEXT_GUID_SECTION_HASH_BUCKET {
  259. ULONG ChainCount;
  260. ULONG ChainOffset; // offset from section header
  261. } ACTIVATION_CONTEXT_GUID_SECTION_HASH_BUCKET, *PACTIVATION_CONTEXT_GUID_SECTION_HASH_BUCKET;
  262. typedef const ACTIVATION_CONTEXT_GUID_SECTION_HASH_BUCKET *PCACTIVATION_CONTEXT_GUID_SECTION_HASH_BUCKET;
  263. // The hash table bucket chain is then a list of offsets from the section header to
  264. // the section entries for the chain.
  265. typedef struct _ACTIVATION_CONTEXT_GUID_SECTION_ENTRY {
  266. GUID Guid;
  267. ULONG Offset; // offset from the section header
  268. ULONG Length; // in bytes
  269. ULONG AssemblyRosterIndex; // 1-based index into the assembly roster for the assembly that
  270. // provided this entry. If the entry is not associated with
  271. // an assembly, zero.
  272. } ACTIVATION_CONTEXT_GUID_SECTION_ENTRY, *PACTIVATION_CONTEXT_GUID_SECTION_ENTRY;
  273. typedef const ACTIVATION_CONTEXT_GUID_SECTION_ENTRY *PCACTIVATION_CONTEXT_GUID_SECTION_ENTRY;
  274. //
  275. // Data structures for the assembly information section (NULL Extension GUID, ACTIVATION_CONTEXT_SECTION_ASSEMBLY_INFORMATION)
  276. //
  277. typedef struct _ACTIVATION_CONTEXT_DATA_ASSEMBLY_GLOBAL_INFORMATION {
  278. ULONG Size;
  279. ULONG Flags;
  280. GUID PolicyCoherencyGuid;
  281. GUID PolicyOverrideGuid;
  282. ULONG ApplicationDirectoryPathType;
  283. ULONG ApplicationDirectoryLength;
  284. ULONG ApplicationDirectoryOffset; // Offset from base of ACTIVATION_CONTEXT_DATA_ASSEMBLY_GLOBAL_INFORMATION
  285. } ACTIVATION_CONTEXT_DATA_ASSEMBLY_GLOBAL_INFORMATION, *PACTIVATION_CONTEXT_DATA_ASSEMBLY_GLOBAL_INFORMATION;
  286. typedef const ACTIVATION_CONTEXT_DATA_ASSEMBLY_GLOBAL_INFORMATION *PCACTIVATION_CONTEXT_DATA_ASSEMBLY_GLOBAL_INFORMATION;
  287. //
  288. // Leaf node structure for the assembly information section
  289. //
  290. #define ACTIVATION_CONTEXT_DATA_ASSEMBLY_INFORMATION_FORMAT_WHISTLER (1)
  291. //
  292. // Bitflags for the Flags member of an assembly information section element.
  293. //
  294. #define ACTIVATION_CONTEXT_DATA_ASSEMBLY_INFORMATION_ROOT_ASSEMBLY (0x00000001)
  295. #define ACTIVATION_CONTEXT_DATA_ASSEMBLY_INFORMATION_POLICY_APPLIED (0x00000002)
  296. #define ACTIVATION_CONTEXT_DATA_ASSEMBLY_INFORMATION_ASSEMBLY_POLICY_APPLIED (0x00000004)
  297. #define ACTIVATION_CONTEXT_DATA_ASSEMBLY_INFORMATION_ROOT_POLICY_APPLIED (0x00000008)
  298. #define ACTIVATION_CONTEXT_DATA_ASSEMBLY_INFORMATION_PRIVATE_ASSEMBLY (0x00000010)
  299. // ACTIVATION_CONTEXT_PATH_TYPE_NONE is used when
  300. // a manifest has no stored location or identity, such as when a manifest is found
  301. // in the app compat database. The client is free to specify a manifest path
  302. // string which should assist in diagnosing where the manifest came from, but
  303. // cannot be assumed to have any particular format or syntax.
  304. typedef struct _ACTIVATION_CONTEXT_DATA_ASSEMBLY_INFORMATION {
  305. ULONG Size; // size of this structure, in bytes
  306. ULONG Flags;
  307. ULONG EncodedAssemblyIdentityLength; // in bytes
  308. ULONG EncodedAssemblyIdentityOffset; // offset from section header base
  309. ULONG ManifestPathType;
  310. ULONG ManifestPathLength; // in bytes
  311. ULONG ManifestPathOffset; // offset from section header base
  312. LARGE_INTEGER ManifestLastWriteTime;
  313. ULONG PolicyPathType;
  314. ULONG PolicyPathLength; // in bytes
  315. ULONG PolicyPathOffset; // offset from section header base
  316. LARGE_INTEGER PolicyLastWriteTime;
  317. ULONG MetadataSatelliteRosterIndex;
  318. ULONG Unused2;
  319. ULONG ManifestVersionMajor;
  320. ULONG ManifestVersionMinor;
  321. ULONG PolicyVersionMajor;
  322. ULONG PolicyVersionMinor;
  323. ULONG AssemblyDirectoryNameLength; // in bytes
  324. ULONG AssemblyDirectoryNameOffset; // from section header base
  325. ULONG NumOfFilesInAssembly;
  326. // 2600 stopped here
  327. ULONG LanguageLength; // in bytes
  328. ULONG LanguageOffset; // from section header base
  329. } ACTIVATION_CONTEXT_DATA_ASSEMBLY_INFORMATION, *PACTIVATION_CONTEXT_DATA_ASSEMBLY_INFORMATION;
  330. typedef const ACTIVATION_CONTEXT_DATA_ASSEMBLY_INFORMATION *PCACTIVATION_CONTEXT_DATA_ASSEMBLY_INFORMATION;
  331. //
  332. // Leaf node structure for the dll redirection section (NULL Extension GUID, ACTIVATION_CONTEXT_SECTION_DLL_REDIRECTION)
  333. //
  334. #define ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION_FORMAT_WHISTLER (1)
  335. //
  336. // ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION Flags:
  337. //
  338. // ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION_PATH_INCLUDES_BASE_NAME
  339. //
  340. // Provides for a redirection that remaps not just the path but the actual
  341. // base name of the file to access.
  342. //
  343. // Not used in any current Whistler scenarios.
  344. //
  345. // ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION_PATH_OMITS_ASSEMBLY_ROOT
  346. //
  347. // Provides for a redirection where the actual storage path of the file
  348. // must be determined at runtime by via the assembly roster. This allows
  349. // for a cached activation context to remain valid across when an assembly
  350. // is relocated across storage volumes.
  351. //
  352. // ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION_PATH_EXPAND
  353. //
  354. // The path must be constructed by appending all the segments and then
  355. // the resultant string must be passed through either the
  356. // RtlExpandEnvironmentStrings() or the Win32 ExpandEnvironmentStrings() APIs.
  357. //
  358. // Used generally only for app compat where a manifest for the executable
  359. // may call out a file which the application may erroneously carry with it
  360. // (possibly on read-only media) to be redirected to, for example,
  361. // "%windir%\system32\"
  362. //
  363. // ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION_PATH_SYSTEM_DEFAULT_REDIRECTED_SYSTEM32_DLL
  364. //
  365. // Provides for dll which exist under system32 as well as system default
  366. // for example, comctl32.dll. There are two entries for this dll in string section
  367. // (1) LoadLibrary("comctl32.dll"), redirected to 5.82 comctl32 under winsxs
  368. // (2) LoadLibrary("c:\windows\system32\comctl32.dll"), is also redirected to 5.82
  369. // comctl32 under winsxs
  370. //
  371. // Note!
  372. //
  373. // You may not have a single entry with both the
  374. // ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION_PATH_OMITS_ASSEMBLY_ROOT and
  375. // ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION_PATH_EXPAND flags set.
  376. //
  377. #define ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION_PATH_INCLUDES_BASE_NAME (0x00000001)
  378. #define ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION_PATH_OMITS_ASSEMBLY_ROOT (0x00000002)
  379. #define ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION_PATH_EXPAND (0x00000004)
  380. #define ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION_PATH_SYSTEM_DEFAULT_REDIRECTED_SYSTEM32_DLL (0x00000008)
  381. typedef struct _ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION {
  382. ULONG Size;
  383. ULONG Flags;
  384. ULONG TotalPathLength; // bytewise length of concatenated segments only
  385. ULONG PathSegmentCount;
  386. ULONG PathSegmentOffset; // offset from section base header so that entries can share
  387. } ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION, *PACTIVATION_CONTEXT_DATA_DLL_REDIRECTION;
  388. typedef const ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION *PCACTIVATION_CONTEXT_DATA_DLL_REDIRECTION;
  389. typedef struct _ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION_PATH_SEGMENT {
  390. ULONG Length; // in bytes
  391. ULONG Offset; // from section header so that individual entries can share
  392. } ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION_PATH_SEGMENT, *PACTIVATION_CONTEXT_DATA_DLL_REDIRECTION_PATH_SEGMENT;
  393. typedef const ACTIVATION_CONTEXT_DATA_DLL_REDIRECTION_PATH_SEGMENT *PCACTIVATION_CONTEXT_DATA_DLL_REDIRECTION_PATH_SEGMENT;
  394. //
  395. // Leaf node structures for window class redirection section (NULL Extension GUID, ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION)
  396. //
  397. #define ACTIVATION_CONTEXT_DATA_WINDOW_CLASS_REDIRECTION_FORMAT_WHISTLER (1)
  398. typedef struct _ACTIVATION_CONTEXT_DATA_WINDOW_CLASS_REDIRECTION {
  399. ULONG Size;
  400. ULONG Flags;
  401. ULONG VersionSpecificClassNameLength; // in bytes
  402. ULONG VersionSpecificClassNameOffset; // Offset from ACTIVATION_CONTEXT_DATA_WINDOW_CLASS_REDIRECTION base
  403. ULONG DllNameLength; // in bytes
  404. ULONG DllNameOffset; // Offset from section base because this can be shared across multiple entries
  405. } ACTIVATION_CONTEXT_DATA_WINDOW_CLASS_REDIRECTION, *PACTIVATION_CONTEXT_DATA_WINDOW_CLASS_REDIRECTION;
  406. typedef const ACTIVATION_CONTEXT_DATA_WINDOW_CLASS_REDIRECTION *PCACTIVATION_CONTEXT_DATA_WINDOW_CLASS_REDIRECTION;
  407. //
  408. // Leaf node structures for COM activation redirection section (NULL Extension GUID, ACTIVATION_CONTEXT_SECTION_COM_SERVER_REDIRECTION)
  409. //
  410. #define ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION_FORMAT_WHISTLER (1)
  411. #define ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION_THREADING_MODEL_INVALID (0)
  412. #define ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION_THREADING_MODEL_APARTMENT (1)
  413. #define ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION_THREADING_MODEL_FREE (2)
  414. #define ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION_THREADING_MODEL_SINGLE (3)
  415. #define ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION_THREADING_MODEL_BOTH (4)
  416. #define ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION_THREADING_MODEL_NEUTRAL (5)
  417. typedef struct _ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION {
  418. ULONG Size;
  419. ULONG Flags;
  420. ULONG ThreadingModel;
  421. GUID ReferenceClsid;
  422. GUID ConfiguredClsid;
  423. GUID ImplementedClsid;
  424. GUID TypeLibraryId;
  425. ULONG ModuleLength; // in bytes
  426. ULONG ModuleOffset; // offset from section base because this can be shared across multiple entries
  427. ULONG ProgIdLength; // in bytes
  428. ULONG ProgIdOffset; // offset from ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION because this is never shared
  429. ULONG ShimDataLength; // in bytes
  430. ULONG ShimDataOffset; // offset from ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION because this is not shared
  431. } ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION, *PACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION;
  432. typedef const ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION *PCACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION;
  433. //
  434. // ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION_SHIM is a struct optionally hung
  435. // off an ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION that describes shimming.
  436. // The common use of a shim is a file that is not a PE that implements
  437. // DllGetClassObject(); instead some other DLL will use the path
  438. // to the file in question plus metadata (typename for managed code and Java)
  439. // to provide a COM object that implements the CLSID. Note that the file may not
  440. // even be a PE for things like scriptlets. Most shims will reference the
  441. // system registry for this metadata; Fusion-aware shims can use the information
  442. // here in the activation context.
  443. //
  444. // The format version of the ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION should
  445. // account for any format changes in the _SHIM struct here.
  446. //
  447. #define ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION_SHIM_TYPE_OTHER (1)
  448. #define ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION_SHIM_TYPE_CLR_CLASS (2)
  449. typedef struct _ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION_SHIM {
  450. ULONG Size;
  451. ULONG Flags;
  452. ULONG Type;
  453. ULONG ModuleLength; // in bytes
  454. ULONG ModuleOffset; // offset from section base
  455. ULONG TypeLength; // in bytes
  456. ULONG TypeOffset; // offset from ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION_SHIM
  457. ULONG ShimVersionLength; // in bytes
  458. ULONG ShimVersionOffset; // offset from ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION_SHIM
  459. ULONG DataLength; // in bytes
  460. ULONG DataOffset; // offset from ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION_SHIM
  461. } ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION_SHIM, *PACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION_SHIM;
  462. typedef const ACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION_SHIM *PCACTIVATION_CONTEXT_DATA_COM_SERVER_REDIRECTION_SHIM;
  463. //
  464. // Leaf node structures for COM interface marshalling redirection section (NULL Extension GUID, ACTIVATION_CONTEXT_SECTION_COM_INTERFACE_REDIRECTION)
  465. //
  466. #define ACTIVATION_CONTEXT_DATA_COM_INTERFACE_REDIRECTION_FORMAT_WHISTLER (1)
  467. #define ACTIVATION_CONTEXT_DATA_COM_INTERFACE_REDIRECTION_FLAG_NUM_METHODS_VALID (0x00000001)
  468. #define ACTIVATION_CONTEXT_DATA_COM_INTERFACE_REDIRECTION_FLAG_BASE_INTERFACE_VALID (0x00000002)
  469. typedef struct _ACTIVATION_CONTEXT_DATA_COM_INTERFACE_REDIRECTION {
  470. ULONG Size;
  471. ULONG Flags;
  472. GUID ProxyStubClsid32;
  473. ULONG NumMethods;
  474. GUID TypeLibraryId;
  475. GUID BaseInterface;
  476. ULONG NameLength; // in bytes
  477. ULONG NameOffset; // offset from ACTIVATION_CONTEXT_DATA_COM_INTERFACE_REDIRECTION because this is not shared
  478. } ACTIVATION_CONTEXT_DATA_COM_INTERFACE_REDIRECTION, *PACTIVATION_CONTEXT_DATA_COM_INTERFACE_REDIRECTION;
  479. typedef const ACTIVATION_CONTEXT_DATA_COM_INTERFACE_REDIRECTION *PCACTIVATION_CONTEXT_DATA_COM_INTERFACE_REDIRECTION;
  480. //
  481. // Leaf node structures for COM type library redirection section (NULL Extension GUID, ACTIVATION_CONTEXT_SECTION_COM_TYPE_LIBRARY_REDIRECTION)
  482. //
  483. //
  484. // CLR interop goop
  485. //
  486. #define ACTIVATION_CONTEXT_DATA_CLR_SURROGATE_FORMAT_WHISTLER (1)
  487. typedef struct _ACTIVATION_CONTEXT_DATA_CLR_SURROGATE {
  488. ULONG Size;
  489. ULONG Flags;
  490. GUID SurrogateIdent;
  491. ULONG VersionOffset; // The version of runtime corresponding to this type
  492. ULONG VersionLength;
  493. ULONG TypeNameOffset; // Name of the type that implements this surrogate
  494. ULONG TypeNameLength;
  495. } ACTIVATION_CONTEXT_DATA_CLR_SURROGATE, *PACTIVATION_CONTEXT_DATA_CLR_SURROGATE;
  496. typedef const struct _ACTIVATION_CONTEXT_DATA_CLR_SURROGATE *PCACTIVATION_CONTEXT_DATA_CLR_SURROGATE;
  497. //
  498. //OLD
  499. //OLD The type library redirection section is keyed off a string composed of the type library GUID,
  500. //OLD the hexidecimal representation of the LCID for the tlb and the version number of the
  501. //OLD type library.
  502. //OLD
  503. //OLD e.g.
  504. //OLD
  505. //OLD "{0ECD9B60-23AA-11D0-B351-00A0C9055D8E}_en-us_6.0"
  506. //OLD
  507. //
  508. // The type library redirection section is keyed off of the type library guid.
  509. //
  510. #define ACTIVATION_CONTEXT_DATA_COM_TYPE_LIBRARY_REDIRECTION_FORMAT_WHISTLER (1)
  511. typedef struct _ACTIVATION_CONTEXT_DATA_TYPE_LIBRARY_VERSION
  512. {
  513. USHORT Major;
  514. USHORT Minor;
  515. } ACTIVATION_CONTEXT_DATA_TYPE_LIBRARY_VERSION, *PACTIVATION_CONTEXT_DATA_TYPE_LIBRARY_VERSION;
  516. typedef const ACTIVATION_CONTEXT_DATA_TYPE_LIBRARY_VERSION* PCACTIVATION_CONTEXT_DATA_TYPE_LIBRARY_VERSION;
  517. typedef struct _ACTIVATION_CONTEXT_DATA_COM_TYPE_LIBRARY_REDIRECTION_2600 {
  518. ULONG Size;
  519. ULONG Flags;
  520. ULONG NameLength; // in bytes
  521. ULONG NameOffset; // offset from section header
  522. USHORT ResourceId; // Resource ID of type library resource in PE
  523. USHORT LibraryFlags; // flags, as defined by the LIBFLAGS enumeration in oaidl.h
  524. ULONG HelpDirLength; // in bytes
  525. ULONG HelpDirOffset; // offset from ACTIVATION_CONTEXT_DATA_COM_TYPE_LIBRARY_REDIRECTION
  526. } ACTIVATION_CONTEXT_DATA_COM_TYPE_LIBRARY_REDIRECTION_2600, *PACTIVATION_CONTEXT_DATA_COM_TYPE_LIBRARY_REDIRECTION_2600;
  527. typedef const ACTIVATION_CONTEXT_DATA_COM_TYPE_LIBRARY_REDIRECTION_2600 *PCACTIVATION_CONTEXT_DATA_COM_TYPE_LIBRARY_REDIRECTION_2600;
  528. typedef struct _ACTIVATION_CONTEXT_DATA_COM_TYPE_LIBRARY_REDIRECTION {
  529. ULONG Size;
  530. ULONG Flags;
  531. ULONG NameLength; // in bytes
  532. ULONG NameOffset; // offset from section header
  533. USHORT ResourceId; // Resource ID of type library resource in PE
  534. USHORT LibraryFlags; // flags, as defined by the LIBFLAGS enumeration in oaidl.h
  535. ULONG HelpDirLength; // in bytes
  536. ULONG HelpDirOffset; // offset from ACTIVATION_CONTEXT_DATA_COM_TYPE_LIBRARY_REDIRECTION
  537. // 2600 stopped here.
  538. ACTIVATION_CONTEXT_DATA_TYPE_LIBRARY_VERSION Version;
  539. } ACTIVATION_CONTEXT_DATA_COM_TYPE_LIBRARY_REDIRECTION, *PACTIVATION_CONTEXT_DATA_COM_TYPE_LIBRARY_REDIRECTION;
  540. typedef const ACTIVATION_CONTEXT_DATA_COM_TYPE_LIBRARY_REDIRECTION *PCACTIVATION_CONTEXT_DATA_COM_TYPE_LIBRARY_REDIRECTION;
  541. //
  542. // Leaf node structures for COM ProgId redirection section (NULL Extension GUID, ACTIVATION_CONTEXT_SECTION_COM_PROGID_REDIRECTION)
  543. //
  544. #define ACTIVATION_CONTEXT_DATA_COM_PROGID_REDIRECTION_FORMAT_WHISTLER (1)
  545. typedef struct _ACTIVATION_CONTEXT_DATA_COM_PROGID_REDIRECTION {
  546. ULONG Size;
  547. ULONG Flags;
  548. ULONG ConfiguredClsidOffset; // offset from section header
  549. } ACTIVATION_CONTEXT_DATA_COM_PROGID_REDIRECTION, *PACTIVATION_CONTEXT_DATA_COM_PROGID_REDIRECTION;
  550. typedef const ACTIVATION_CONTEXT_DATA_COM_PROGID_REDIRECTION *PCACTIVATION_CONTEXT_DATA_COM_PROGID_REDIRECTION;
  551. #include "poppack.h"
  552. #if defined(__cplusplus)
  553. } /* extern "C" */
  554. #endif
  555. #endif /* _SXSTYPES_ */
  556. // end_sxstypes