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.

77 lines
1.9 KiB

  1. #if !defined(_FUSION_DLL_WHISTLER_POLICYSTATEMENT_H_INCLUDED_)
  2. #define _FUSION_DLL_WHISTLER_POLICYSTATEMENT_H_INCLUDED_
  3. #pragma once
  4. #include "stdinc.h"
  5. #include "fusionbuffer.h"
  6. #include "fusiondequelinkage.h"
  7. #include "fusiondeque.h"
  8. #include <sxsapi.h>
  9. class CPolicyStatementRedirect
  10. {
  11. public:
  12. inline CPolicyStatementRedirect() { }
  13. inline ~CPolicyStatementRedirect() { }
  14. BOOL Initialize(
  15. const CBaseStringBuffer &rbuffFromVersionRange,
  16. const CBaseStringBuffer &rbuffToVersion,
  17. bool &rfValid
  18. );
  19. BOOL TryMap(
  20. const ASSEMBLY_VERSION &rav,
  21. SIZE_T cchBuffer,
  22. PWSTR pBuffer,
  23. SIZE_T &rcchWritten,
  24. bool &rfMapped
  25. );
  26. BOOL CheckForOverlap(
  27. const CPolicyStatementRedirect &rRedirect,
  28. bool &rfOverlaps
  29. );
  30. CDequeLinkage m_leLinks;
  31. ASSEMBLY_VERSION m_avFromMin;
  32. ASSEMBLY_VERSION m_avFromMax;
  33. SIZE_T m_cchNewVersion;
  34. WCHAR m_rgwchNewVersion[(4 * 5) + (3 * 1) + 1];
  35. private:
  36. CPolicyStatementRedirect(const CPolicyStatementRedirect &r);
  37. void operator =(const CPolicyStatementRedirect &r);
  38. };
  39. class CPolicyStatement
  40. {
  41. public:
  42. inline CPolicyStatement() { }
  43. inline ~CPolicyStatement() { m_Redirects.Clear<CPolicyStatement>(this, &CPolicyStatement::ClearDequeEntry); }
  44. BOOL Initialize();
  45. BOOL AddRedirect(
  46. const CBaseStringBuffer &rbuffFromVersion,
  47. const CBaseStringBuffer &rbuffToVersion,
  48. bool &rfValid
  49. );
  50. BOOL ApplyPolicy(
  51. PASSEMBLY_IDENTITY AssemblyIdentity,
  52. bool &rfPolicyApplied
  53. );
  54. VOID ClearDequeEntry(CPolicyStatementRedirect *p) const { FUSION_DELETE_SINGLETON(p); }
  55. CDeque<CPolicyStatementRedirect, FIELD_OFFSET(CPolicyStatementRedirect, m_leLinks)> m_Redirects;
  56. private:
  57. CPolicyStatement(const CPolicyStatement &r);
  58. void operator =(const CPolicyStatement &r);
  59. };
  60. #endif // !defined(_FUSION_DLL_WHISTLER_POLICYSTATEMENT_H_INCLUDED_)