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.

187 lines
8.3 KiB

  1. #pragma once
  2. #include <sxstypes.h>
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. //
  7. // Opaque ASSEMBLY_IDENTITY structure
  8. //
  9. typedef struct _ASSEMBLY_IDENTITY *PASSEMBLY_IDENTITY;
  10. typedef const struct _ASSEMBLY_IDENTITY *PCASSEMBLY_IDENTITY;
  11. //
  12. // The types of assembly identities.
  13. //
  14. // Definitions may not include wildcard attributes; definitions
  15. // match only if they are exactly equal. A wildcard matches
  16. // a definition if for all the non-wildcarded attributes,
  17. // there is an exact match. References may not contain
  18. // wildcarded attributes but may contain a different set of
  19. // attributes than a definition that they match. (Example:
  20. // definitions carry the full public key of the publisher, but
  21. // references usually carry just the "strong name" which is
  22. // the first 8 bytes of the SHA-1 hash of the public key.)
  23. //
  24. #define ASSEMBLY_IDENTITY_TYPE_DEFINITION (1)
  25. #define ASSEMBLY_IDENTITY_TYPE_REFERENCE (2)
  26. #define ASSEMBLY_IDENTITY_TYPE_WILDCARD (3)
  27. #define SXS_ASSEMBLY_MANIFEST_STD_NAMESPACE L"urn:schemas-microsoft-com:asm.v1"
  28. #define SXS_ASSEMBLY_MANIFEST_STD_NAMESPACE_CCH (32)
  29. #define SXS_ASSEMBLY_MANIFEST_STD_ELEMENT_NAME_ASSEMBLY L"assembly"
  30. #define SXS_ASSEMBLY_MANIFEST_STD_ELEMENT_NAME_ASSEMBLY_CCH (8)
  31. #define SXS_ASSEMBLY_MANIFEST_STD_ELEMENT_NAME_ASSEMBLY_IDENTITY L"assemblyIdentity"
  32. #define SXS_ASSEMBLY_MANIFEST_STD_ELEMENT_NAME_ASSEMBLY_IDENTITY_CCH (16)
  33. #define SXS_APPLICATION_CONFIGURATION_MANIFEST_STD_ELEMENT_NAME_CONFIGURATION L"configuration"
  34. #define SXS_APPLICATION_CONFIGURATION_MANIFEST_STD_ELEMENT_NAME_CONFIGURATION_CCH (13)
  35. #define SXS_ASSEMBLY_MANIFEST_STD_ATTRIBUTE_NAME_MANIFEST_VERSION L"manifestVersion"
  36. #define SXS_ASSEMBLY_MANIFEST_STD_ATTRIBUTE_NAME_MANIFEST_VERSION_CCH (15)
  37. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_NAME L"name"
  38. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_NAME_CCH (4)
  39. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_VERSION L"version"
  40. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_VERSION_CCH (7)
  41. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_LANGUAGE L"language"
  42. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_LANGUAGE_CCH (8)
  43. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_PUBLIC_KEY L"publicKey"
  44. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_PUBLIC_KEY_CCH (9)
  45. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_PUBLIC_KEY_TOKEN L"publicKeyToken"
  46. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_PUBLIC_KEY_TOKEN_CCH (14)
  47. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_PROCESSOR_ARCHITECTURE L"processorArchitecture"
  48. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_PROCESSOR_ARCHITECTURE_CCH (21)
  49. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_TYPE L"type"
  50. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_TYPE_CCH (4)
  51. // Pseudo-value used in some places when the language= attribute is missing from the identity.
  52. // An identity that does not have language is implicitly "worldwide".
  53. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_LANGUAGE_MISSING_VALUE L"x-ww"
  54. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_LANGUAGE_MISSING_VALUE_CCH (4)
  55. //
  56. // All win32 assemblies must have "win32" as their type.
  57. //
  58. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_TYPE_VALUE_WIN32 L"win32"
  59. #define SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_TYPE_VALUE_WIN32_CCH (5)
  60. #define SXS_INSERT_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_OVERWRITE_EXISTING (0x00000001)
  61. //
  62. // SXS_ASSEMBLY_IDENTITY_FLAG_FROZEN means that the assembly
  63. // identity's contents are frozen and are not subject to additional
  64. // change.
  65. //
  66. #define ASSEMBLY_IDENTITY_FLAG_FROZEN (0x80000000)
  67. //
  68. // ASSEMBLY_IDENTITY_ATTRIBUTE structure
  69. //
  70. typedef struct _ASSEMBLY_IDENTITY_ATTRIBUTE {
  71. ULONG Flags;
  72. SIZE_T NamespaceCch;
  73. SIZE_T NameCch;
  74. SIZE_T ValueCch;
  75. const WCHAR *Namespace;
  76. const WCHAR *Name;
  77. const WCHAR *Value;
  78. } ASSEMBLY_IDENTITY_ATTRIBUTE, *PASSEMBLY_IDENTITY_ATTRIBUTE;
  79. typedef const struct _ASSEMBLY_IDENTITY_ATTRIBUTE *PCASSEMBLY_IDENTITY_ATTRIBUTE;
  80. typedef enum _ASSEMBLY_IDENTITY_INFORMATION_CLASS {
  81. AssemblyIdentityBasicInformation = 1,
  82. } ASSEMBLY_IDENTITY_INFORMATION_CLASS;
  83. typedef struct _ASSEMBLY_IDENTITY_BASIC_INFORMATION {
  84. ULONG Flags;
  85. ULONG Type;
  86. ULONG Hash;
  87. ULONG AttributeCount;
  88. } ASSEMBLY_IDENTITY_BASIC_INFORMATION, *PASSEMBLY_IDENTITY_BASIC_INFORMATION;
  89. #define SXS_CREATE_ASSEMBLY_IDENTITY_FLAG_FREEZE (0x00000001)
  90. #define SXS_ARE_ASSEMBLY_IDENTITIES_EQUAL_FLAG_ALLOW_REF_TO_MATCH_DEF (0x00000001)
  91. #define SXS_VALIDATE_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_VALIDATE_NAMESPACE (0x00000001)
  92. #define SXS_VALIDATE_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_VALIDATE_NAME (0x00000002)
  93. #define SXS_VALIDATE_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_VALIDATE_VALUE (0x00000004)
  94. #define SXS_VALIDATE_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_WILDCARDS_PERMITTED (0x00000008)
  95. #define SXS_HASH_ASSEMBLY_IDENTITY_ATTRIBUTES_FLAG_HASH_NAMESPACE (0x00000001)
  96. #define SXS_HASH_ASSEMBLY_IDENTITY_ATTRIBUTES_FLAG_HASH_NAME (0x00000002)
  97. #define SXS_HASH_ASSEMBLY_IDENTITY_ATTRIBUTES_FLAG_HASH_VALUE (0x00000004)
  98. #define SXS_COMPARE_ASSEMBLY_IDENTITY_ATTRIBUTES_COMPARISON_RESULT_INVALID (0)
  99. #define SXS_COMPARE_ASSEMBLY_IDENTITY_ATTRIBUTES_COMPARISON_RESULT_LESS_THAN (1)
  100. #define SXS_COMPARE_ASSEMBLY_IDENTITY_ATTRIBUTES_COMPARISON_RESULT_EQUAL (2)
  101. #define SXS_COMPARE_ASSEMBLY_IDENTITY_ATTRIBUTES_COMPARISON_RESULT_GREATER_THAN (3)
  102. #define SXS_COMPARE_ASSEMBLY_IDENTITY_ATTRIBUTES_FLAG_COMPARE_NAMESPACE (0x00000001)
  103. #define SXS_COMPARE_ASSEMBLY_IDENTITY_ATTRIBUTES_FLAG_COMPARE_NAME (0x00000002)
  104. #define SXS_COMPARE_ASSEMBLY_IDENTITY_ATTRIBUTES_FLAG_COMPARE_VALUE (0x00000004)
  105. #define SXS_FIND_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_MATCH_NAMESPACE (0x00000001)
  106. #define SXS_FIND_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_MATCH_NAME (0x00000002)
  107. #define SXS_FIND_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_MATCH_VALUE (0x00000004)
  108. #define SXS_FIND_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_NOT_FOUND_SUCCEEDS (0x00000008)
  109. //
  110. // Rather than making "n" heap allocations, the pattern for SxsGetAssemblyIdentityAttributeByOrdinal()
  111. // is to call once with BufferSize = 0 or some reasonable fixed number to get the size of the
  112. // buffer required, allocate the buffer if the buffer passed in was too small and call again.
  113. //
  114. // The strings returned in the ASSEMBLY_IDENTITY_ATTRIBUTE are *not*
  115. // dynamically allocated, but are instead expected to fit in the buffer passed in.
  116. //
  117. #define SXS_DUPLICATE_ASSEMBLY_IDENTITY_FLAG_FREEZE (0x00000001)
  118. #define SXS_DUPLICATE_ASSEMBLY_IDENTITY_FLAG_ALLOW_NULL (0x00000002)
  119. #define SXS_ENUMERATE_ASSEMBLY_IDENTITY_ATTRIBUTES_FLAG_MATCH_NAMESPACE (0x00000001)
  120. #define SXS_ENUMERATE_ASSEMBLY_IDENTITY_ATTRIBUTES_FLAG_MATCH_NAME (0x00000002)
  121. #define SXS_ENUMERATE_ASSEMBLY_IDENTITY_ATTRIBUTES_FLAG_MATCH_VALUE (0x00000004)
  122. //
  123. // Assembly Identity encoding:
  124. //
  125. // Assembly identities may be encoded in various forms. The two usual ones
  126. // are either a binary stream, suitable for embedding in other data structures
  127. // or for persisting or a textual format that looks like:
  128. //
  129. // name;[ns1,]n1="v1";[ns2,]n2="v2"[;...]
  130. //
  131. #define SXS_ASSEMBLY_IDENTITY_ENCODING_DEFAULTGROUP_BINARY (1)
  132. #define SXS_ASSEMBLY_IDENTITY_ENCODING_DEFAULTGROUP_TEXTUAL (2)
  133. #define SXS_DECODE_ASSEMBLY_IDENTITY_FLAG_FREEZE (0x00000001)
  134. typedef VOID (* PRTLSXS_ASSEMBLY_IDENTITY_ATTRIBUTE_ENUMERATION_ROUTINE)(
  135. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  136. IN PCASSEMBLY_IDENTITY_ATTRIBUTE Attribute,
  137. IN PVOID Context
  138. );
  139. #define STATUS_SXS_UNKNOWN_ENCODING_GROUP (0xc0100010)
  140. #define STATUS_SXS_UNKNOWN_ENCODING (0xc0100011)
  141. #define STATUS_SXS_INVALID_XML_NAMESPACE_URI (0xc0100012)
  142. #define STATUS_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE_NAME (0xc0100013)
  143. #define STATUS_SXS_INVALID_ASSEMBLY_IDENTITY_ATTRIBUTE (0xc0100014)
  144. #ifdef __cplusplus
  145. } /* extern "C" */
  146. #endif