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.

185 lines
5.2 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. /*++
  3. Copyright (C) Microsoft Corporation
  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. #define EXCLUDE_DEFAULT_FRAMED 0x000000002
  37. class CPoliciesNode : public CNodeWithResultChildrenList< CPoliciesNode, CPolicyNode, CMeritNodeArray<CPolicyNode*>, CComponentData, CComponent >
  38. {
  39. public:
  40. CPoliciesNode(
  41. CSnapInItem* pParentNode,
  42. LPTSTR pszServerAddress,
  43. bool fExtendingIAS
  44. );
  45. HRESULT SetSdo(
  46. ISdo* pSdoMachine,
  47. ISdoDictionaryOld* pSdoDictionary,
  48. BOOL fSdoConnected,
  49. BOOL fUseDS,
  50. BOOL fDSAvailable
  51. );
  52. HRESULT SetName(
  53. BOOL bPoliciesFromDirectoryService,
  54. LPWSTR szPolicyLocation,
  55. IConsole * pConsole
  56. );
  57. ~CPoliciesNode();
  58. // we can't do this because of the way this macro was
  59. // not written to support subclassing
  60. // BEGIN_SNAPINCOMMAND_MAP(CPoliciesNode, FALSE)
  61. // END_SNAPINCOMMAND_MAP()
  62. SNAPINMENUID(IDM_POLICIES_NODE)
  63. BEGIN_SNAPINTOOLBARID_MAP(CPoliciesNode)
  64. // SNAPINTOOLBARID_ENTRY(IDR_POLICIES_TOOLBAR)
  65. END_SNAPINTOOLBARID_MAP()
  66. BEGIN_SNAPINCOMMAND_MAP(CPolicyNode, TRUE)
  67. SNAPINCOMMAND_ENTRY(ID_MENUITEM_POLICIES_TOP__NEW_POLICY, OnNewPolicy)
  68. SNAPINCOMMAND_ENTRY(ID_MENUITEM_POLICIES_NEW__POLICY, OnNewPolicy)
  69. END_SNAPINCOMMAND_MAP()
  70. HRESULT OnNewPolicy( bool &bHandled, CSnapInObjectRootBase* pObj );
  71. void UpdateMenuState(UINT id, LPTSTR pBuf, UINT *flags);
  72. STDMETHOD(FillData)(CLIPFORMAT cf, LPSTREAM pStream);
  73. HRESULT DataRefresh(ISdo* pSdo, ISdoDictionaryOld* pDic);
  74. virtual HRESULT OnRefresh(
  75. LPARAM arg
  76. , LPARAM param
  77. , IComponentData * pComponentData
  78. , IComponent * pComponent
  79. , DATA_OBJECT_TYPES type
  80. );
  81. OLECHAR* GetResultPaneColInfo( int nCol );
  82. CComponentData * GetComponentData( void );
  83. HRESULT InsertColumns( IHeaderCtrl* pHeaderCtrl );
  84. HRESULT PopulateResultChildrenList( void );
  85. HRESULT MoveUpChild( CPolicyNode* pChildNode );
  86. HRESULT MoveDownChild( CPolicyNode* pChildNode );
  87. HRESULT NormalizeMerit( CPolicyNode* pAddedChildNode );
  88. HRESULT RemoveChild( CPolicyNode* pPolicyNode);
  89. int GetChildrenCount();
  90. CPolicyNode* FindChildWithName(LPCTSTR pszName); // search for a child
  91. bool m_fExtendingIAS; // are we extending IAS or something else?
  92. HRESULT AddDefaultProfileAttrs(
  93. ISdo* pProfileSdo,
  94. DWORD dwFlagExclude = 0
  95. );
  96. HRESULT AddProfAttr(ISdoCollection* pProfAttrCollectionSdo,
  97. ATTRIBUTEID AttrId,
  98. VARIANT* pvarValue
  99. );
  100. protected:
  101. BOOL CheckActivePropertyPages();
  102. virtual HRESULT SetVerbs( IConsoleVerb * pConsoleVerb );
  103. //
  104. // smart pointer to the NAP collection interface
  105. //
  106. CComPtr<ISdoCollection> m_spPoliciesCollectionSdo;
  107. CComPtr<ISdoCollection> m_spProfilesCollectionSdo;
  108. CComPtr<ISdoDictionaryOld> m_spDictionarySdo;
  109. CComPtr<ISdo> m_spDSNameSpaceSdo;
  110. CComPtr<ISdo> m_spLocalNameSpaceSdo;
  111. CComPtr<ISdo> m_spServiceSdo;
  112. CComPtr<IIASNASVendors> m_spIASNASVendors;
  113. // Smart pointer to interface for telling service to reload data.
  114. CComPtr<ISdoServiceControl> m_spSdoServiceControl;
  115. LPTSTR m_pszServerAddress; // address of the server that NAP currently
  116. // connect to
  117. CIASAttrList m_AttrList;
  118. BOOL m_fUseDS; // shall we use DS for policy location?
  119. BOOL m_fDSAvailable; // is DS available for that machine?
  120. public:
  121. BOOL m_fSdoConnected; // whether the SDOs have been connected
  122. private:
  123. enum ServerType
  124. {
  125. unknown,
  126. nt4,
  127. win2k,
  128. win5_1_or_later
  129. } m_serverType;
  130. HRESULT GetServerType();
  131. bool IsWin2kServer() throw();
  132. };
  133. #endif // _NAP_POLICIES_NODE_H_