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.

185 lines
5.1 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. /*++
  3. Copyright (C) Microsoft Corporation, 1997 - 1999
  4. Module Name:
  5. PoliciesNode.h
  6. Abstract:
  7. Header file for the CPoliciesNode subnode.
  8. See PoliciesNode.cpp for implementation.
  9. Revision History:
  10. mmaguire 12/15/97 - created
  11. --*/
  12. //////////////////////////////////////////////////////////////////////////////
  13. #if !defined(_NAP_POLICIES_NODE_H_)
  14. #define _NAP_POLICIES_NODE_H_
  15. //////////////////////////////////////////////////////////////////////////////
  16. // BEGIN INCLUDES
  17. //
  18. // where we can find what this class derives from:
  19. //
  20. #include "MeritNode.h"
  21. #include "NodeWithResultChildrenList.h"
  22. //
  23. //
  24. // For include file dependency reasons, we have forward declarations here,
  25. // and include the needed header files in our .cpp files.
  26. //
  27. #include "IASAttrList.h"
  28. class CPolicyNode;
  29. class CPolicyPage1;
  30. class CComponentData;
  31. class CComponent;
  32. //
  33. // END INCLUDES
  34. //////////////////////////////////////////////////////////////////////////////
  35. #define EXCLUDE_AUTH_TYPE 0x000000001
  36. class CPoliciesNode : public CNodeWithResultChildrenList< CPoliciesNode, CPolicyNode, CMeritNodeArray<CPolicyNode*>, CComponentData, CComponent >
  37. {
  38. public:
  39. CPoliciesNode(
  40. CSnapInItem* pParentNode,
  41. LPTSTR pszServerAddress,
  42. bool fExtendingIAS
  43. );
  44. HRESULT SetSdo(
  45. ISdo* pSdoMachine,
  46. ISdoDictionaryOld* pSdoDictionary,
  47. BOOL fSdoConnected,
  48. BOOL fUseDS,
  49. BOOL fDSAvailable
  50. );
  51. HRESULT SetName(
  52. BOOL bPoliciesFromDirectoryService,
  53. LPWSTR szPolicyLocation,
  54. IConsole * pConsole
  55. );
  56. ~CPoliciesNode();
  57. // we can't do this because of the way this macro was
  58. // not written to support subclassing
  59. // BEGIN_SNAPINCOMMAND_MAP(CPoliciesNode, FALSE)
  60. // END_SNAPINCOMMAND_MAP()
  61. SNAPINMENUID(IDM_POLICIES_NODE)
  62. BEGIN_SNAPINTOOLBARID_MAP(CPoliciesNode)
  63. // SNAPINTOOLBARID_ENTRY(IDR_POLICIES_TOOLBAR)
  64. END_SNAPINTOOLBARID_MAP()
  65. BEGIN_SNAPINCOMMAND_MAP(CPolicyNode, TRUE)
  66. SNAPINCOMMAND_ENTRY(ID_MENUITEM_POLICIES_TOP__NEW_POLICY, OnNewPolicy)
  67. SNAPINCOMMAND_ENTRY(ID_MENUITEM_POLICIES_NEW__POLICY, OnNewPolicy)
  68. SNAPINCOMMAND_ENTRY(ID_MENUITEM_POLICIES_TOP__POLICY_LOCATION, OnPolicyLocation)
  69. END_SNAPINCOMMAND_MAP()
  70. HRESULT OnNewPolicy( bool &bHandled, CSnapInObjectRootBase* pObj );
  71. HRESULT OnPolicyLocation( bool &bHandled, CSnapInObjectRootBase* pObj );
  72. void UpdateMenuState(UINT id, LPTSTR pBuf, UINT *flags);
  73. STDMETHOD(FillData)(CLIPFORMAT cf, LPSTREAM pStream);
  74. HRESULT DataRefresh(ISdo* pSdo, ISdoDictionaryOld* pDic);
  75. virtual HRESULT OnRefresh(
  76. LPARAM arg
  77. , LPARAM param
  78. , IComponentData * pComponentData
  79. , IComponent * pComponent
  80. , DATA_OBJECT_TYPES type
  81. );
  82. OLECHAR* GetResultPaneColInfo( int nCol );
  83. CComponentData * GetComponentData( void );
  84. HRESULT InsertColumns( IHeaderCtrl* pHeaderCtrl );
  85. HRESULT PopulateResultChildrenList( void );
  86. HRESULT MoveUpChild( CPolicyNode* pChildNode );
  87. HRESULT MoveDownChild( CPolicyNode* pChildNode );
  88. HRESULT NormalizeMerit( CPolicyNode* pAddedChildNode );
  89. HRESULT RemoveChild( CPolicyNode* pPolicyNode);
  90. int GetChildrenCount();
  91. CPolicyNode* FindChildWithName(LPCTSTR pszName); // search for a child
  92. bool m_fExtendingIAS; // are we extending IAS or something else?
  93. HRESULT AddDefaultProfileAttrs(ISdo* pProfileSdo, DWORD dwFlagExclude = 0);
  94. HRESULT AddProfAttr(ISdoCollection* pProfAttrCollectionSdo,
  95. ATTRIBUTEID AttrId,
  96. VARIANT* pvarValue
  97. );
  98. protected:
  99. BOOL CheckActivePropertyPages();
  100. HRESULT ReloadPoliciesFromNewLocation();
  101. virtual HRESULT SetVerbs( IConsoleVerb * pConsoleVerb );
  102. //
  103. // smart pointer to the NAP collection interface
  104. //
  105. CComPtr<ISdoCollection> m_spPoliciesCollectionSdo;
  106. CComPtr<ISdoCollection> m_spProfilesCollectionSdo;
  107. CComPtr<ISdoDictionaryOld> m_spDictionarySdo;
  108. CComPtr<ISdo> m_spDSNameSpaceSdo;
  109. CComPtr<ISdo> m_spLocalNameSpaceSdo;
  110. CComPtr<ISdo> m_spServiceSdo;
  111. CComPtr<IIASNASVendors> m_spIASNASVendors;
  112. // Smart pointer to interface for telling service to reload data.
  113. CComPtr<ISdoServiceControl> m_spSdoServiceControl;
  114. LPTSTR m_pszServerAddress; // address of the server that NAP currently
  115. // connect to
  116. CIASAttrList m_AttrList;
  117. BOOL m_fUseDS; // shall we use DS for policy location?
  118. BOOL m_fDSAvailable; // is DS available for that machine?
  119. public:
  120. BOOL m_fSdoConnected; // whether the SDOs have been connected
  121. private:
  122. enum ServerType
  123. {
  124. unknown,
  125. nt4,
  126. win2k,
  127. win5_1_or_later
  128. } m_serverType;
  129. HRESULT GetServerType();
  130. bool IsWin2kServer() throw();
  131. };
  132. #endif // _NAP_POLICIES_NODE_H_