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.

187 lines
5.4 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1998 **/
  4. /**********************************************************************/
  5. /*
  6. */
  7. #ifndef _DMVCOMP_H
  8. #define _DMVCOMP_H
  9. #include "resource.h" // main symbols
  10. #ifndef __mmc_h__
  11. #include <mmc.h>
  12. #endif
  13. #ifndef _CCDATA_H
  14. #include "ccdata.h"
  15. #endif
  16. #ifndef _COMPONT_H
  17. #include "compont.h"
  18. #endif
  19. #ifndef _RTRSTRM_H
  20. #include "rtrstrm.h"
  21. #endif
  22. #ifndef _COLUMN_H
  23. #include "column.h"
  24. #endif
  25. #ifndef _DMVSTRM_H
  26. #include "dmvstrm.h"
  27. #endif
  28. enum
  29. {
  30. DM_COLUMNS_DVSUM = 0,
  31. DM_COLUMNS_IFADMIN=1,
  32. DM_COLUMNS_DIALIN=2,
  33. DM_COLUMNS_PORTS = 3,
  34. DM_COLUMNS_MAX_COUNT,
  35. };
  36. #define COLORREF_PINK 0x00FF00FF
  37. /*---------------------------------------------------------------------------
  38. CDMVComponentData
  39. This is the base implementation of ComponentData. This will be
  40. incorporated into the two derived classes.
  41. ---------------------------------------------------------------------------*/
  42. class CDMVComponentData :
  43. public CComponentData,
  44. public CComObjectRoot
  45. {
  46. public:
  47. BEGIN_COM_MAP(CDMVComponentData)
  48. COM_INTERFACE_ENTRY(IComponentData)
  49. COM_INTERFACE_ENTRY(IExtendPropertySheet)
  50. COM_INTERFACE_ENTRY(IExtendContextMenu)
  51. COM_INTERFACE_ENTRY(IPersistStreamInit)
  52. COM_INTERFACE_ENTRY(ISnapinHelp)
  53. END_COM_MAP()
  54. public:
  55. // These are the interfaces that we MUST implement
  56. // We will implement our common behavior here, with the derived
  57. // classes implementing the specific behavior.
  58. DeclareIPersistStreamInitMembers(IMPL)
  59. DeclareITFSCompDataCallbackMembers(IMPL)
  60. CDMVComponentData();
  61. ~CDMVComponentData();
  62. HRESULT FinalConstruct();
  63. void FinalRelease();
  64. protected:
  65. SPITFSNodeMgr m_spNodeMgr;
  66. private:
  67. WATERMARKINFO m_WatermarkInfo;
  68. };
  69. /////////////////////////////////////////////////////////////////////////////
  70. //
  71. // CDMVComponent
  72. //
  73. /////////////////////////////////////////////////////////////////////////////
  74. class CDMVComponent :
  75. public TFSComponent,
  76. public IPersistStreamInit
  77. {
  78. public:
  79. CDMVComponent();
  80. ~CDMVComponent();
  81. DeclareIUnknownMembers(IMPL)
  82. DeclareIPersistStreamInitMembers(IMPL)
  83. DeclareITFSCompCallbackMembers(IMPL)
  84. // Override OnQueryDataObject, so that we can forward
  85. // the calls down to the Result Handlers
  86. STDMETHOD(QueryDataObject)(MMC_COOKIE cookie, DATA_OBJECT_TYPES type,
  87. LPDATAOBJECT* ppDataObject);
  88. STDMETHOD(OnSnapinHelp)(LPDATAOBJECT pDataObject, LPARAM arg, LPARAM param);
  89. //Attributes
  90. protected:
  91. // This is used to store view information. A pointer to this
  92. // object is used as the GetString() lParam.
  93. DVComponentConfigStream m_ComponentConfig;
  94. };
  95. /////////////////////////////////////////////////////////////////////////////
  96. // Domain View Snapin
  97. class CDomainViewSnap :
  98. public CDMVComponentData,
  99. public CComCoClass<CDomainViewSnap, &CLSID_RouterSnapin>
  100. {
  101. public:
  102. DECLARE_REGISTRY(CDMVComponentData,
  103. _T("DomainViewSnapin.DomainViewSnapin.1"),
  104. _T("DomainViewSnapin.DomainViewSnapin"),
  105. IDS_DMV_DESC, THREADFLAGS_APARTMENT)
  106. STDMETHOD_(const CLSID *,GetCoClassID()){ return &CLSID_RouterSnapin; }
  107. };
  108. class CDomainViewSnapExtension :
  109. public CDMVComponentData,
  110. public CComCoClass<CDomainViewSnapExtension, &CLSID_RouterSnapinExtension>
  111. {
  112. public:
  113. DECLARE_REGISTRY(CDomainViewSnapExtension,
  114. _T("CDomainViewSnapExtension.CDomainViewSnapExtension.1"),
  115. _T("CDomainViewSnapExtension.CDomainViewSnapExtension"),
  116. IDS_DMV_DESC, THREADFLAGS_APARTMENT)
  117. STDMETHODIMP_(const CLSID *)GetCoClassID() { return &CLSID_RouterSnapinExtension; }
  118. };
  119. /*---------------------------------------------------------------------------
  120. This is the derived class for handling the IAbout interface from MMC
  121. Author: EricDav
  122. ---------------------------------------------------------------------------*/
  123. class CDomainViewSnapAbout :
  124. public CAbout,
  125. public CComCoClass<CDomainViewSnapAbout, &CLSID_RouterSnapinAbout>
  126. {
  127. public:
  128. DECLARE_REGISTRY(CDomainViewSnapAbout,
  129. _T("DomainViewSnapin.About.1"),
  130. _T("DomainViewSnapin.About"),
  131. IDS_SNAPIN_DESC,
  132. THREADFLAGS_BOTH)
  133. BEGIN_COM_MAP(CDomainViewSnapAbout)
  134. COM_INTERFACE_ENTRY(ISnapinAbout) // Must have one static entry
  135. COM_INTERFACE_ENTRY_CHAIN(CAbout) // chain to the base class
  136. END_COM_MAP()
  137. DECLARE_NOT_AGGREGATABLE(CDomainViewSnapAbout)
  138. // these must be overridden to provide values to the base class
  139. //???? need to change to doamin
  140. protected:
  141. virtual UINT GetAboutDescriptionId() { return IDS_DMV_ABOUT_DESCRIPTION; }
  142. virtual UINT GetAboutProviderId() { return IDS_ABOUT_PROVIDER; }
  143. virtual UINT GetAboutVersionId() { return IDS_ABOUT_VERSION; }
  144. virtual UINT GetAboutIconId() { return IDI_SNAPIN_ICON; }
  145. virtual UINT GetSmallRootId() { return IDB_ROOT_SMALL; }
  146. virtual UINT GetSmallOpenRootId() { return IDB_ROOT_SMALL; }
  147. virtual UINT GetLargeRootId() { return IDB_ROOT_LARGE; }
  148. virtual COLORREF GetLargeColorMask() { return (COLORREF) COLORREF_PINK; }
  149. };
  150. #endif _DMVCOMP_H