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.

153 lines
5.0 KiB

  1. #if !defined(_FUSION_INC_SXSID_H_INCLUDED_)
  2. #define _FUSION_INC_SXSID_H_INCLUDED_
  3. #pragma once
  4. #include <sxsapi.h>
  5. #include <stdlib.h>
  6. #include <search.h>
  7. typedef struct _SXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE
  8. {
  9. const WCHAR *Namespace;
  10. SIZE_T NamespaceCch;
  11. const WCHAR *Name;
  12. SIZE_T NameCch;
  13. } SXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE, *PSXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE;
  14. typedef const SXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE *PCSXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE;
  15. #define SXS_DEFINE_ATTRIBUTE_REFERENCE_EX(_id, _ns, _n) EXTERN_C __declspec(selectany) const SXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE _id = { _ns, (sizeof(_ns) / sizeof(_ns[0])) - 1, _n, (sizeof(_n) / sizeof(_n[0])) - 1 };
  16. #define SXS_DEFINE_STANDARD_ATTRIBUTE_REFERENCE_EX(_id, _n) EXTERN_C __declspec(selectany) const SXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE _id = { NULL, 0, _n, (sizeof(_n) / sizeof(_n[0])) - 1 };
  17. SXS_DEFINE_STANDARD_ATTRIBUTE_REFERENCE_EX(s_IdentityAttribute_name, SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_NAME)
  18. SXS_DEFINE_STANDARD_ATTRIBUTE_REFERENCE_EX(s_IdentityAttribute_type, SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_TYPE)
  19. SXS_DEFINE_STANDARD_ATTRIBUTE_REFERENCE_EX(s_IdentityAttribute_version, SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_VERSION)
  20. SXS_DEFINE_STANDARD_ATTRIBUTE_REFERENCE_EX(s_IdentityAttribute_processorArchitecture, SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_PROCESSOR_ARCHITECTURE)
  21. SXS_DEFINE_STANDARD_ATTRIBUTE_REFERENCE_EX(s_IdentityAttribute_publicKey, SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_PUBLIC_KEY)
  22. SXS_DEFINE_STANDARD_ATTRIBUTE_REFERENCE_EX(s_IdentityAttribute_publicKeyToken, SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_PUBLIC_KEY_TOKEN)
  23. SXS_DEFINE_STANDARD_ATTRIBUTE_REFERENCE_EX(s_IdentityAttribute_language, SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_LANGUAGE)
  24. //
  25. // This header defines the "semi-public" assembly identity functions.
  26. //
  27. // The public ones are in sxsapi.h; these are not private to the identity
  28. // implementation directly but are private to sxs.dll.
  29. //
  30. NTSTATUS
  31. RtlSxsIsAssemblyIdentityAttributePresent(
  32. ULONG Flags,
  33. PCASSEMBLY_IDENTITY pAssemblyIdentity,
  34. PCSXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE AttributeReference,
  35. BOOLEAN *pfFound
  36. );
  37. #define SXSP_SET_ASSEMBLY_IDENTITY_ATTRIBUTE_VALUE_FLAG_OVERWRITE_EXISTING (0x00000001)
  38. NTSTATUS
  39. RtlSxspSetAssemblyIdentityAttributeValue(
  40. ULONG Flags,
  41. struct _ASSEMBLY_IDENTITY* pAssemblyIdentity,
  42. PCSXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE AttributeReference,
  43. PCWSTR pszValue,
  44. SIZE_T cchValue
  45. );
  46. #define SXSP_REMOVE_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_NOT_FOUND_SUCCEEDS (0x00000001)
  47. NTSTATUS
  48. RtlSxspRemoveAssemblyIdentityAttribute(
  49. ULONG Flags,
  50. struct _ASSEMBLY_IDENTITY* pAssemblyIdentity,
  51. PCSXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE AttributeReference
  52. );
  53. #define SXSP_GET_ASSEMBLY_IDENTITY_ATTRIBUTE_VALUE_FLAG_NOT_FOUND_RETURNS_NULL (0x00000001)
  54. NTSTATUS
  55. RtlSxspGetAssemblyIdentityAttributeValue(
  56. IN ULONG Flags,
  57. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  58. PCSXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE AttributeReference,
  59. OUT PCWSTR *ValuePointer,
  60. OUT SIZE_T *ValueCch
  61. );
  62. NTSTATUS
  63. RtlSxspDbgPrintAssemblyIdentity(
  64. ULONG dwflags,
  65. PCASSEMBLY_IDENTITY pAssemblyIdentity
  66. );
  67. #define SXSP_MAP_ASSEMBLY_IDENTITY_TO_POLICY_IDENTITY_FLAG_OMIT_ENTIRE_VERSION (0x00000001)
  68. NTSTATUS
  69. RtlSxspMapAssemblyIdentityToPolicyIdentity(
  70. IN ULONG Flags,
  71. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  72. OUT PASSEMBLY_IDENTITY *PolicyIdentity
  73. );
  74. #define SXSP_GENERATE_TEXTUALLY_ENCODED_POLICY_IDENTITY_FROM_ASSEMBLY_IDENTITY_FLAG_OMIT_ENTIRE_VERSION (0x00000001)
  75. NTSTATUS
  76. RtlSxspGenerateTextuallyEncodedPolicyIdentityFromAssemblyIdentity(
  77. ULONG Flags,
  78. PCASSEMBLY_IDENTITY AssemblyIdentity,
  79. UNICODE_STRING rbuffEncodedIdentity,
  80. PASSEMBLY_IDENTITY *PolicyIdentity OPTIONAL
  81. );
  82. NTSTATUS
  83. RtlSxspHashAssemblyIdentityForPolicy(
  84. IN ULONG dwFlags,
  85. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  86. OUT ULONG *IdentityHash);
  87. NTSTATUS
  88. RtlSxsDuplicateAssemblyIdentity(
  89. ULONG Flags,
  90. PCASSEMBLY_IDENTITY Source,
  91. PASSEMBLY_IDENTITY *Destination
  92. );
  93. NTSTATUS
  94. RtlSxsDestroyAssemblyIdentity(
  95. PASSEMBLY_IDENTITY pIdentity
  96. );
  97. NTSTATUS
  98. RtlSxsHashAssemblyIdentity(
  99. ULONG dwFlags,
  100. PCASSEMBLY_IDENTITY pAssemblyIdentity,
  101. ULONG * pulPseudoKey
  102. );
  103. NTSTATUS
  104. RtlSxsInsertAssemblyIdentityAttribute(
  105. ULONG Flags,
  106. PASSEMBLY_IDENTITY AssemblyIdentity,
  107. PCASSEMBLY_IDENTITY_ATTRIBUTE AssemblyIdentityAttribute
  108. );
  109. NTSTATUS
  110. RtlSxsRemoveAssemblyIdentityAttributesByOrdinal(
  111. ULONG Flags,
  112. PASSEMBLY_IDENTITY AssemblyIdentity,
  113. ULONG Ordinal,
  114. ULONG Count
  115. );
  116. NTSTATUS
  117. RtlSxsFindAssemblyIdentityAttribute(
  118. ULONG Flags,
  119. PCASSEMBLY_IDENTITY AssemblyIdentity,
  120. PCASSEMBLY_IDENTITY_ATTRIBUTE Attribute,
  121. ULONG *OrdinalOut,
  122. ULONG *CountOut OPTIONAL
  123. );
  124. #endif // !defined(_FUSION_INC_SXSID_H_INCLUDED_)