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.

77 lines
2.7 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() { Construct(); }
  10. ~CAssemblyReference() { Destroy(); }
  11. void Construct();
  12. void Destroy();
  13. BOOL TakeValue(CAssemblyReference &r);
  14. public:
  15. BOOL Initialize();
  16. // BOOL Initialize(PCWSTR AssemblyName, SIZE_T AssemblyNameCch, const ASSEMBLY_VERSION &rav, LANGID LangId, USHORT ProcessorArchitecture);
  17. BOOL Initialize(const CAssemblyReference &r); // "copy initializer"
  18. BOOL Initialize(PCASSEMBLY_IDENTITY Identity);
  19. bool IsInitialized() const { return m_pAssemblyIdentity != NULL; }
  20. BOOL Hash(ULONG &rulPseudoKey) const;
  21. PCASSEMBLY_IDENTITY GetAssemblyIdentity() const { return m_pAssemblyIdentity; }
  22. BOOL SetAssemblyIdentity(PCASSEMBLY_IDENTITY pAssemblySource); //dupilicate the input parameter
  23. BOOL SetAssemblyName(PCWSTR AssemblyName, SIZE_T AssemblyNameCch);
  24. BOOL ClearAssemblyName() ;
  25. BOOL GetAssemblyName(PCWSTR *Buffer, SIZE_T *Cch) const;
  26. BOOL GetLanguage(PCWSTR &rString, SIZE_T &rcch) const;
  27. BOOL SetLanguage(const CBaseStringBuffer &rbuff);
  28. BOOL SetLanguage(PCWSTR String, SIZE_T Cch);
  29. BOOL ClearLanguage();
  30. BOOL IsLanguageWildcarded(bool &rfWildcarded) const;
  31. BOOL IsProcessorArchitectureWildcarded(bool &rfWildcarded) const;
  32. BOOL IsProcessorArchitectureX86(bool &rfIsX86) const;
  33. BOOL GetProcessorArchitecture(PCWSTR &rString, SIZE_T &rcch) const;
  34. BOOL SetProcessorArchitecture(PCWSTR String, SIZE_T Cch);
  35. BOOL SetProcessorArchitecture(IN const CBaseStringBuffer &rbuffProcessorArchitecture);
  36. BOOL GetPublicKeyToken(OUT CBaseStringBuffer *pbuffPublicKeyToken, OUT BOOL &rfHasPublicKeyToken) const;
  37. BOOL SetPublicKeyToken(IN const CBaseStringBuffer &rbuffPublicKeyToken);
  38. BOOL SetPublicKeyToken(IN PCWSTR pszPublicKeyToken, IN SIZE_T cchPublicKeyToken);
  39. BOOL Assign(const CAssemblyReference &r) ;
  40. protected:
  41. PASSEMBLY_IDENTITY m_pAssemblyIdentity;
  42. private:
  43. CAssemblyReference(const CAssemblyReference &r); // intentionally unimplemented
  44. void operator =(const CAssemblyReference &r); // intentionally unimplemented
  45. };
  46. template <> inline BOOL HashTableHashKey<const CAssemblyReference &>(
  47. const CAssemblyReference &r,
  48. ULONG &rulPK
  49. )
  50. {
  51. return r.Hash(rulPK);
  52. }
  53. template <> inline BOOL HashTableInitializeKey<const CAssemblyReference &, CAssemblyReference>(
  54. const CAssemblyReference &keyin,
  55. CAssemblyReference &keystored
  56. )
  57. {
  58. return keystored.Initialize(keyin);
  59. }
  60. #endif