Source code of Windows XP (NT5)
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.

72 lines
2.3 KiB

  1. #if !defined(_FUSION_SXS_ASSEMBLYREFERENCE_H_INCLUDED_)
  2. #define _FUSION_SXS_ASSEMBLYREFERENCE_H_INCLUDED_
  3. #pragma once
  4. #include "sxsp.h"
  5. #include "fusionhash.h"
  6. class CAssemblyReference
  7. {
  8. public:
  9. CAssemblyReference();
  10. ~CAssemblyReference();
  11. BOOL TakeValue(const CAssemblyReference &r);
  12. public:
  13. BOOL Initialize();
  14. // BOOL Initialize(PCWSTR AssemblyName, SIZE_T AssemblyNameCch, const ASSEMBLY_VERSION &rav, LANGID LangId, USHORT ProcessorArchitecture);
  15. BOOL Initialize(const CAssemblyReference &r); // "copy initializer"
  16. BOOL Initialize(PCASSEMBLY_IDENTITY Identity);
  17. bool IsInitialized() const { return m_pAssemblyIdentity != NULL; }
  18. BOOL Hash(ULONG &rulPseudoKey) const;
  19. PCASSEMBLY_IDENTITY GetAssemblyIdentity() const { return m_pAssemblyIdentity; }
  20. BOOL SetAssemblyIdentity(PCASSEMBLY_IDENTITY pAssemblySource); //dupilicate the input parameter
  21. BOOL SetAssemblyName(PCWSTR AssemblyName, SIZE_T AssemblyNameCch);
  22. BOOL ClearAssemblyName() ;
  23. BOOL GetAssemblyName(PCWSTR *Buffer, SIZE_T *Cch) const;
  24. BOOL SetLanguage(const CBaseStringBuffer &rbuff);
  25. BOOL ClearLanguage();
  26. BOOL IsLangIdSpecified(bool &rfSpecified) const;
  27. BOOL IsLanguageWildcarded(bool &rfWildcarded) const;
  28. BOOL IsProcessorArchitectureWildcarded(bool &rfWildcarded) const;
  29. BOOL IsProcessorArchitectureX86(bool &rfIsX86) const;
  30. BOOL SetProcessorArchitecture(PCWSTR String, SIZE_T Cch);
  31. BOOL GetPublicKeyToken(OUT CBaseStringBuffer *pbuffPublicKeyToken, OUT BOOL &rfHasPublicKeyToken) const;
  32. BOOL SetPublicKeyToken(IN const CBaseStringBuffer &rbuffPublicKeyToken);
  33. BOOL SetPublicKeyToken(IN PCWSTR pszPublicKeyToken, IN SIZE_T cchPublicKeyToken);
  34. BOOL Assign(const CAssemblyReference &r) ;
  35. protected:
  36. PASSEMBLY_IDENTITY m_pAssemblyIdentity;
  37. private:
  38. CAssemblyReference(const CAssemblyReference &r); // intentionally unimplemented
  39. void operator =(const CAssemblyReference &r); // intentionally unimplemented
  40. };
  41. template <> inline BOOL HashTableHashKey<const CAssemblyReference &>(
  42. const CAssemblyReference &r,
  43. ULONG &rulPK
  44. )
  45. {
  46. return r.Hash(rulPK);
  47. }
  48. template <> inline BOOL HashTableInitializeKey<const CAssemblyReference &, CAssemblyReference>(
  49. const CAssemblyReference &keyin,
  50. CAssemblyReference &keystored
  51. )
  52. {
  53. return keystored.Initialize(keyin);
  54. }
  55. #endif