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.

1465 lines
48 KiB

  1. /*++ BUILD Version: 0002 // Increment this if a change has global effects
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. sxsapi.h
  5. Abstract:
  6. Include file with definitions for calling into the sxs.dll private APIs
  7. Author:
  8. Michael Grier (MGrier) 4-May-2000
  9. Environment:
  10. Revision History:
  11. Jay Krell (JayKrell) November 30, 2001
  12. seperated guids out into sxsapi_guids.h
  13. --*/
  14. #ifndef _SXSAPI_
  15. #define _SXSAPI_
  16. #if (_MSC_VER > 1020)
  17. #pragma once
  18. #endif
  19. //
  20. // bring in IStream / ISequentialStream
  21. //
  22. #if !defined(COM_NO_WINDOWS_H)
  23. #define COM_NO_WINDOWS_H COM_NO_WINDOWS_H
  24. #endif
  25. #pragma push_macro("COM_NO_WINDOWS_H")
  26. #undef COM_NO_WINDOWS_H
  27. #include "objidl.h"
  28. #pragma pop_macro("COM_NO_WINDOWS_H")
  29. // from setupapi.h
  30. typedef PVOID HSPFILEQ;
  31. #include <sxstypes.h>
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35. #define SXS_DLL_NAME_A ( "sxs.dll")
  36. #define SXS_DLL_NAME_W (L"sxs.dll")
  37. #define SXS_DLL_NAME (TEXT( "sxs.dll"))
  38. typedef struct _SXS_XML_DOCUMENT *PSXS_XML_DOCUMENT;
  39. typedef const struct _SXS_XML_DOCUMENT *PCSXS_XML_DOCUMENT;
  40. typedef struct _SXS_XML_STRING *PSXS_XML_STRING;
  41. typedef const struct _SXS_XML_STRING *PCSXS_XML_STRING;
  42. typedef struct _SXS_XML_LOCATION *PSXS_XML_LOCATION;
  43. typedef const struct _SXS_XML_LOCATION *PCSXS_XML_LOCATION;
  44. typedef struct _SXS_XML_NODE *PSXS_XML_NODE;
  45. typedef const struct _SXS_XML_NODE *PCSXS_XML_NODE;
  46. typedef struct _SXS_XML_ATTRIBUTE *PSXS_XML_ATTRIBUTE;
  47. typedef const struct _SXS_XML_ATTRIBUTE *PCSXS_XML_ATTRIBUTE;
  48. typedef struct _SXS_XML_DOCUMENT {
  49. ULONG Flags;
  50. ULONG StringCount;
  51. PCSXS_XML_STRING Strings; // Note that index 0 is reserved to mean "no string" or "no value"
  52. LIST_ENTRY ElementListHead; // conceptually just one element, but PIs also appear in this list
  53. } SXS_XML_DOCUMENT;
  54. // Most will not be null terminated; if they happen to be this flag will be set; this can be used
  55. // to avoid a string copy if you really need them to be null terminated.
  56. #define SXS_XML_STRING_FLAG_NULL_TERMINATED (0x00000001)
  57. #define SXS_XML_STRING_FLAG_INVALID (0x00000002)
  58. typedef struct _SXS_XML_STRING {
  59. ULONG Flags;
  60. ULONG PseudoKey;
  61. ULONG Length; // in bytes
  62. const WCHAR *Buffer; // pointer to first character of non-null-terminated string
  63. } SXS_XML_STRING;
  64. typedef struct _SXS_XML_LOCATION {
  65. ULONG Flags;
  66. ULONG SourceString; // source file name
  67. ULONG BeginningLine;
  68. ULONG BeginningColumn;
  69. ULONG EndingLine;
  70. ULONG EndingColumn;
  71. } SXS_XML_LOCATION;
  72. #define SXS_XML_NODE_TYPE_INVALID (0)
  73. #define SXS_XML_NODE_TYPE_XML_DECL (1)
  74. #define SXS_XML_NODE_TYPE_PI (2)
  75. #define SXS_XML_NODE_TYPE_ELEMENT (3)
  76. #define SXS_XML_NODE_TYPE_PCDATA (4)
  77. #define SXS_XML_NODE_TYPE_CDATA (5)
  78. typedef struct _SXS_XML_NODE_XML_DECL_DATA {
  79. ULONG AttributeCount;
  80. PCSXS_XML_ATTRIBUTE Attributes;
  81. } SXS_XML_NODE_XML_DECL_DATA;
  82. typedef struct _SXS_XML_NODE_ELEMENT_DATA {
  83. ULONG NamespaceString;
  84. ULONG NameString;
  85. ULONG AttributeCount;
  86. PCSXS_XML_ATTRIBUTE Attributes;
  87. LIST_ENTRY ChildListHead;
  88. } SXS_XML_NODE_ELEMENT_DATA;
  89. typedef struct _SXS_XML_NODE {
  90. LIST_ENTRY SiblingLink;
  91. ULONG Flags;
  92. ULONG Type;
  93. PCSXS_XML_NODE Parent;
  94. union {
  95. SXS_XML_NODE_XML_DECL_DATA XMLDecl;
  96. ULONG PIString;
  97. SXS_XML_NODE_ELEMENT_DATA Element;
  98. ULONG PCDataString;
  99. ULONG CDataString;
  100. };
  101. } SXS_XML_NODE;
  102. #define SXS_XML_ATTRIBUTE_FLAG_NAMESPACE_ATTRIBUTE (0x00000001)
  103. typedef struct _SXS_XML_ATTRIBUTE {
  104. ULONG Flags;
  105. ULONG NamespaceString;
  106. ULONG NameString;
  107. ULONG ValueString;
  108. } SXS_XML_ATTRIBUTE;
  109. //
  110. // structs for walking/locating things in the XML parse tree
  111. //
  112. typedef struct _SXS_XML_NAMED_REFERENCE *PSXS_XML_NAMED_REFERENCE;
  113. typedef const struct _SXS_XML_NAMED_REFERENCE *PCSXS_XML_NAMED_REFERENCE;
  114. typedef struct _SXS_XML_NODE_PATH *PSXS_XML_NODE_PATH;
  115. typedef const struct _SXS_XML_NODE_PATH *PCSXS_XML_NODE_PATH;
  116. typedef struct _SXS_XML_NAMED_REFERENCE {
  117. PCWSTR Namespace;
  118. ULONG NamespaceLength; // in bytes
  119. PCWSTR Name;
  120. ULONG NameLength; // in bytes
  121. } SXS_XML_NAMED_REFERENCE;
  122. typedef struct _SXS_XML_NODE_PATH {
  123. ULONG ElementCount;
  124. const PCSXS_XML_NAMED_REFERENCE *Elements;
  125. } SXS_XML_NODE_PATH;
  126. typedef VOID (WINAPI * PSXS_ENUM_XML_NODES_CALLBACK)(
  127. IN PVOID Context,
  128. IN PCSXS_XML_NODE Element,
  129. OUT BOOL *ContinueEnumeration
  130. );
  131. BOOL
  132. WINAPI
  133. SxsEnumXmlNodes(
  134. IN ULONG Flags,
  135. IN PCSXS_XML_DOCUMENT Document,
  136. IN PCSXS_XML_NODE_PATH PathToMatch,
  137. IN PSXS_ENUM_XML_NODES_CALLBACK Callback,
  138. IN PVOID Context
  139. );
  140. #define SXS_INSTALLATION_FILE_COPY_DISPOSITION_FILE_COPIED (1)
  141. #define SXS_INSTALLATION_FILE_COPY_DISPOSITION_FILE_QUEUED (2)
  142. #define SXS_INSTALLATION_FILE_COPY_DISPOSITION_PLEASE_COPY (3)
  143. #define SXS_INSTALLATION_FILE_COPY_DISPOSITION_PLEASE_MOVE (4)
  144. typedef struct _SXS_INSTALLATION_FILE_COPY_CALLBACK_PARAMETERS {
  145. IN DWORD cbSize;
  146. IN PVOID pvContext;
  147. IN DWORD dwFileFlags;
  148. IN PVOID pAlternateSource;
  149. IN PCWSTR pSourceFile;
  150. IN PCWSTR pDestinationFile;
  151. IN ULONGLONG nFileSize;
  152. OUT INT nDisposition;
  153. } SXS_INSTALLATION_FILE_COPY_CALLBACK_PARAMETERS, *PSXS_INSTALLATION_FILE_COPY_CALLBACK_PARAMETERS;
  154. typedef BOOL (WINAPI * PSXS_INSTALLATION_FILE_COPY_CALLBACK)(
  155. PSXS_INSTALLATION_FILE_COPY_CALLBACK_PARAMETERS pParameters
  156. );
  157. //
  158. // If SxsBeginAssemblyInstall() is called with SXS_INSTALL_ASSEMBLY_FILE_COPY_CALLBACK_SETUP_COPY_QUEUE as the
  159. // InstallationCallback parameter, the InstallationContext parameter is assumed to be an
  160. // HSPFILEQ copy queue handle. If SXS_INSTALL_ASSEMBLY_FILE_COPY_CALLBACK_SETUP_COPY_QUEUE_EX,
  161. // the InstallationContext must point to a SXS_INSTALL_ASSEMBLY_SETUP_COPY_QUEUE_EX_PARAMETERS.
  162. //
  163. // This provides an easy mechanism for someone maintaining a copy queue to interact with assembly installation.
  164. //
  165. #define SXS_INSTALLATION_FILE_COPY_CALLBACK_SETUP_COPY_QUEUE ((PSXS_INSTALLATION_FILE_COPY_CALLBACK) 1)
  166. #define SXS_INSTALLATION_FILE_COPY_CALLBACK_SETUP_COPY_QUEUE_EX ((PSXS_INSTALLATION_FILE_COPY_CALLBACK) 2)
  167. //
  168. // Parameters to Setupapi.dll::SetupQueueCopy
  169. //
  170. typedef struct _SXS_INSTALLATION_SETUP_COPY_QUEUE_EX_PARAMETERS {
  171. DWORD cbSize;
  172. HSPFILEQ hSetupCopyQueue; // SetupOpenFileQueue
  173. PCWSTR pszSourceDescription;
  174. DWORD dwCopyStyle;
  175. } SXS_INSTALLATION_SETUP_COPY_QUEUE_EX_PARAMETERS, *PSXS_INSTALLATION_SETUP_COPY_QUEUE_EX_PARAMETERS;
  176. typedef const SXS_INSTALLATION_SETUP_COPY_QUEUE_EX_PARAMETERS* PCSXS_INSTALLATION_SETUP_COPY_QUEUE_EX_PARAMETERS;
  177. typedef BOOL (WINAPI * PSXS_IMPERSONATION_CALLBACK)(
  178. IN PVOID Context,
  179. IN BOOL Impersonate
  180. );
  181. #define SXS_BEGIN_ASSEMBLY_INSTALL_FLAG_MOVE (0x00000001)
  182. #define SXS_BEGIN_ASSEMBLY_INSTALL_FLAG_FROM_RESOURCE (0x00000002)
  183. #define SXS_BEGIN_ASSEMBLY_INSTALL_FLAG_FROM_DIRECTORY (0x00000004)
  184. #define SXS_BEGIN_ASSEMBLY_INSTALL_FLAG_FROM_DIRECTORY_RECURSIVE (0x00000008)
  185. #define SXS_BEGIN_ASSEMBLY_INSTALL_FLAG_NOT_TRANSACTIONAL (0x00000010)
  186. #define SXS_BEGIN_ASSEMBLY_INSTALL_FLAG_NO_VERIFY (0x00000020)
  187. #define SXS_BEGIN_ASSEMBLY_INSTALL_FLAG_REPLACE_EXISTING (0x00000040)
  188. typedef BOOL (WINAPI * PSXS_BEGIN_ASSEMBLY_INSTALL)(
  189. IN DWORD Flags,
  190. IN PSXS_INSTALLATION_FILE_COPY_CALLBACK InstallationCallback OPTIONAL,
  191. IN PVOID InstallationContext OPTIONAL,
  192. IN PSXS_IMPERSONATION_CALLBACK ImpersonationCallback OPTIONAL,
  193. IN PVOID ImpersonationContext OPTIONAL,
  194. OUT PVOID *InstallCookie
  195. );
  196. #define SXS_BEGIN_ASSEMBLY_INSTALL ("SxsBeginAssemblyInstall")
  197. BOOL
  198. WINAPI
  199. SxsBeginAssemblyInstall(
  200. IN DWORD Flags,
  201. IN PSXS_INSTALLATION_FILE_COPY_CALLBACK InstallationCallback OPTIONAL,
  202. IN PVOID InstallationContext OPTIONAL,
  203. IN PSXS_IMPERSONATION_CALLBACK ImpersonationCallback OPTIONAL,
  204. IN PVOID ImpersonationContext OPTIONAL,
  205. OUT PVOID *InstallCookie
  206. );
  207. #include <initguid.h>
  208. #include "sxsapi_guids.h"
  209. typedef struct tagSXS_INSTALL_REFERENCEW
  210. {
  211. DWORD cbSize;
  212. DWORD dwFlags;
  213. GUID guidScheme;
  214. PCWSTR lpIdentifier;
  215. PCWSTR lpNonCanonicalData;
  216. } SXS_INSTALL_REFERENCEW, *PSXS_INSTALL_REFERENCEW;
  217. typedef const struct tagSXS_INSTALL_REFERENCEW *PCSXS_INSTALL_REFERENCEW;
  218. typedef struct tagSXS_INSTALLW
  219. {
  220. DWORD cbSize;
  221. DWORD dwFlags;
  222. PCWSTR lpManifestPath;
  223. PVOID pvInstallCookie;
  224. PCWSTR lpCodebaseURL;
  225. PCWSTR lpRefreshPrompt;
  226. PCWSTR lpLogFileName;
  227. PCSXS_INSTALL_REFERENCEW lpReference;
  228. } SXS_INSTALLW, *PSXS_INSTALLW;
  229. typedef const struct tagSXS_INSTALLW *PCSXS_INSTALLW;
  230. //
  231. // These flags are distinct from the begin install flags, but
  232. // we're assigning them unique numbers so that flag-reuse errors can
  233. // be caught more easily.
  234. //
  235. #define SXS_INSTALL_FLAG_CODEBASE_URL_VALID (0x00000100)
  236. #define SXS_INSTALL_FLAG_MOVE (0x00000200)
  237. #define SXS_INSTALL_FLAG_FROM_RESOURCE (0x00000400)
  238. #define SXS_INSTALL_FLAG_FROM_DIRECTORY (0x00000800)
  239. #define SXS_INSTALL_FLAG_FROM_DIRECTORY_RECURSIVE (0x00001000)
  240. #define SXS_INSTALL_FLAG_NOT_TRANSACTIONAL (0x00002000)
  241. #define SXS_INSTALL_FLAG_NO_VERIFY (0x00004000)
  242. #define SXS_INSTALL_FLAG_REPLACE_EXISTING (0x00008000)
  243. #define SXS_INSTALL_FLAG_LOG_FILE_NAME_VALID (0x00010000)
  244. #define SXS_INSTALL_FLAG_INSTALLED_BY_DARWIN (0x00020000)
  245. #define SXS_INSTALL_FLAG_INSTALLED_BY_OSSETUP (0x00040000)
  246. #define SXS_INSTALL_FLAG_INSTALL_COOKIE_VALID (0x00080000)
  247. #define SXS_INSTALL_FLAG_REFRESH_PROMPT_VALID (0x00100000)
  248. #define SXS_INSTALL_FLAG_REFERENCE_VALID (0x00200000)
  249. #define SXS_INSTALL_FLAG_REFRESH (0x00400000)
  250. #define SXS_INSTALL_FLAG_INSTALLED_BY_MIGRATION (0x00800000)
  251. #define SXS_INSTALL_FLAG_FROM_CABINET (0x01000000)
  252. typedef BOOL (WINAPI * PSXS_INSTALL_W)(
  253. IN OUT PSXS_INSTALLW lpInstall
  254. );
  255. typedef PSXS_INSTALL_W PSXS_INSTALL_W_ROUTINE;
  256. BOOL
  257. WINAPI
  258. SxsInstallW(
  259. IN OUT PSXS_INSTALLW lpInstall
  260. );
  261. #define SXS_INSTALL_W ("SxsInstallW")
  262. //
  263. // If you've specified SXS_INSTALL_ASSEMBLY_FLAG_INCLUDE_CODEBASE, you must pass
  264. // a PSXS_INSTALL_SOURCE_INFO in the Reserved value of SxsInstallAssemblyW.
  265. // This is the definition of that structure.
  266. //
  267. typedef struct _SXS_INSTALL_SOURCE_INFO {
  268. // Size of this structure. Required.
  269. SIZE_T cbSize;
  270. // Any combination of SXSINSTALLSOURCE_*
  271. DWORD dwFlags;
  272. // Codebase to reinstall this assembly from. Can be determined from the
  273. // manifest name that's being installed, but not preferrably.
  274. PCWSTR pcwszCodebaseName;
  275. // What string (localized!) that should be presented to the user during
  276. // recovery to request the media that this assembly came from.
  277. PCWSTR pcwszPromptOnRefresh;
  278. PCWSTR pcwszLogFileName;
  279. } SXS_INSTALL_SOURCE_INFO, *PSXS_INSTALL_SOURCE_INFO;
  280. typedef const struct _SXS_INSTALL_SOURCE_INFO *PCSXS_INSTALL_SOURCE_INFO;
  281. // The SXS_INSTALL_SOURCE_INFO structure has the pcwszCodebase member filled in.
  282. #define SXSINSTALLSOURCE_HAS_CODEBASE ( 0x00000001 )
  283. // The SXS_INSTALL_SOURCE_INFO structure has the pcwszPromptOnRefresh member filled in.
  284. #define SXSINSTALLSOURCE_HAS_PROMPT ( 0x00000002 )
  285. // The assembly has a catalog that must be present and copied over. If missing, then the
  286. // instaler will intuit whether it has a catalog or not.
  287. #define SXSINSTALLSOURCE_HAS_CATALOG ( 0x00000004 )
  288. // This assembly is being installed as part of OS-setup, and so the codebase actually
  289. // contains the source-relative path of the root directory of the assembly source
  290. #define SXSINSTALLSOURCE_INSTALLING_SETUP ( 0x00000008 )
  291. // The installer should not attempt to autodetect whether or not there's a catalog
  292. // associated with this assembly.
  293. #define SXSINSTALLSOURCE_DONT_DETECT_CATALOG ( 0x0000010 )
  294. #define SXSINSTALLSOURCE_CREATE_LOGFILE ( 0x0000020 )
  295. // for WFP recovery usage
  296. #define SXSINSTALLSOURCE_INSTALL_BY_DARWIN ( 0x0000040 )
  297. #define SXSINSTALLSOURCE_INSTALL_BY_OSSETUP ( 0x0000080 )
  298. #define SXSINSTALLSOURCE_INSTALL_BY_MIGRATION (0x0000100 )
  299. //
  300. // These flags are distinct from the begin assembly install flags, but
  301. // we're assigning them unique numbers so that flag-reuse errors can
  302. // be caught more easily.
  303. //
  304. #define SXS_END_ASSEMBLY_INSTALL_FLAG_COMMIT (0x01000000)
  305. #define SXS_END_ASSEMBLY_INSTALL_FLAG_ABORT (0x02000000)
  306. #define SXS_END_ASSEMBLY_INSTALL_FLAG_NO_VERIFY (0x04000000)
  307. #define SXS_END_ASSEMBLY_INSTALL_FLAG_GET_STATUS (0x08000000)
  308. typedef BOOL (WINAPI * PSXS_END_ASSEMBLY_INSTALL)(
  309. IN PVOID InstallCookie,
  310. IN DWORD Flags,
  311. OUT DWORD *Reserved OPTIONAL
  312. );
  313. #define SXS_END_ASSEMBLY_INSTALL ("SxsEndAssemblyInstall")
  314. BOOL
  315. WINAPI
  316. SxsEndAssemblyInstall(
  317. IN PVOID InstallCookie,
  318. IN DWORD Flags,
  319. IN OUT PVOID Reserved OPTIONAL
  320. );
  321. //
  322. // Uninstallation of an assembly
  323. //
  324. typedef struct _tagSXS_UNINSTALLW {
  325. SIZE_T cbSize;
  326. DWORD dwFlags;
  327. LPCWSTR lpAssemblyIdentity;
  328. PCSXS_INSTALL_REFERENCEW lpInstallReference;
  329. LPCWSTR lpInstallLogFile;
  330. } SXS_UNINSTALLW, *PSXS_UNINSTALLW;
  331. typedef const struct _tagSXS_UNINSTALLW *PCSXS_UNINSTALLW;
  332. #define SXS_UNINSTALL_FLAG_REFERENCE_VALID (0x00000001)
  333. #define SXS_UNINSTALL_FLAG_FORCE_DELETE (0x00000002)
  334. #define SXS_UNINSTALL_FLAG_USE_INSTALL_LOG (0x00000004)
  335. #define SXS_UNINSTALL_FLAG_REFERENCE_COMPUTED (0x00000008)
  336. //
  337. // The reference to the assembly was removed
  338. //
  339. #define SXS_UNINSTALL_DISPOSITION_REMOVED_REFERENCE (0x00000001)
  340. //
  341. // The actual assembly was removed because it ran out of references.
  342. //
  343. #define SXS_UNINSTALL_DISPOSITION_REMOVED_ASSEMBLY (0x00000002)
  344. typedef BOOL (WINAPI * PSXS_UNINSTALL_ASSEMBLYW)(
  345. IN PCSXS_UNINSTALLW pcUnInstallData,
  346. OUT DWORD *pdwDisposition
  347. );
  348. typedef PSXS_UNINSTALL_ASSEMBLYW PSXS_UNINSTALL_W_ROUTINE;
  349. #define SXS_UNINSTALL_ASSEMBLYW ("SxsUninstallW")
  350. BOOL
  351. WINAPI
  352. SxsUninstallW(
  353. IN PCSXS_UNINSTALLW pcUnInstallData,
  354. OUT DWORD *pdwDisposition
  355. );
  356. #define SXS_PROBE_ASSEMBLY_INSTALLATION_IDENTITY_PRECOMPOSED (0x00000001)
  357. #define SXS_PROBE_ASSEMBLY_INSTALLATION_DISPOSITION_NOT_INSTALLED (0x00000001)
  358. #define SXS_PROBE_ASSEMBLY_INSTALLATION_DISPOSITION_INSTALLED (0x00000002)
  359. #define SXS_PROBE_ASSEMBLY_INSTALLATION_DISPOSITION_RESIDENT (0x00000004)
  360. typedef BOOL (WINAPI * PSXS_PROBE_ASSEMBLY_INSTALLATION)(
  361. IN DWORD dwFlags,
  362. IN PCWSTR lpIdentity,
  363. OUT DWORD *plpDisposition
  364. );
  365. #define SXS_PROBE_ASSEMBLY_INSTALLATION ("SxsProbeAssemblyInstallation")
  366. BOOL
  367. WINAPI
  368. SxsProbeAssemblyInstallation(
  369. DWORD dwFlags,
  370. PCWSTR lpIdentity,
  371. PDWORD lpDisposition
  372. );
  373. #define SXS_QUERY_MANIFEST_INFORMATION_INFOCLASS_BASIC (1)
  374. #define SXS_QUERY_MANIFEST_INFORMATION_FLAG_SOURCE_IS_DLL (0x00000001)
  375. #define SXS_QUERY_MANIFEST_INFORMATION_INFOCLASS_BASIC_FLAG_OMIT_IDENTITY (0x00000001)
  376. #define SXS_QUERY_MANIFEST_INFORMATION_INFOCLASS_BASIC_FLAG_OMIT_SHORTNAME (0x00000002)
  377. typedef struct _SXS_MANIFEST_INFORMATION_BASIC
  378. {
  379. PCWSTR lpIdentity;
  380. PCWSTR lpShortName;
  381. ULONG ulFileCount;
  382. } SXS_MANIFEST_INFORMATION_BASIC, *PSXS_MANIFEST_INFORMATION_BASIC;
  383. #define SXS_QUERY_MANIFEST_INFORMATION_DLL_SOURCE_FLAG_RESOURCE_TYPE_VALID (0x00000001)
  384. #define SXS_QUERY_MANIFEST_INFORMATION_DLL_SOURCE_FLAG_RESOURCE_LANGUAGE_VALID (0x00000002)
  385. #define SXS_QUERY_MANIFEST_INFORMATION_DLL_SOURCE_FLAG_RESOURCE_ID_VALID (0x00000004)
  386. typedef struct _SXS_MANIFEST_INFORMATION_SOURCE_DLL
  387. {
  388. DWORD dwSize;
  389. DWORD dwFlags;
  390. PCWSTR pcwszDllPath;
  391. PCWSTR pcwszResourceType;
  392. PCWSTR pcwszResourceName;
  393. INT Language;
  394. } SXS_MANIFEST_INFORMATION_SOURCE_DLL, *PSXS_MANIFEST_INFORMATION_SOURCE_DLL;
  395. typedef const struct _SXS_MANIFEST_INFORMATION_SOURCE_DLL *PCSXS_MANIFEST_INFORMATION_SOURCE_DLL;
  396. typedef BOOL (WINAPI * PSXS_QUERY_MANIFEST_INFORMATION)(
  397. IN DWORD dwFlags,
  398. IN PCWSTR pszSource,
  399. IN ULONG ulInfoClass,
  400. IN DWORD dwInfoClassSpecificFlags,
  401. IN SIZE_T cbBuffer,
  402. OUT PVOID lpBuffer,
  403. OUT PSIZE_T cbWrittenOrRequired OPTIONAL
  404. );
  405. BOOL
  406. WINAPI
  407. SxsQueryManifestInformation(
  408. IN DWORD dwFlags,
  409. IN PCWSTR pszSource,
  410. IN ULONG ulInfoClass,
  411. IN DWORD dwInfoClassSpecificFlags,
  412. IN SIZE_T cbBuffer,
  413. OUT PVOID lpBuffer,
  414. OUT PSIZE_T cbWrittenOrRequired OPTIONAL
  415. );
  416. //
  417. // these flags are used for sxs.dll. when ActCtx generation for system default fails, there are two cases we could ignore this error :
  418. // Case 1 : there is no system-default at all
  419. // Case 2 : the dependency of system-default could not be found: this case may happen during the GUImode setup, when system-default is
  420. // installed before GUI assembly is installed
  421. // SXS.dll would pass out these two failure cases using these flags
  422. //
  423. #define BASESRV_SXS_RETURN_RESULT_SYSTEM_DEFAULT_NOT_FOUND (0x0001)
  424. #define BASESRV_SXS_RETURN_RESULT_SYSTEM_DEFAULT_DEPENDENCY_ASSEMBLY_NOT_FOUND (0x0002)
  425. #define SXS_GENERATE_ACTIVATION_CONTEXT_FLAG_SUPPRESS_EVENT_LOG (0x00000001)
  426. #define SXS_GENERATE_ACTIVATION_CONTEXT_FLAG_SYSTEM_DEFAULT_TEXTUAL_ASSEMBLY_IDENTITY (0x00000002)
  427. #define SXS_GENERATE_ACTIVATION_CONTEXT_FLAG_TEXTUAL_ASSEMBLY_IDENTITY (0x00000004)
  428. #define SXS_GENERATE_ACTIVATION_CONTEXT_FLAG_APP_RUNNING_IN_SAFEMODE (0x00000008)
  429. typedef struct _SXS_GENERATE_ACTIVATION_CONTEXT_STREAM
  430. {
  431. IStream* Stream;
  432. //
  433. // This is not necessarily a file system path, just something
  434. // for descriptive/debugging purposes.
  435. //
  436. // Still, when they are file system paths, we try to keep them as Win32 paths instead of Nt paths.
  437. //
  438. PCWSTR Path;
  439. ULONG PathType;
  440. } SXS_GENERATE_ACTIVATION_CONTEXT_STREAM;
  441. typedef struct _SXS_GENERATE_ACTIVATION_CONTEXT_PARAMETERS
  442. {
  443. IN DWORD Flags;
  444. IN USHORT ProcessorArchitecture;
  445. IN LANGID LangId;
  446. IN PCWSTR AssemblyDirectory; // should be a Win32 path
  447. IN PCWSTR TextualAssemblyIdentity;
  448. IN SXS_GENERATE_ACTIVATION_CONTEXT_STREAM Manifest;
  449. IN SXS_GENERATE_ACTIVATION_CONTEXT_STREAM Policy;
  450. OUT DWORD SystemDefaultActCxtGenerationResult; // when generate activation context for system default fails, this mask shows whether it fails for some certain reason which we could ignore the error.
  451. PSXS_IMPERSONATION_CALLBACK ImpersonationCallback;
  452. PVOID ImpersonationContext;
  453. OUT HANDLE SectionObjectHandle;
  454. } SXS_GENERATE_ACTIVATION_CONTEXT_PARAMETERS, *PSXS_GENERATE_ACTIVATION_CONTEXT_PARAMETERS;
  455. typedef const SXS_GENERATE_ACTIVATION_CONTEXT_PARAMETERS* PCSXS_GENERATE_ACTIVATION_CONTEXT_PARAMETERS;
  456. typedef
  457. BOOL
  458. (WINAPI*
  459. PSXS_GENERATE_ACTIVATION_CONTEXT_FUNCTION)(
  460. PSXS_GENERATE_ACTIVATION_CONTEXT_PARAMETERS Parameters
  461. );
  462. BOOL
  463. WINAPI
  464. SxsGenerateActivationContext(
  465. IN OUT PSXS_GENERATE_ACTIVATION_CONTEXT_PARAMETERS Parameters
  466. );
  467. //
  468. // Opaque ASSEMBLY_IDENTITY structure
  469. //
  470. typedef struct _ASSEMBLY_IDENTITY *PASSEMBLY_IDENTITY;
  471. typedef const struct _ASSEMBLY_IDENTITY *PCASSEMBLY_IDENTITY;
  472. //
  473. // The types of assembly identities.
  474. //
  475. // Definitions may not include wildcard attributes; definitions
  476. // match only if they are exactly equal. A wildcard matches
  477. // a definition if for all the non-wildcarded attributes,
  478. // there is an exact match. References may not contain
  479. // wildcarded attributes but may contain a different set of
  480. // attributes than a definition that they match. (Example:
  481. // definitions carry the full public key of the publisher, but
  482. // references usually carry just the "strong name" which is
  483. // the first 8 bytes of the SHA-1 hash of the public key.)
  484. //
  485. #define ASSEMBLY_IDENTITY_TYPE_DEFINITION (1)
  486. #define ASSEMBLY_IDENTITY_TYPE_REFERENCE (2)
  487. #define ASSEMBLY_IDENTITY_TYPE_WILDCARD (3)
  488. #define SXS_ASSEMBLY_MANIFEST_STD_NAMESPACE L"urn:schemas-microsoft-com:asm.v1"
  489. #define SXS_ASSEMBLY_MANIFEST_STD_NAMESPACE_CCH (32)
  490. #define SXS_ASSEMBLY_MANIFEST_STD_ELEMENT_NAME_ASSEMBLY L"assembly"
  491. #define SXS_ASSEMBLY_MANIFEST_STD_ELEMENT_NAME_ASSEMBLY_CCH (8)
  492. #define SXS_ASSEMBLY_MANIFEST_STD_ELEMENT_NAME_ASSEMBLY_IDENTITY L"assemblyIdentity"
  493. #define SXS_ASSEMBLY_MANIFEST_STD_ELEMENT_NAME_ASSEMBLY_IDENTITY_CCH (16)
  494. #define SXS_APPLICATION_CONFIGURATION_MANIFEST_STD_ELEMENT_NAME_CONFIGURATION L"configuration"
  495. #define SXS_APPLICATION_CONFIGURATION_MANIFEST_STD_ELEMENT_NAME_CONFIGURATION_CCH (13)
  496. #define SXS_ASSEMBLY_MANIFEST_STD_ATTRIBUTE_NAME_MANIFEST_VERSION L"manifestVersion"
  497. #define SXS_ASSEMBLY_MANIFEST_STD_ATTRIBUTE_NAME_MANIFEST_VERSION_CCH (15)
  498. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_NAME L"name"
  499. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_NAME_CCH (4)
  500. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_VERSION L"version"
  501. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_VERSION_CCH (7)
  502. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_LANGUAGE L"language"
  503. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_LANGUAGE_CCH (8)
  504. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_PUBLIC_KEY L"publicKey"
  505. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_PUBLIC_KEY_CCH (9)
  506. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_PUBLIC_KEY_TOKEN L"publicKeyToken"
  507. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_PUBLIC_KEY_TOKEN_CCH (14)
  508. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_PROCESSOR_ARCHITECTURE L"processorArchitecture"
  509. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_PROCESSOR_ARCHITECTURE_CCH (21)
  510. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_TYPE L"type"
  511. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_TYPE_CCH (4)
  512. // Pseudo-value used in some places when the language= attribute is missing from the identity.
  513. // An identity that does not have language is implicitly "worldwide".
  514. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_LANGUAGE_MISSING_VALUE L"x-ww"
  515. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_LANGUAGE_MISSING_VALUE_CCH (4)
  516. //
  517. // All win32 assemblies must have "win32" as their type.
  518. //
  519. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_TYPE_VALUE_WIN32 L"win32"
  520. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_TYPE_VALUE_WIN32_CCH (5)
  521. //
  522. // Global flags describing the assembly identity state
  523. //
  524. //
  525. // SXS_ASSEMBLY_IDENTITY_FLAG_FROZEN means that the assembly
  526. // identity's contents are frozen and are not subject to additional
  527. // change.
  528. //
  529. #define ASSEMBLY_IDENTITY_FLAG_FROZEN (0x80000000)
  530. //
  531. // ASSEMBLY_IDENTITY_ATTRIBUTE structure
  532. //
  533. typedef struct _ASSEMBLY_IDENTITY_ATTRIBUTE {
  534. DWORD Flags;
  535. SIZE_T NamespaceCch;
  536. SIZE_T NameCch;
  537. SIZE_T ValueCch;
  538. const WCHAR *Namespace;
  539. const WCHAR *Name;
  540. const WCHAR *Value;
  541. } ASSEMBLY_IDENTITY_ATTRIBUTE, *PASSEMBLY_IDENTITY_ATTRIBUTE;
  542. typedef const struct _ASSEMBLY_IDENTITY_ATTRIBUTE *PCASSEMBLY_IDENTITY_ATTRIBUTE;
  543. typedef enum _ASSEMBLY_IDENTITY_INFORMATION_CLASS {
  544. AssemblyIdentityBasicInformation = 1,
  545. } ASSEMBLY_IDENTITY_INFORMATION_CLASS;
  546. typedef struct _ASSEMBLY_IDENTITY_BASIC_INFORMATION {
  547. DWORD Flags;
  548. ULONG Type;
  549. ULONG Hash;
  550. ULONG AttributeCount;
  551. } ASSEMBLY_IDENTITY_BASIC_INFORMATION, *PASSEMBLY_IDENTITY_BASIC_INFORMATION;
  552. #define SXS_CREATE_ASSEMBLY_IDENTITY_FLAG_FREEZE (0x00000001)
  553. BOOL
  554. WINAPI
  555. SxsCreateAssemblyIdentity(
  556. IN DWORD Flags,
  557. IN ULONG Type,
  558. OUT PASSEMBLY_IDENTITY *AssemblyIdentity,
  559. IN ULONG InitialAttributeCount OPTIONAL,
  560. IN PCASSEMBLY_IDENTITY_ATTRIBUTE const * InitialAttributes OPTIONAL
  561. );
  562. typedef BOOL (WINAPI * PSXS_CREATE_ASSEMBLY_IDENTITY_ROUTINE)(
  563. IN DWORD Flags,
  564. IN ULONG Type,
  565. OUT PASSEMBLY_IDENTITY *AssemblyIdentity,
  566. IN ULONG InitialAttributeCount OPTIONAL,
  567. IN PCASSEMBLY_IDENTITY_ATTRIBUTE const * InitialAttributes OPTIONAL
  568. );
  569. BOOL
  570. WINAPI
  571. SxsHashAssemblyIdentity(
  572. IN DWORD Flags,
  573. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  574. OUT ULONG *Hash
  575. );
  576. typedef BOOL (WINAPI * PSXS_HASH_ASSEMBLY_IDENTITY_ROUTINE)(
  577. IN DWORD Flags,
  578. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  579. OUT ULONG *Hash
  580. );
  581. #define SXS_ARE_ASSEMBLY_IDENTITIES_EQUAL_FLAG_ALLOW_REF_TO_MATCH_DEF (0x00000001)
  582. BOOL
  583. WINAPI
  584. SxsAreAssemblyIdentitiesEqual(
  585. IN DWORD Flags,
  586. IN PCASSEMBLY_IDENTITY AssemblyIdentity1,
  587. IN PCASSEMBLY_IDENTITY AssemlbyIdentity2,
  588. OUT BOOL *Equal
  589. );
  590. typedef BOOL (WINAPI * PSXS_ARE_ASSEMBLY_IDENTITIES_EQUAL_ROUTINE)(
  591. IN DWORD Flags,
  592. IN PCASSEMBLY_IDENTITY AssemblyIdentity1,
  593. IN PCASSEMBLY_IDENTITY AssemblyIdentity2,
  594. OUT BOOL *Equal
  595. );
  596. BOOL
  597. WINAPI
  598. SxsFreezeAssemblyIdentity(
  599. IN DWORD Flags,
  600. IN PASSEMBLY_IDENTITY AssemblyIdentity
  601. );
  602. typedef BOOL (WINAPI *PSXS_FREEZE_ASSEMBLY_IDENTITY_ROUTINE)(
  603. IN DWORD Flags,
  604. IN PASSEMBLY_IDENTITY AssemblyIdentity
  605. );
  606. VOID
  607. WINAPI
  608. SxsDestroyAssemblyIdentity(
  609. IN PASSEMBLY_IDENTITY AssemblyIdentity
  610. );
  611. typedef VOID (WINAPI * PSXS_DESTROY_ASSEMBLY_IDENTITY_ROUTINE)(
  612. IN PASSEMBLY_IDENTITY AssemblyIdentity
  613. );
  614. #define SXS_VALIDATE_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_VALIDATE_NAMESPACE (0x00000001)
  615. #define SXS_VALIDATE_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_VALIDATE_NAME (0x00000002)
  616. #define SXS_VALIDATE_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_VALIDATE_VALUE (0x00000004)
  617. #define SXS_VALIDATE_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_WILDCARDS_PERMITTED (0x00000008)
  618. #define SXS_HASH_ASSEMBLY_IDENTITY_ATTRIBUTES_FLAG_HASH_NAMESPACE (0x00000001)
  619. #define SXS_HASH_ASSEMBLY_IDENTITY_ATTRIBUTES_FLAG_HASH_NAME (0x00000002)
  620. #define SXS_HASH_ASSEMBLY_IDENTITY_ATTRIBUTES_FLAG_HASH_VALUE (0x00000004)
  621. BOOL
  622. WINAPI
  623. SxsValidateAssemblyIdentityAttribute(
  624. IN DWORD Flags,
  625. IN PCASSEMBLY_IDENTITY_ATTRIBUTE Attribute
  626. );
  627. typedef BOOL (WINAPI * PSXS_VALIDATE_ASSEMBLY_IDENTITY_ATTRIBUTES_ROUTINE)(
  628. IN DWORD Flags,
  629. IN PCASSEMBLY_IDENTITY_ATTRIBUTE Attribute
  630. );
  631. BOOL
  632. WINAPI
  633. SxsHashAssemblyIdentityAttribute(
  634. IN DWORD Flags,
  635. IN PCASSEMBLY_IDENTITY_ATTRIBUTE Attribute,
  636. OUT ULONG *HashValue
  637. );
  638. typedef BOOL (WINAPI * PSXS_HASH_ASSEMBLY_IDENTITY_ATTRIBUTE_ROUTINE)(
  639. IN DWORD Flags,
  640. IN PCASSEMBLY_IDENTITY_ATTRIBUTE Attribute,
  641. OUT ULONG *HashValue
  642. );
  643. #define SXS_COMPARE_ASSEMBLY_IDENTITY_ATTRIBUTES_COMPARISON_RESULT_INVALID (0)
  644. #define SXS_COMPARE_ASSEMBLY_IDENTITY_ATTRIBUTES_COMPARISON_RESULT_LESS_THAN (1)
  645. #define SXS_COMPARE_ASSEMBLY_IDENTITY_ATTRIBUTES_COMPARISON_RESULT_EQUAL (2)
  646. #define SXS_COMPARE_ASSEMBLY_IDENTITY_ATTRIBUTES_COMPARISON_RESULT_GREATER_THAN (3)
  647. #define SXS_COMPARE_ASSEMBLY_IDENTITY_ATTRIBUTES_FLAG_COMPARE_NAMESPACE (0x00000001)
  648. #define SXS_COMPARE_ASSEMBLY_IDENTITY_ATTRIBUTES_FLAG_COMPARE_NAME (0x00000002)
  649. #define SXS_COMPARE_ASSEMBLY_IDENTITY_ATTRIBUTES_FLAG_COMPARE_VALUE (0x00000004)
  650. BOOL
  651. WINAPI
  652. SxsCompareAssemblyIdentityAttributes(
  653. IN DWORD Flags,
  654. IN PCASSEMBLY_IDENTITY_ATTRIBUTE Attribute1,
  655. IN PCASSEMBLY_IDENTITY_ATTRIBUTE Attribute2,
  656. OUT ULONG *ComparisonResult
  657. );
  658. typedef BOOL (WINAPI * PSXS_COMPARE_ASSEMBLY_IDENTITY_ATTRIBUTES_ROUTINE)(
  659. IN DWORD Flags,
  660. IN PCASSEMBLY_IDENTITY_ATTRIBUTE Attribute1,
  661. IN PCASSEMBLY_IDENTITY_ATTRIBUTE Attribute2,
  662. OUT ULONG *ComparisonResult
  663. );
  664. #define SXS_INSERT_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_OVERWRITE_EXISTING (0x00000001)
  665. BOOL
  666. WINAPI
  667. SxsInsertAssemblyIdentityAttribute(
  668. IN DWORD Flags,
  669. IN PASSEMBLY_IDENTITY AssemblyIdentity,
  670. IN PCASSEMBLY_IDENTITY_ATTRIBUTE AssemblyIdentityAttribute
  671. );
  672. typedef BOOL (WINAPI * PSXS_INSERT_ASSEMBLY_IDENTITY_ATTRIBUTE_ROUTINE)(
  673. IN DWORD Flags,
  674. IN PASSEMBLY_IDENTITY AssemblyIdentity,
  675. IN PCASSEMBLY_IDENTITY_ATTRIBUTE AssemblyIdentityAttribute
  676. );
  677. BOOL
  678. WINAPI
  679. SxsRemoveAssemblyIdentityAttributesByOrdinal(
  680. IN DWORD Flags,
  681. IN PASSEMBLY_IDENTITY AssemblyIdentity,
  682. IN ULONG AttributeOrdinal,
  683. IN ULONG AttributeCount
  684. );
  685. typedef BOOL (WINAPI * PSXS_REMOVE_ASSEMBLY_IDENTITY_ATTRIBUTES_BY_ORDINAL_ROUTINE)(
  686. IN DWORD Flags,
  687. IN PASSEMBLY_IDENTITY AssemblyIdentity,
  688. IN ULONG AttributeOrdinal,
  689. IN ULONG AttributeCount
  690. );
  691. #define SXS_FIND_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_MATCH_NAMESPACE (0x00000001)
  692. #define SXS_FIND_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_MATCH_NAME (0x00000002)
  693. #define SXS_FIND_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_MATCH_VALUE (0x00000004)
  694. #define SXS_FIND_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_NOT_FOUND_SUCCEEDS (0x00000008)
  695. BOOL
  696. WINAPI
  697. SxsFindAssemblyIdentityAttribute(
  698. IN DWORD Flags,
  699. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  700. IN PCASSEMBLY_IDENTITY_ATTRIBUTE AttributeToMatch,
  701. OUT ULONG *FirstMatchOrdinal OPTIONAL,
  702. OUT ULONG *MatchCount OPTIONAL
  703. );
  704. typedef BOOL (WINAPI * PSXS_FIND_ASSEMBLY_IDENTITY_ATTRIBUTE_ROUTINE)(
  705. IN DWORD Flags,
  706. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  707. IN PCASSEMBLY_IDENTITY_ATTRIBUTE AttributeToMatch,
  708. OUT ULONG *FirstMatchOrdinal OPTIONAL,
  709. OUT ULONG *MatchCount OPTIONAL
  710. );
  711. //
  712. // Rather than making "n" heap allocations, the pattern for SxsGetAssemblyIdentityAttributeByOrdinal()
  713. // is to call once with BufferSize = 0 or some reasonable fixed number to get the size of the
  714. // buffer required, allocate the buffer if the buffer passed in was too small and call again.
  715. //
  716. // The strings returned in the ASSEMBLY_IDENTITY_ATTRIBUTE are *not*
  717. // dynamically allocated, but are instead expected to fit in the buffer passed in.
  718. //
  719. BOOL
  720. WINAPI
  721. SxsGetAssemblyIdentityAttributeByOrdinal(
  722. IN DWORD Flags,
  723. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  724. IN ULONG AttributeOrdinal, // 0-based
  725. IN SIZE_T BufferSize,
  726. OUT PASSEMBLY_IDENTITY_ATTRIBUTE AssemblyIdentityAttributeBuffer,
  727. OUT SIZE_T *BytesWrittenOrRequired
  728. );
  729. typedef BOOL (WINAPI * PSXS_GET_ASSEMBLY_IDENTITY_ATTRIBUTE_BY_ORDINAL_ROUTINE)(
  730. IN DWORD Flags,
  731. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  732. IN ULONG AttributeOrdinal, // 0-based
  733. IN SIZE_T BufferSize,
  734. OUT PASSEMBLY_IDENTITY_ATTRIBUTE AssemblyIdentityAttributeBuffer,
  735. OUT SIZE_T *BytesWrittenOrRequired
  736. );
  737. #define SXS_DUPLICATE_ASSEMBLY_IDENTITY_FLAG_FREEZE (0x00000001)
  738. #define SXS_DUPLICATE_ASSEMBLY_IDENTITY_FLAG_ALLOW_NULL (0x00000002)
  739. BOOL
  740. WINAPI
  741. SxsDuplicateAssemblyIdentity(
  742. IN DWORD Flags,
  743. IN PCASSEMBLY_IDENTITY Source,
  744. OUT PASSEMBLY_IDENTITY *Destination
  745. );
  746. typedef BOOL (WINAPI * PSXS_DUPLICATE_ASSEMBLY_IDENTITY_ROUTINE)(
  747. IN DWORD Flags,
  748. IN PCASSEMBLY_IDENTITY Source,
  749. OUT PASSEMBLY_IDENTITY *Destination
  750. );
  751. BOOL
  752. WINAPI
  753. SxsQueryInformationAssemblyIdentity(
  754. IN DWORD Flags,
  755. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  756. OUT PVOID AssemblyIdentityInformation,
  757. IN SIZE_T AssemblyIdentityInformationLength,
  758. IN ASSEMBLY_IDENTITY_INFORMATION_CLASS AssemblyIdentityInformationClass
  759. );
  760. typedef BOOL (WINAPI * PSXS_QUERY_INFORMATION_ASSEMBLY_IDENTITY_ROUTINE)(
  761. IN DWORD Flags,
  762. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  763. OUT PVOID AssemblyIdentityInformation,
  764. IN SIZE_T AssemblyIdentityInformationLength,
  765. IN ASSEMBLY_IDENTITY_INFORMATION_CLASS AssemblyIdentityInformationClass
  766. );
  767. #define SXS_ENUMERATE_ASSEMBLY_IDENTITY_ATTRIBUTES_FLAG_MATCH_NAMESPACE (0x00000001)
  768. #define SXS_ENUMERATE_ASSEMBLY_IDENTITY_ATTRIBUTES_FLAG_MATCH_NAME (0x00000002)
  769. #define SXS_ENUMERATE_ASSEMBLY_IDENTITY_ATTRIBUTES_FLAG_MATCH_VALUE (0x00000004)
  770. typedef VOID (WINAPI * PSXS_ASSEMBLY_IDENTITY_ATTRIBUTE_ENUMERATION_ROUTINE)(
  771. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  772. IN PCASSEMBLY_IDENTITY_ATTRIBUTE Attribute,
  773. IN PVOID Context
  774. );
  775. BOOL
  776. WINAPI
  777. SxsEnumerateAssemblyIdentityAttributes(
  778. IN DWORD Flags,
  779. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  780. IN PCASSEMBLY_IDENTITY_ATTRIBUTE Attribute OPTIONAL,
  781. IN PSXS_ASSEMBLY_IDENTITY_ATTRIBUTE_ENUMERATION_ROUTINE EnumerationRoutine,
  782. IN PVOID Context
  783. );
  784. typedef BOOL (WINAPI * PSXS_ENUMERATE_ASSEMBLY_IDENTITY_ATTRIBUTES_ROUTINE)(
  785. IN DWORD Flags,
  786. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  787. IN PCASSEMBLY_IDENTITY_ATTRIBUTE Attribute OPTIONAL,
  788. IN PSXS_ASSEMBLY_IDENTITY_ATTRIBUTE_ENUMERATION_ROUTINE EnumerationRoutine,
  789. IN PVOID Context
  790. );
  791. //
  792. // Assembly Identity encoding:
  793. //
  794. // Assembly identities may be encoded in various forms. The two usual ones
  795. // are either a binary stream, suitable for embedding in other data structures
  796. // or for persisting or a textual format that looks like:
  797. //
  798. // name;[ns1,]n1="v1";[ns2,]n2="v2"[;...]
  799. //
  800. #define SXS_ASSEMBLY_IDENTITY_ENCODING_DEFAULTGROUP_BINARY (1)
  801. #define SXS_ASSEMBLY_IDENTITY_ENCODING_DEFAULTGROUP_TEXTUAL (2)
  802. BOOL
  803. SxsComputeAssemblyIdentityEncodedSize(
  804. IN DWORD Flags,
  805. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  806. IN const GUID *EncodingGroup OPTIONAL, // use NULL to use any of the SXS_ASSEMBLY_IDENTITY_ENCODING_DEFAULTGROUP_* encodings
  807. IN ULONG EncodingFormat,
  808. OUT SIZE_T *SizeOut
  809. );
  810. typedef BOOL (WINAPI * PSXS_COMPUTE_ASSEMBLY_IDENTITY_ENCODED_SIZE_ROUTINE)(
  811. IN DWORD Flags,
  812. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  813. IN const GUID *EncodingGroup OPTIONAL, // use NULL to use any of the SXS_ASSEMBLY_IDENTITY_ENCODING_DEFAULTGROUP_* encodings
  814. IN ULONG EncodingFormat,
  815. OUT SIZE_T *SizeOut
  816. );
  817. BOOL
  818. WINAPI
  819. SxsEncodeAssemblyIdentity(
  820. IN DWORD Flags,
  821. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  822. IN const GUID *EncodingGroup OPTIONAL, // use NULL to use any of the SXS_ASSEMBLY_IDENTITY_ENCODING_DEFAULTGROUP_* encodings
  823. IN ULONG EncodingFormat,
  824. IN SIZE_T BufferSize,
  825. OUT PVOID Buffer,
  826. OUT SIZE_T *BytesWrittenOrRequired
  827. );
  828. typedef BOOL (WINAPI * PSXS_ENCODE_ASSEMBLY_IDENTITY_ROUTINE)(
  829. IN DWORD Flags,
  830. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  831. IN const GUID *EncodingGroup OPTIONAL, // use NULL to use any of the SXS_ASSEMBLY_IDENTITY_ENCODING_DEFAULTGROUP_* encodings
  832. IN ULONG EncodingFormat,
  833. IN SIZE_T BufferSize,
  834. OUT PVOID Buffer,
  835. OUT SIZE_T *BytesWrittenOrRequired
  836. );
  837. #define SXS_DECODE_ASSEMBLY_IDENTITY_FLAG_FREEZE (0x00000001)
  838. BOOL
  839. WINAPI
  840. SxsDecodeAssemblyIdentity(
  841. IN ULONG Flags,
  842. IN const GUID *EncodingGroup OPTIONAL, // use NULL to use any of the SXS_ASSEMBLY_IDENTITY_ENCODING_DEFAULTGROUP_* encodings
  843. IN ULONG EncodingFormat,
  844. IN SIZE_T BufferSize,
  845. IN const VOID *Buffer,
  846. OUT PASSEMBLY_IDENTITY *AssemblyIdentity
  847. );
  848. typedef BOOL (WINAPI * PSXS_DECODE_ASSEMBLY_IDENTITY_ROUTINE)(
  849. IN DWORD Flags,
  850. IN const GUID *EncodingGroup OPTIONAL, // use NULL to use any of the SXS_ASSEMBLY_IDENTITY_ENCODING_DEFAULTGROUP_* encodings
  851. IN ULONG EncodingFormat,
  852. IN SIZE_T BufferSize,
  853. IN const VOID *Buffer,
  854. OUT PASSEMBLY_IDENTITY *AssemblyIdentity
  855. );
  856. //
  857. // These are the definitions that SFC requires to interact with SXS.
  858. //
  859. #define SXS_PROTECT_RECURSIVE ( 0x00000001 )
  860. #define SXS_PROTECT_SINGLE_LEVEL ( 0x00000000 )
  861. #define SXS_PROTECT_FILTER_DEFAULT ( FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME | FILE_NOTIFY_CHANGE_ATTRIBUTES | FILE_NOTIFY_CHANGE_SIZE | FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_LAST_ACCESS | FILE_NOTIFY_CHANGE_CREATION | FILE_NOTIFY_CHANGE_SECURITY )
  862. typedef struct _SXS_PROTECT_DIRECTORY {
  863. WCHAR pwszDirectory[MAX_PATH];
  864. PVOID pvCookie;
  865. ULONG ulRecursiveFlag;
  866. ULONG ulNotifyFilter;
  867. } SXS_PROTECT_DIRECTORY, *PSXS_PROTECT_DIRECTORY;
  868. typedef const SXS_PROTECT_DIRECTORY* PCSXS_PROTECT_DIRECTORY;
  869. typedef BOOL ( WINAPI * PSXS_PROTECT_NOTIFICATION )(
  870. PVOID pvCookie,
  871. PCWSTR wsChangeText,
  872. SIZE_T cchChangeText,
  873. DWORD dwChangeAction
  874. );
  875. BOOL
  876. WINAPI
  877. SxsProtectionNotifyW(
  878. PVOID pvCookie,
  879. PCWSTR wsChangeText,
  880. SIZE_T cchChangeText,
  881. DWORD dwChangeAction
  882. );
  883. typedef BOOL ( WINAPI * PSXS_PROTECT_RETRIEVELISTS )(
  884. PCSXS_PROTECT_DIRECTORY *prgpProtectListing,
  885. SIZE_T *pcProtectEntries
  886. );
  887. BOOL
  888. WINAPI
  889. SxsProtectionGatherEntriesW(
  890. PCSXS_PROTECT_DIRECTORY *prgpProtectListing,
  891. SIZE_T *pcProtectEntries
  892. );
  893. //
  894. // This is for both the Logon and the Logoff events
  895. //
  896. typedef BOOL ( WINAPI * PSXS_PROTECT_LOGIN_EVENT )(void);
  897. BOOL
  898. WINAPI
  899. SxsProtectionUserLogonEvent(
  900. void
  901. );
  902. BOOL
  903. WINAPI
  904. SxsProtectionUserLogoffEvent(
  905. void
  906. );
  907. typedef BOOL ( WINAPI * PSXS_PROTECT_SCAN_ONCE )( HWND, BOOL, BOOL );
  908. BOOL
  909. WINAPI
  910. SxsProtectionPerformScanNow(
  911. HWND hwProgressWindow,
  912. BOOL bValidate,
  913. BOOL bUIAllowed
  914. );
  915. #define PFN_NAME_PROTECTION_GATHER_LISTS_W ( "SxsProtectionGatherEntriesW" )
  916. #define PFN_NAME_PROTECTION_NOTIFY_CHANGE_W ( "SxsProtectionNotifyW" )
  917. #define PFN_NAME_PROTECTION_NOTIFY_LOGON ( "SxsProtectionUserLogonEvent" )
  918. #define PFN_NAME_PROTECTION_NOTIFY_LOGOFF ( "SxsProtectionUserLogoffEvent" )
  919. #define PFN_NAME_PROTECTION_SCAN_ONCE ( "SxsProtectionPerformScanNow" )
  920. //
  921. // Settings API
  922. //
  923. //
  924. // These APIs are deliberately designed to look like a subset of the registry
  925. // APIs; their behavior should match the documented registry behavior in general;
  926. // the major missing functionality includes security, the win16 compatibility
  927. // APIs, loading and unloading of keys/hives and change notification.
  928. //
  929. // Settings are strictly local to the process; changes are not visible to other
  930. // processes until the settings are saved.
  931. //
  932. typedef struct _SXS_SETTINGS_KEY *PSXS_SETTINGS_KEY;
  933. typedef const struct _SXS_SETTINGS_KEY *PCSXS_SETTINGS_KEY;
  934. #define SXS_SETTINGS_USERSCOPE_INVALID (0)
  935. #define SXS_SETTINGS_USERSCOPE_PER_USER (1)
  936. #define SXS_SETTINGS_USERSCOPE_SYSTEM_WIDE (2)
  937. #define SXS_SETTINGS_APPSCOPE_INVALID (0)
  938. #define SXS_SETTINGS_APPSCOPE_PER_PROCESS_ROOT (1)
  939. #define SXS_SETTINGS_APPSCOPE_PER_CONTEXT_ROOT (2)
  940. #define SXS_SETTINGS_APPSCOPE_PER_COMPONENT (3)
  941. #define SXS_SETTINGS_ITEMTYPE_INVALID (0)
  942. #define SXS_SETTINGS_ITEMTYPE_KEY (1)
  943. #define SXS_SETTINGS_ITEMTYPE_VALUE (2)
  944. typedef VOID (WINAPI * PSXS_OPEN_SETTINGS_INITIALIZATION_CALLBACK)(
  945. IN PVOID pvContext,
  946. IN PSXS_SETTINGS_KEY lpUninitializedSettingsKey,
  947. OUT BOOL *pfFailed
  948. );
  949. #define SXS_OPEN_SETTINGS_FLAG_RETURN_NULL_IF_NONE (0x00000001)
  950. typedef LONG (WINAPI * PSXS_OPEN_SETTINGS_W)(
  951. IN DWORD dwFlags,
  952. IN ULONG ulUserScope,
  953. IN ULONG ulAppScope,
  954. IN PCWSTR lpAssemblyName,
  955. IN PSXS_OPEN_SETTINGS_INITIALIZATION_CALLBACK lpInitializationCallback OPTIONAL,
  956. IN PVOID pvContext,
  957. OUT PSXS_SETTINGS_KEY *lpKey
  958. );
  959. LONG
  960. WINAPI
  961. SxsOpenSettingsW(
  962. IN DWORD dwFlags,
  963. IN ULONG ulUserScope,
  964. IN ULONG ulAppScope,
  965. IN PCWSTR lpAssemblyName,
  966. IN PSXS_OPEN_SETTINGS_INITIALIZATION_CALLBACK lpInitializationCallback OPTIONAL,
  967. IN PVOID pvContext,
  968. OUT PSXS_SETTINGS_KEY *lpKey
  969. );
  970. #define SXS_MERGE_SETTINGS_KEYDISPOSITION_INVALID (0)
  971. #define SXS_MERGE_SETTINGS_KEYDISPOSITION_COPY_ENTIRE_SUBTREE (1)
  972. #define SXS_MERGE_SETTINGS_KEYDISPOSITION_COPY_KEY_WALK_SUBTREE (2)
  973. typedef VOID (WINAPI * PSXS_MERGE_SETTINGS_KEY_CALLBACKW)(
  974. IN PVOID pvContext,
  975. IN PCWSTR lpKeyPath,
  976. OUT ULONG *lpKeyDisposition
  977. );
  978. #define SXS_MERGE_SETTINGS_VALUEDISPOSITION_INVALID (0)
  979. #define SXS_MERGE_SETTINGS_VALUEDISPOSITION_COPY (1)
  980. #define SXS_MERGE_SETTINGS_VALUEDISPOSITION_DONT_COPY (2)
  981. typedef VOID (WINAPI * PSXS_MERGE_SETTINGS_VALUE_CALLBACKW)(
  982. IN PVOID pvContext,
  983. IN PCWSTR lpKeyPath,
  984. IN LPCWSTR lpValueName,
  985. IN OUT LPDWORD lpType,
  986. IN OUT LPBYTE *lplpData, // pointer to replacable data pointer. Allocate replacements using GlobalAlloc(GPTR, nBytes)
  987. IN DWORD dwDataBufferSize, // for modifying data you can write up to this many bytes
  988. OUT ULONG *lpValueDisposition
  989. );
  990. typedef LONG (WINAPI * PSXS_MERGE_SETTINGS_W)(
  991. IN DWORD dwFlags,
  992. IN PCSXS_SETTINGS_KEY lpKeyToMergeFrom,
  993. IN PSXS_SETTINGS_KEY lpKeyToMergeInTo,
  994. IN PSXS_MERGE_SETTINGS_KEY_CALLBACKW lpKeyCallback,
  995. IN PSXS_MERGE_SETTINGS_VALUE_CALLBACKW lpValueCallback,
  996. LPVOID pvContext
  997. );
  998. LONG
  999. WINAPI
  1000. SxsMergeSettingsW(
  1001. IN DWORD dwFlags,
  1002. IN PCSXS_SETTINGS_KEY lpKeyToMergeFrom,
  1003. IN PSXS_SETTINGS_KEY lpKeyToMergeInTo,
  1004. IN PSXS_MERGE_SETTINGS_KEY_CALLBACKW lpKeyCallback,
  1005. IN PSXS_MERGE_SETTINGS_VALUE_CALLBACKW lpValueCallback,
  1006. LPVOID pvContext
  1007. );
  1008. LONG
  1009. WINAPI
  1010. SxsCloseSettingsKey(
  1011. PSXS_SETTINGS_KEY lpKey
  1012. );
  1013. LONG
  1014. WINAPI
  1015. SxsCreateSettingsKeyExW(
  1016. PSXS_SETTINGS_KEY lpKey,
  1017. LPCWSTR lpSubKey,
  1018. DWORD Reserved,
  1019. LPWSTR lpClass,
  1020. DWORD dwOptions,
  1021. REGSAM samDesired,
  1022. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  1023. PSXS_SETTINGS_KEY *lplpKeyResult,
  1024. LPDWORD lpdwDisposition
  1025. );
  1026. LONG
  1027. WINAPI
  1028. SxsDeleteSettingsKeyW(
  1029. PSXS_SETTINGS_KEY lpKey,
  1030. LPCWSTR lpSubKey
  1031. );
  1032. LONG
  1033. WINAPI
  1034. SxsDeleteSettingsValueW(
  1035. PSXS_SETTINGS_KEY lpKey,
  1036. LPCWSTR lpValueName
  1037. );
  1038. LONG
  1039. WINAPI
  1040. SxsEnumSettingsKeyW(
  1041. IN PSXS_SETTINGS_KEY lpKey,
  1042. DWORD dwIndex,
  1043. LPWSTR lpName,
  1044. DWORD cbName
  1045. );
  1046. LONG
  1047. WINAPI
  1048. SxsEnumSettingsKeyExW(
  1049. IN PSXS_SETTINGS_KEY lpKey,
  1050. IN DWORD dwIndex,
  1051. OUT PWSTR lpName,
  1052. IN OUT LPDWORD lpcName,
  1053. IN OUT LPDWORD lpReserved,
  1054. OUT PWSTR lpClass,
  1055. OUT LPDWORD lpcClass,
  1056. OUT PFILETIME lpftLastWriteTime
  1057. );
  1058. LONG
  1059. WINAPI
  1060. SxsEnumSettingsValueW(
  1061. IN PSXS_SETTINGS_KEY lpKey,
  1062. IN DWORD dwIndex,
  1063. OUT PWSTR lpValueName,
  1064. IN OUT LPDWORD lpcValueName,
  1065. IN OUT LPDWORD lpReserved,
  1066. OUT LPDWORD lpType,
  1067. LPBYTE lpData,
  1068. LPDWORD lpcbData
  1069. );
  1070. LONG
  1071. WINAPI
  1072. SxsFlushSettingsKey(
  1073. IN PSXS_SETTINGS_KEY lpKey
  1074. );
  1075. LONG
  1076. WINAPI
  1077. SxsOpenSettingsKeyEx(
  1078. IN PSXS_SETTINGS_KEY lpKey,
  1079. LPCWSTR lpSubKey,
  1080. DWORD ulOptions,
  1081. REGSAM samDesired,
  1082. PSXS_SETTINGS_KEY *lplpKeyResult
  1083. );
  1084. LONG
  1085. WINAPI
  1086. SxsQuerySettingsInfoKeyW(
  1087. IN PSXS_SETTINGS_KEY lpKey,
  1088. OUT PWSTR lpClass,
  1089. IN OUT LPDWORD lpcClass,
  1090. IN OUT LPDWORD lpReserved,
  1091. OUT LPDWORD lpcSubKeys,
  1092. OUT LPDWORD lpcMaxSubKeyLen,
  1093. OUT LPDWORD lpcMaxClassLen,
  1094. OUT LPDWORD lpcValues,
  1095. OUT LPDWORD lpcMaxValueNameLen,
  1096. OUT LPDWORD lpcMaxValueLen,
  1097. OUT LPDWORD lpcSecurityDescriptor,
  1098. OUT PFILETIME lpftLastWriteTime
  1099. );
  1100. LONG
  1101. WINAPI
  1102. SxsQuerySettingsMultipleValuesW(
  1103. IN PSXS_SETTINGS_KEY lpKey,
  1104. PVALENT val_list,
  1105. DWORD num_vals,
  1106. LPWSTR lpValueBuf,
  1107. LPDWORD lpdwTotsize
  1108. );
  1109. LONG
  1110. WINAPI
  1111. SxsQuerySettingsValueExW(
  1112. IN PSXS_SETTINGS_KEY lpKey,
  1113. IN LPCWSTR lpValueName,
  1114. IN OUT LPDWORD lpReserved,
  1115. OUT LPDWORD lpType,
  1116. OUT LPBYTE lpData,
  1117. IN OUT LPDWORD lpcbData
  1118. );
  1119. LONG
  1120. WINAPI
  1121. SxsSetSettingsValueExW(
  1122. IN PSXS_SETTINGS_KEY lpKey,
  1123. LPCWSTR lpValueName,
  1124. DWORD dwReserved,
  1125. DWORD dwType,
  1126. CONST BYTE *lpData,
  1127. DWORD cbData
  1128. );
  1129. typedef struct _SXS_CLR_SURROGATE_INFORMATION {
  1130. DWORD cbSize;
  1131. DWORD dwFlags;
  1132. GUID SurrogateIdent;
  1133. PCWSTR pcwszSurrogateType;
  1134. PCWSTR pcwszImplementingAssembly;
  1135. PCWSTR pcwszRuntimeVersion;
  1136. } SXS_CLR_SURROGATE_INFORMATION, *PSXS_CLR_SURROGATE_INFORMATION;
  1137. typedef const SXS_CLR_SURROGATE_INFORMATION *PCSXS_CLR_SURROGATE_INFORMATION;
  1138. typedef struct _SXS_CLR_CLASS_INFORMATION {
  1139. DWORD dwSize;
  1140. DWORD dwFlags;
  1141. ULONG ulThreadingModel;
  1142. ULONG ulType;
  1143. GUID ReferenceClsid;
  1144. PCWSTR pcwszProgId;
  1145. PCWSTR pcwszImplementingAssembly;
  1146. PCWSTR pcwszTypeName;
  1147. PCWSTR pcwszRuntimeVersion;
  1148. } SXS_CLR_CLASS_INFORMATION, *PSXS_CLR_CLASS_INFORMATION;
  1149. typedef const SXS_CLR_CLASS_INFORMATION *PCSXS_CLR_CLASS_INFORMATION;
  1150. #define SXS_FIND_CLR_SURROGATE_USE_ACTCTX (0x00000001)
  1151. #define SXS_FIND_CLR_SURROGATE_GET_IDENTITY (0x00000002)
  1152. #define SXS_FIND_CLR_SURROGATE_GET_RUNTIME_VERSION (0x00000004)
  1153. #define SXS_FIND_CLR_SURROGATE_GET_TYPE_NAME (0x00000008)
  1154. #define SXS_FIND_CLR_SURROGATE_GET_ALL (SXS_FIND_CLR_SURROGATE_GET_IDENTITY | SXS_FIND_CLR_SURROGATE_GET_RUNTIME_VERSION | SXS_FIND_CLR_SURROGATE_GET_TYPE_NAME)
  1155. #define SXS_FIND_CLR_SURROGATE_INFO ("SxsFindClrSurrogateInformation")
  1156. typedef BOOL (WINAPI* PFN_SXS_FIND_CLR_SURROGATE_INFO)(
  1157. IN DWORD dwFlags,
  1158. IN LPGUID lpGuidToFind,
  1159. IN HANDLE hActivationContext,
  1160. IN OUT PVOID pvDataBuffer,
  1161. IN SIZE_T cbDataBuffer,
  1162. IN OUT PSIZE_T pcbDataBufferWrittenOrRequired
  1163. );
  1164. // The 'pvSearchData' parameter is really a progid to look up
  1165. #define SXS_FIND_CLR_CLASS_SEARCH_PROGID (0x00000001)
  1166. // The 'pvSearchData' is an LPGUID to look up
  1167. #define SXS_FIND_CLR_CLASS_SEARCH_GUID (0x00000002)
  1168. // Activate the given actctx before looking up information in it
  1169. #define SXS_FIND_CLR_CLASS_ACTIVATE_ACTCTX (0x00000004)
  1170. #define SXS_FIND_CLR_CLASS_GET_PROGID (0x00000008)
  1171. #define SXS_FIND_CLR_CLASS_GET_IDENTITY (0x00000010)
  1172. #define SXS_FIND_CLR_CLASS_GET_TYPE_NAME (0x00000020)
  1173. #define SXS_FIND_CLR_CLASS_GET_RUNTIME_VERSION (0x00000040)
  1174. #define SXS_FIND_CLR_CLASS_GET_ALL (SXS_FIND_CLR_CLASS_GET_PROGID | SXS_FIND_CLR_CLASS_GET_IDENTITY | SXS_FIND_CLR_CLASS_GET_TYPE_NAME | SXS_FIND_CLR_CLASS_GET_RUNTIME_VERSION)
  1175. #define SXS_FIND_CLR_CLASS_INFO ("SxsFindClrClassInformation")
  1176. typedef BOOL (WINAPI* PFN_SXS_FIND_CLR_CLASS_INFO)(
  1177. IN DWORD dwFlags,
  1178. IN PVOID pvSearchData,
  1179. IN HANDLE hActivationContext,
  1180. IN OUT PVOID pvDataBuffer,
  1181. IN SIZE_T cbDataBuffer,
  1182. OUT PSIZE_T pcbDataBufferWrittenOrRequired
  1183. );
  1184. #define SXS_GUID_INFORMATION_CLR_FLAG_IS_SURROGATE (0x00000001)
  1185. #define SXS_GUID_INFORMATION_CLR_FLAG_IS_CLASS (0x00000002)
  1186. typedef struct _SXS_GUID_INFORMATION_CLR
  1187. {
  1188. DWORD cbSize;
  1189. DWORD dwFlags;
  1190. PCWSTR pcwszRuntimeVersion;
  1191. PCWSTR pcwszTypeName;
  1192. PCWSTR pcwszAssemblyIdentity;
  1193. } SXS_GUID_INFORMATION_CLR, *PSXS_GUID_INFORMATION_CLR;
  1194. typedef const SXS_GUID_INFORMATION_CLR *PCSXS_GUID_INFORMATION_CLR;
  1195. #define SXS_LOOKUP_CLR_GUID_USE_ACTCTX (0x00000001)
  1196. #define SXS_LOOKUP_CLR_GUID_FIND_SURROGATE (0x00010000)
  1197. #define SXS_LOOKUP_CLR_GUID_FIND_CLR_CLASS (0x00020000)
  1198. #define SXS_LOOKUP_CLR_GUID_FIND_ANY (SXS_LOOKUP_CLR_GUID_FIND_CLR_CLASS | SXS_LOOKUP_CLR_GUID_FIND_SURROGATE)
  1199. #define SXS_LOOKUP_CLR_GUID ("SxsLookupClrGuid")
  1200. typedef BOOL (WINAPI* PFN_SXS_LOOKUP_CLR_GUID)(
  1201. IN DWORD dwFlags,
  1202. IN LPGUID pClsid,
  1203. IN HANDLE hActCtx,
  1204. IN OUT PVOID pvOutputBuffer,
  1205. IN SIZE_T cbOutputBuffer,
  1206. OUT PSIZE_T pcbOutputBuffer
  1207. );
  1208. #ifdef __cplusplus
  1209. } /* extern "C" */
  1210. #endif
  1211. #endif /* _SXSAPI_ */