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.

104 lines
2.3 KiB

  1. //////////////////////////////////////////////////////////////////////
  2. // PolicyMM.h : Declaration of CMMPolicy class which implements
  3. // our WMI class Nsp_MMPolicySettings
  4. // Copyright (c)1997-2001 Microsoft Corporation
  5. //
  6. // Original Create Date: 3/8/2001
  7. // Original Author: shawnwu
  8. //////////////////////////////////////////////////////////////////////
  9. #pragma once
  10. #include "globals.h"
  11. #include "Policy.h"
  12. /*
  13. Class description
  14. Naming:
  15. CMMPolicy stands for Maink Mode Policy.
  16. Base class:
  17. CIPSecBase, because it is a class representing a WMI object - its WMI
  18. class name is Nsp_MMPolicySettings
  19. Purpose of class:
  20. (1) Nsp_MMPolicySettings is the WMI class for SPD's IPSEC_MM_POLICY.
  21. Design:
  22. (1) it implements IIPSecObjectImpl.
  23. Use:
  24. (1) You probably will never create an instance and use it directly. Everything
  25. should normall go through IIPSecObjectImpl for non-static functions.
  26. */
  27. class ATL_NO_VTABLE CMMPolicy :
  28. public CIPSecPolicy
  29. {
  30. protected:
  31. CMMPolicy(){}
  32. virtual ~CMMPolicy(){}
  33. public:
  34. //
  35. // IIPSecObjectImpl methods:
  36. //
  37. STDMETHOD(QueryInstance) (
  38. IN LPCWSTR pszQuery,
  39. IN IWbemContext * pCtx,
  40. IN IWbemObjectSink * pSink
  41. );
  42. STDMETHOD(DeleteInstance) (
  43. IN IWbemContext * pCtx,
  44. IN IWbemObjectSink * pSink
  45. );
  46. STDMETHOD(PutInstance) (
  47. IN IWbemClassObject * pInst,
  48. IN IWbemContext * pCtx,
  49. IN IWbemObjectSink * pSink
  50. );
  51. STDMETHOD(GetInstance) (
  52. IN IWbemContext * pCtx,
  53. IN IWbemObjectSink * pSink
  54. );
  55. static
  56. HRESULT AddPolicy (
  57. IN bool bPreExist,
  58. IN PIPSEC_MM_POLICY pMMPolicy
  59. );
  60. static
  61. HRESULT DeletePolicy (
  62. IN LPCWSTR pszPolicyName
  63. );
  64. private:
  65. HRESULT CreateWbemObjFromMMPolicy (
  66. IN PIPSEC_MM_POLICY pPolicy,
  67. OUT IWbemClassObject ** ppObj
  68. );
  69. HRESULT GetMMPolicyFromWbemObj (
  70. IN IWbemClassObject * pInst,
  71. OUT PIPSEC_MM_POLICY * ppPolicy,
  72. OUT bool * pbPreExist
  73. );
  74. };