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.

123 lines
3.0 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) Microsoft Corporation
  4. //
  5. // SYNOPSIS
  6. //
  7. // Declares the class PolicyEnforcer.
  8. //
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef ENFORCER_H
  11. #define ENFORCER_H
  12. #pragma once
  13. #include <policylist.h>
  14. #include <iastl.h>
  15. class TunnelTagger;
  16. ///////////////////////////////////////////////////////////////////////////////
  17. //
  18. // CLASS
  19. //
  20. // PolicyEnforcerBase
  21. //
  22. ///////////////////////////////////////////////////////////////////////////////
  23. class ATL_NO_VTABLE PolicyEnforcerBase :
  24. public IASTL::IASRequestHandlerSync
  25. {
  26. public:
  27. //////////
  28. // IIasComponent
  29. //////////
  30. STDMETHOD(Shutdown)();
  31. STDMETHOD(PutProperty)(LONG Id, VARIANT* pValue);
  32. protected:
  33. PolicyEnforcerBase(DWORD name) throw ()
  34. : nameAttr(name), tagger(0)
  35. { }
  36. ~PolicyEnforcerBase() throw ();
  37. // Main request processing routine.
  38. virtual IASREQUESTSTATUS onSyncRequest(IRequest* pRequest) throw ();
  39. static void processException(
  40. IRequest* pRequest,
  41. const _com_error& ce
  42. ) throw ();
  43. // Update the PolicyList.
  44. void setPolicies(IDispatch* pDisp);
  45. PolicyList policies; // Processed policies used for run-time enforcement.
  46. DWORD nameAttr; // Attribute used for storing policy name.
  47. TunnelTagger* tagger; // Tags tunnel attributes.
  48. };
  49. ///////////////////////////////////////////////////////////////////////////////
  50. //
  51. // CLASS
  52. //
  53. // ProxyPolicyEnforcer
  54. //
  55. // DESCRIPTION
  56. //
  57. // Enforces Proxy Policies.
  58. //
  59. ///////////////////////////////////////////////////////////////////////////////
  60. class __declspec(uuid("6BC098A8-0CE6-11D1-BAAE-00C04FC2E20D"))
  61. ProxyPolicyEnforcer;
  62. class ProxyPolicyEnforcer :
  63. public PolicyEnforcerBase,
  64. public CComCoClass<ProxyPolicyEnforcer, &__uuidof(ProxyPolicyEnforcer)>
  65. {
  66. public:
  67. IAS_DECLARE_REGISTRY(ProxyPolicyEnforcer, 1, IAS_REGISTRY_AUTO, NetworkPolicy)
  68. protected:
  69. ProxyPolicyEnforcer() throw ()
  70. : PolicyEnforcerBase(IAS_ATTRIBUTE_PROXY_POLICY_NAME)
  71. { }
  72. // Main request processing routine.
  73. virtual IASREQUESTSTATUS onSyncRequest(IRequest* pRequest) throw ();
  74. };
  75. ///////////////////////////////////////////////////////////////////////////////
  76. //
  77. // CLASS
  78. //
  79. // PolicyEnforcer
  80. //
  81. // DESCRIPTION
  82. //
  83. // Enforces Remote Access Policies.
  84. //
  85. ///////////////////////////////////////////////////////////////////////////////
  86. class PolicyEnforcer :
  87. public PolicyEnforcerBase,
  88. public CComCoClass<PolicyEnforcer, &__uuidof(PolicyEnforcer)>
  89. {
  90. public:
  91. IAS_DECLARE_REGISTRY(PolicyEnforcer, 1, IAS_REGISTRY_AUTO, NetworkPolicy)
  92. protected:
  93. PolicyEnforcer() throw ()
  94. : PolicyEnforcerBase(IAS_ATTRIBUTE_NP_NAME)
  95. { }
  96. // Main request processing routine.
  97. virtual IASREQUESTSTATUS onSyncRequest(IRequest* pRequest) throw ();
  98. };
  99. #endif // _ENFORCER_H_