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.

152 lines
5.3 KiB

  1. #if !defined(_FUSION_INC_SXSID_H_INCLUDED_)
  2. #define _FUSION_INC_SXSID_H_INCLUDED_
  3. #pragma once
  4. #include <windows.h>
  5. #include <setupapi.h>
  6. #include <sxsapi.h>
  7. #include <stdlib.h>
  8. #include <search.h>
  9. typedef struct _SXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE
  10. {
  11. const WCHAR *Namespace;
  12. SIZE_T NamespaceCch;
  13. const WCHAR *Name;
  14. SIZE_T NameCch;
  15. } SXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE, *PSXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE;
  16. typedef const SXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE *PCSXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE;
  17. #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 };
  18. #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 };
  19. SXS_DEFINE_STANDARD_ATTRIBUTE_REFERENCE_EX(s_IdentityAttribute_name, SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_NAME)
  20. SXS_DEFINE_STANDARD_ATTRIBUTE_REFERENCE_EX(s_IdentityAttribute_type, SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_TYPE)
  21. SXS_DEFINE_STANDARD_ATTRIBUTE_REFERENCE_EX(s_IdentityAttribute_version, SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_VERSION)
  22. SXS_DEFINE_STANDARD_ATTRIBUTE_REFERENCE_EX(s_IdentityAttribute_processorArchitecture, SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_PROCESSOR_ARCHITECTURE)
  23. SXS_DEFINE_STANDARD_ATTRIBUTE_REFERENCE_EX(s_IdentityAttribute_publicKey, SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_PUBLIC_KEY)
  24. SXS_DEFINE_STANDARD_ATTRIBUTE_REFERENCE_EX(s_IdentityAttribute_publicKeyToken, SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_PUBLIC_KEY_TOKEN)
  25. SXS_DEFINE_STANDARD_ATTRIBUTE_REFERENCE_EX(s_IdentityAttribute_language, SXS_ASSEMBLY_IDENTITY_STD_ATTRIBUTE_NAME_LANGUAGE)
  26. #define ASSEMBLY_TYPE_POLICY (L"policy")
  27. #define ASSEMBLY_TYPE_POLICY_CCH (NUMBER_OF(ASSEMBLY_TYPE_POLICY) - 1)
  28. #define ASSEMBLY_TYPE_POLICY_SUFFIX (L"-policy")
  29. #define ASSEMBLY_TYPE_POLICY_SUFFIX_CCH (NUMBER_OF(ASSEMBLY_TYPE_POLICY_SUFFIX) - 1)
  30. //
  31. // This header defines the "semi-public" assembly identity functions.
  32. //
  33. // The public ones are in sxsapi.h; these are not private to the identity
  34. // implementation directly but are private to sxs.dll.
  35. //
  36. BOOL
  37. SxsIsAssemblyIdentityAttributePresent(
  38. DWORD Flags,
  39. PCASSEMBLY_IDENTITY pAssemblyIdentity,
  40. PCSXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE AttributeReference,
  41. BOOL *pfFound
  42. );
  43. #define SXSP_SET_ASSEMBLY_IDENTITY_ATTRIBUTE_VALUE_FLAG_OVERWRITE_EXISTING (0x00000001)
  44. BOOL
  45. SxspSetAssemblyIdentityAttributeValue(
  46. DWORD Flags,
  47. struct _ASSEMBLY_IDENTITY* pAssemblyIdentity,
  48. PCSXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE AttributeReference,
  49. PCWSTR pszValue,
  50. SIZE_T cchValue
  51. );
  52. BOOL
  53. SxspSetAssemblyIdentityAttributeValue(
  54. DWORD Flags,
  55. struct _ASSEMBLY_IDENTITY* pAssemblyIdentity,
  56. PCSXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE AttributeReference,
  57. const CBaseStringBuffer &Value
  58. );
  59. #define SXSP_REMOVE_ASSEMBLY_IDENTITY_ATTRIBUTE_FLAG_NOT_FOUND_SUCCEEDS (0x00000001)
  60. BOOL
  61. SxspRemoveAssemblyIdentityAttribute(
  62. DWORD Flags,
  63. struct _ASSEMBLY_IDENTITY* pAssemblyIdentity,
  64. PCSXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE AttributeReference
  65. );
  66. #define SXSP_GET_ASSEMBLY_IDENTITY_ATTRIBUTE_VALUE_FLAG_NOT_FOUND_RETURNS_NULL (0x00000001)
  67. BOOL
  68. SxspGetAssemblyIdentityAttributeValue(
  69. IN DWORD Flags,
  70. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  71. PCSXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE AttributeReference,
  72. OUT PCWSTR *ValuePointer,
  73. OUT SIZE_T *ValueCch
  74. );
  75. BOOL
  76. SxspGetAssemblyIdentityAttributeValue(
  77. IN DWORD Flags,
  78. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  79. PCSXS_ASSEMBLY_IDENTITY_ATTRIBUTE_REFERENCE AttributeReference,
  80. OUT CBaseStringBuffer &Value
  81. );
  82. VOID
  83. SxspDbgPrintAssemblyIdentity(
  84. DWORD dwflags,
  85. PCASSEMBLY_IDENTITY pAssemblyIdentity
  86. );
  87. #define SXSP_MAP_ASSEMBLY_IDENTITY_TO_POLICY_IDENTITY_FLAG_OMIT_ENTIRE_VERSION (0x00000001)
  88. BOOL
  89. SxspMapAssemblyIdentityToPolicyIdentity(
  90. IN DWORD Flags,
  91. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  92. OUT PASSEMBLY_IDENTITY *PolicyIdentity
  93. );
  94. #define SXSP_GENERATE_TEXTUALLY_ENCODED_POLICY_IDENTITY_FROM_ASSEMBLY_IDENTITY_FLAG_OMIT_ENTIRE_VERSION (0x00000001)
  95. BOOL
  96. SxspGenerateTextuallyEncodedPolicyIdentityFromAssemblyIdentity(
  97. DWORD Flags,
  98. PCASSEMBLY_IDENTITY AssemblyIdentity,
  99. CBaseStringBuffer &rbuffEncodedIdentity,
  100. PASSEMBLY_IDENTITY *PolicyIdentity OPTIONAL
  101. );
  102. BOOL
  103. SxspHashAssemblyIdentityForPolicy(
  104. IN DWORD dwFlags,
  105. IN PCASSEMBLY_IDENTITY AssemblyIdentity,
  106. OUT ULONG & IdentityHash);
  107. BOOL
  108. SxspDoesStringIndicatePolicy(
  109. SIZE_T cchString,
  110. PCWSTR pcwsz,
  111. BOOL &fIsPolicy
  112. );
  113. BOOL
  114. SxspDetermineAssemblyType(
  115. PCASSEMBLY_IDENTITY pAssemblyIdentity,
  116. BOOL &fIsPolicyAssembly
  117. );
  118. BOOL
  119. SxspGenerateTextualIdentity(
  120. DWORD dwFlags,
  121. PCASSEMBLY_IDENTITY pAsmIdent,
  122. CBaseStringBuffer &rsbTextualString
  123. );
  124. #endif // !defined(_FUSION_INC_SXSID_H_INCLUDED_)