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.

177 lines
4.4 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1998 **/
  4. /**********************************************************************/
  5. /*
  6. DMVumstrm.h
  7. DMVum node configuration object.
  8. Use this to get/set configuration data. This class will take
  9. care of versioning of config formats as well as serializing
  10. of the data.
  11. FILE HISTORY:
  12. */
  13. #ifndef _DMVSTRM_H
  14. #define _DMVSTRM_H
  15. #ifndef _XSTREAM_H
  16. #include "xstream.h"
  17. #endif
  18. #ifndef _COLUMN_H
  19. #include "column.h"
  20. #endif
  21. #ifndef AFX_DLGSVR_H__19556672_96AB_11D1_8575_00C04FC31FD3__INCLUDED_
  22. #include "rrasqry.h"
  23. #endif
  24. #ifndef _VECTOR_
  25. #include <vector>
  26. using namespace std;
  27. #endif
  28. //forwards
  29. class DMVRootHandler;
  30. enum
  31. {
  32. DMVSTRM_STATS_DMVNBR = 0,
  33. DMVSTRM_IFSTATS_DMVNBR,
  34. DMVSTRM_STATS_COUNT,
  35. };
  36. enum DMVSTRM_TAG
  37. {
  38. DMVSTRM_TAG_VERSION = XFER_TAG(1, XFER_DWORD),
  39. DMVSTRM_TAG_VERSIONADMIN = XFER_TAG(2, XFER_DWORD),
  40. DMVSTRM_TAG_SIZEQRY = XFER_TAG(3, XFER_DWORD),
  41. DMVSTRM_TAG_NUMQRY = XFER_TAG(4, XFER_DWORD),
  42. DMVSTRM_TAG_NUMSRV = XFER_TAG(5, XFER_DWORD),
  43. DMVSTRM_TAG_CATFLAG = XFER_TAG(6, XFER_DWORD),
  44. DMVSTRM_TAG_SCOPE = XFER_TAG(7, XFER_STRING),
  45. DMVSTRM_TAG_FILTER = XFER_TAG(8, XFER_STRING),
  46. DMVSTRM_TAG_SERVERNAME = XFER_TAG(9, XFER_STRING),
  47. DMVSTRM_TAG_IFAUTOREFRESHISON = XFER_TAG(10, XFER_DWORD),
  48. DMVSTRM_TAG_AUTOREFRESHINTERVAL = XFER_TAG(11, XFER_DWORD),
  49. };
  50. //
  51. // This class is the container of persisted domain queries
  52. //
  53. class RRASQryPersist
  54. {
  55. friend class DomainStatusHandler;
  56. public:
  57. RRASQryPersist()
  58. {
  59. m_dwSizeQry=0;
  60. m_dwNumQry=0;
  61. m_dwNumSrv=0;
  62. }
  63. ~RRASQryPersist()
  64. {
  65. removeAllSrv();
  66. removeAllQry();
  67. }
  68. //create dwNum empty queries
  69. HRESULT createQry(DWORD dwNum);
  70. //create dwNum empty servers
  71. HRESULT createSrv(DWORD dwNum);
  72. //push query data into container
  73. HRESULT add_Qry(const RRASQryData& qd);
  74. //push server into container
  75. HRESULT add_Srv(const CString& szServer);
  76. //remove all servernames
  77. HRESULT removeAllSrv();
  78. //remove all queries
  79. HRESULT removeAllQry();
  80. private:
  81. DWORD m_dwSizeQry;
  82. DWORD m_dwNumQry;
  83. DWORD m_dwNumSrv;
  84. //position [0] is the general (many machine) singleton query.
  85. //positions[1] .. n are the specific machine queries.
  86. vector<RRASQryData*> m_v_pQData;
  87. //persisted server names
  88. vector<CString*> m_v_pSData;
  89. friend class DMVRootHandler;
  90. friend class DMVConfigStream;
  91. };
  92. /*---------------------------------------------------------------------------
  93. Class: DMVConfigStream
  94. This holds the configuration information for the IP administration
  95. nodes. This does NOT hold the configuration information for the columns.
  96. That is stored in the Component Configuration streams.
  97. ---------------------------------------------------------------------------*/
  98. class DMVConfigStream : public ConfigStream
  99. {
  100. public:
  101. DMVConfigStream();
  102. virtual HRESULT InitNew(); // set defaults
  103. virtual HRESULT SaveTo(IStream *pstm);
  104. virtual HRESULT SaveAs(UINT nVersion, IStream *pstm);
  105. virtual HRESULT LoadFrom(IStream *pstm);
  106. virtual HRESULT GetSize(ULONG *pcbSize);
  107. // --------------------------------------------------------
  108. // Accessors
  109. // --------------------------------------------------------
  110. virtual HRESULT GetVersionInfo(DWORD *pnVersion, DWORD *pnAdminVersion);
  111. DWORD m_bAutoRefresh;
  112. DWORD m_dwRefreshInterval;
  113. //persist the domain view query
  114. RRASQryPersist m_RQPersist;
  115. void Init(DMVRootHandler* dmvroot, ITFSNode *pNode )
  116. {
  117. m_pDMVRootHandler=dmvroot;
  118. m_pDMVRootNode=pNode;
  119. }
  120. private:
  121. HRESULT PrepareAutoRefreshDataForSave();
  122. HRESULT XferVersion0(IStream *pstm, XferStream::Mode mode, ULONG *pcbSize);
  123. DMVRootHandler* m_pDMVRootHandler;
  124. ITFSNode* m_pDMVRootNode;
  125. };
  126. class DVComponentConfigStream : public ConfigStream
  127. {
  128. public:
  129. virtual HRESULT XferVersion0(IStream *pstm, XferStream::Mode mode, ULONG *pcbSize);
  130. protected:
  131. };
  132. #endif _DMVSTRM_H