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.

242 lines
6.1 KiB

  1. //============================================================================
  2. // Copyright (C) Microsoft Corporation, 1997 - 1999
  3. //
  4. // File: nbview.h
  5. //
  6. // History:
  7. // 10/02/97 Kenn M. Takara Created.
  8. //
  9. // IPX NetBIOS Broadcasts view
  10. //
  11. //============================================================================
  12. #ifndef _NBVIEW_H
  13. #define _NBVIEW_H
  14. #ifndef _BASEHAND_H
  15. #include "basehand.h"
  16. #endif
  17. #ifndef _HANDLERS_H
  18. #include "handlers.h"
  19. #endif
  20. #ifndef _XSTREAM_H
  21. #include "xstream.h" // need for ColumnData
  22. #endif
  23. #ifndef _INFO_H
  24. #include "info.h"
  25. #endif
  26. #ifndef _IPXFACE_H
  27. #include "ipxface.h"
  28. #endif
  29. #ifndef _BASECON_H
  30. #include "basecon.h" // BaseContainerHandler
  31. #endif
  32. #ifndef _IPXSTRM_H
  33. #include "ipxstrm.h"
  34. #endif
  35. #ifndef _RTRSHEET_H
  36. #include "rtrsheet.h"
  37. #endif
  38. #ifndef _IPXCONN_H
  39. #include "ipxconn.h" // IPXConnection
  40. #endif
  41. // forward declarations
  42. class IPXAdminConfigStream;
  43. struct SIpxNBNodeMenu;
  44. /*---------------------------------------------------------------------------
  45. This is the list of columns available for the IPX NetBIOS broadcasts
  46. node.
  47. - Interface, "[1] DEC DE500 ..."
  48. - Type, "Dedicated"
  49. - Accept Broadcasts, "Enabled"
  50. - Deliver Broadcasts, "Enabled"
  51. - Sent Broadcasts
  52. - Received Broadcasts
  53. ---------------------------------------------------------------------------*/
  54. //
  55. // If you ADD any columns to this enum, Be sure to update
  56. // the string ids for the column headers in summary.cpp
  57. //
  58. enum
  59. {
  60. IPXNB_SI_NAME = 0,
  61. IPXNB_SI_TYPE,
  62. IPXNB_SI_ACCEPTED,
  63. IPXNB_SI_DELIVERED,
  64. IPXNB_SI_SENT,
  65. IPXNB_SI_RECEIVED,
  66. IPXNB_MAX_COLUMNS
  67. };
  68. /*---------------------------------------------------------------------------
  69. We store a pointer to the IPXConnection object in our node data
  70. ---------------------------------------------------------------------------*/
  71. #define GET_IPXNB_NODEDATA(pNode) \
  72. (IPXConnection *) pNode->GetData(TFS_DATA_USER)
  73. #define SET_IPXNB_NODEDATA(pNode, pData) \
  74. pNode->SetData(TFS_DATA_USER, (LONG_PTR) pData)
  75. /*---------------------------------------------------------------------------
  76. Struct: IpxNBListEntry
  77. ---------------------------------------------------------------------------*/
  78. struct IpxNBArrayEntry
  79. {
  80. // Data retrieved from the interface
  81. TCHAR m_szId[256];
  82. BOOL m_fClient;
  83. // Data retrieved from the infobase
  84. DWORD m_dwAccept;
  85. DWORD m_dwDeliver;
  86. // Data retrieved from the MIBs
  87. DWORD m_cSent;
  88. DWORD m_cReceived;
  89. };
  90. typedef CArray<IpxNBArrayEntry, IpxNBArrayEntry&> IpxNBArray;
  91. /*---------------------------------------------------------------------------
  92. Class: IpxNBHandler
  93. ---------------------------------------------------------------------------*/
  94. class IpxNBHandler :
  95. public BaseContainerHandler
  96. {
  97. public:
  98. IpxNBHandler(ITFSComponentData *pTFSCompData);
  99. // Override QI to handle embedded interface
  100. STDMETHOD(QueryInterface)(REFIID iid, LPVOID *ppv);
  101. DeclareEmbeddedInterface(IRtrAdviseSink, IUnknown)
  102. // base handler functionality we override
  103. OVERRIDE_NodeHandler_HasPropertyPages();
  104. OVERRIDE_NodeHandler_GetString();
  105. OVERRIDE_NodeHandler_OnCreateDataObject();
  106. OVERRIDE_NodeHandler_OnAddMenuItems();
  107. OVERRIDE_NodeHandler_OnCommand();
  108. OVERRIDE_NodeHandler_DestroyHandler();
  109. OVERRIDE_BaseHandlerNotify_OnExpand();
  110. OVERRIDE_ResultHandler_AddMenuItems();
  111. OVERRIDE_ResultHandler_Command();
  112. OVERRIDE_ResultHandler_CompareItems();
  113. OVERRIDE_BaseResultHandlerNotify_OnResultShow();
  114. OVERRIDE_BaseResultHandlerNotify_OnResultRefresh();
  115. // Initializes the handler
  116. HRESULT Init(IRtrMgrInfo *pRtrMgrInfo, IPXAdminConfigStream *pConfigStream);
  117. // Initializes the node
  118. HRESULT ConstructNode(ITFSNode *pNode, LPCTSTR szName,
  119. IPXConnection *pIPXConn);
  120. public:
  121. // Structure used to pass data to callbacks - used as a way of
  122. // avoiding recomputation
  123. struct SMenuData
  124. {
  125. SPITFSNode m_spNode;
  126. };
  127. protected:
  128. // Refresh the data for these nodes
  129. HRESULT SynchronizeNodeData(ITFSNode *pThisNode);
  130. HRESULT GetIpxNBData(ITFSNode *pThisNode, IpxNBArray * pIpxNBArray);
  131. HRESULT GetClientInterfaceData(IpxNBArrayEntry *pClient, IRtrMgrInfo *pRm);
  132. // Helper function to add interfaces to the UI
  133. HRESULT AddInterfaceNode(ITFSNode *pParent, IInterfaceInfo *pIf, BOOL fClient);
  134. // Command implementations
  135. LONG_PTR m_ulConnId; // notification id for router info
  136. LONG_PTR m_ulRefreshConnId; // notification id for router refresh
  137. MMC_COOKIE m_cookie; // cookie for the node
  138. SPIRtrMgrInfo m_spRtrMgrInfo;
  139. IPXAdminConfigStream * m_pConfigStream;
  140. CString m_stTitle;
  141. };
  142. /*---------------------------------------------------------------------------
  143. Class: IpxNBInterfaceHandler
  144. This is the handler for the interface nodes that appear in the IPXNB
  145. node.
  146. ---------------------------------------------------------------------------*/
  147. class IpxNBInterfaceHandler : public BaseIPXResultHandler
  148. {
  149. public:
  150. IpxNBInterfaceHandler(ITFSComponentData *pCompData);
  151. OVERRIDE_NodeHandler_HasPropertyPages();
  152. OVERRIDE_NodeHandler_CreatePropertyPages();
  153. OVERRIDE_NodeHandler_OnCreateDataObject();
  154. OVERRIDE_ResultHandler_AddMenuItems();
  155. OVERRIDE_ResultHandler_Command();
  156. OVERRIDE_ResultHandler_OnCreateDataObject();
  157. OVERRIDE_ResultHandler_DestroyResultHandler();
  158. OVERRIDE_ResultHandler_HasPropertyPages()
  159. { return hrOK; };
  160. OVERRIDE_ResultHandler_CreatePropertyPages();
  161. // Initializes the node
  162. HRESULT ConstructNode(ITFSNode *pNode, IInterfaceInfo *pIfInfo,
  163. IPXConnection *pIPXConn);
  164. HRESULT Init(IRtrMgrInfo *pRm, IInterfaceInfo *pInfo,
  165. ITFSNode *pParent);
  166. // Refresh the data for this node
  167. void RefreshInterface(MMC_COOKIE cookie);
  168. public:
  169. // Structure used to pass data to callbacks - used as a way of
  170. // avoiding recomputation
  171. struct SMenuData
  172. {
  173. ULONG m_ulMenuId;
  174. SPITFSNode m_spNode;
  175. };
  176. ULONG GetSeparatorFlags(SMenuData *pData);
  177. protected:
  178. LONG_PTR m_ulConnId;
  179. SPIRtrMgrInfo m_spRm;
  180. SPIInterfaceInfo m_spInterfaceInfo;
  181. };
  182. #endif _NBVIEW_H