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.

166 lines
4.7 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corporation, 1997 - 1999 **/
  4. /**********************************************************************/
  5. /*
  6. ipxcomp.h
  7. This file contains the prototypes for the derived classes
  8. for CComponent and CComponentData. Most of these functions
  9. are pure virtual functions that need to be overridden
  10. for snapin functionality.
  11. FILE HISTORY:
  12. */
  13. #include "resource.h" // main symbols
  14. #ifndef __mmc_h__
  15. #include <mmc.h>
  16. #endif
  17. #ifndef _CCDATA_H
  18. #include "ccdata.h"
  19. #endif
  20. #ifndef _COMPONT_H
  21. #include "compont.h"
  22. #endif
  23. #ifndef _COLUMN_H
  24. #include "column.h"
  25. #endif
  26. #ifndef _IPXSTRM_H
  27. #include "ipxstrm.h"
  28. #endif
  29. /*---------------------------------------------------------------------------
  30. CIPXComponentData
  31. This is the base implementation of ComponentData. This will be
  32. incorporated into the two derived classes.
  33. ---------------------------------------------------------------------------*/
  34. class CIPXComponentData :
  35. public CComponentData,
  36. public CComObjectRoot
  37. {
  38. public:
  39. BEGIN_COM_MAP(CIPXComponentData)
  40. COM_INTERFACE_ENTRY(IComponentData)
  41. COM_INTERFACE_ENTRY(IExtendPropertySheet)
  42. COM_INTERFACE_ENTRY(IExtendContextMenu)
  43. COM_INTERFACE_ENTRY(IPersistStreamInit)
  44. COM_INTERFACE_ENTRY(ISnapinHelp)
  45. END_COM_MAP()
  46. // These are the interfaces that we MUST implement
  47. // We will implement our common behavior here, with the derived
  48. // classes implementing the specific behavior.
  49. DeclareIPersistStreamInitMembers(IMPL)
  50. DeclareITFSCompDataCallbackMembers(IMPL)
  51. CIPXComponentData();
  52. HRESULT FinalConstruct();
  53. void FinalRelease();
  54. protected:
  55. SPITFSNodeMgr m_spNodeMgr;
  56. };
  57. /*---------------------------------------------------------------------------
  58. This is how the router snapin implements its extension functionality.
  59. It actually exposes two interfaces that are CoCreate-able. One is the
  60. primary interface, the other the extension interface.
  61. Author: EricDav
  62. ---------------------------------------------------------------------------*/
  63. class CIPXComponentDataExtension :
  64. public CIPXComponentData,
  65. public CComCoClass<CIPXComponentDataExtension, &CLSID_IPXAdminExtension>
  66. {
  67. public:
  68. DECLARE_REGISTRY(CIPXComponentDataExtension,
  69. _T("IPXRouterSnapinExtension.IPXRouterSnapinExtension.1"),
  70. _T("IPXRouterSnapinExtension.IPXRouterSnapinExtension"),
  71. IDS_SNAPIN_DESC, THREADFLAGS_BOTH)
  72. STDMETHOD_(const CLSID *, GetCoClassID)(){ return &CLSID_IPXAdminExtension; }
  73. };
  74. /////////////////////////////////////////////////////////////////////////////
  75. //
  76. // CSampleComponent
  77. //
  78. /////////////////////////////////////////////////////////////////////////////
  79. class CIPXComponent :
  80. public TFSComponent,
  81. public IPersistStreamInit
  82. {
  83. public:
  84. CIPXComponent();
  85. ~CIPXComponent();
  86. DeclareIUnknownMembers(IMPL)
  87. DeclareIPersistStreamInitMembers(IMPL)
  88. DeclareITFSCompCallbackMembers(IMPL)
  89. // Override OnQueryDataObject, so that we can forward
  90. // the calls down to the Result Handlers
  91. STDMETHOD(QueryDataObject)(MMC_COOKIE cookie, DATA_OBJECT_TYPES type,
  92. LPDATAOBJECT* ppDataObject);
  93. STDMETHOD(OnSnapinHelp)(LPDATAOBJECT, LPARAM, LPARAM);
  94. //Attributes
  95. private:
  96. IPXComponentConfigStream m_ComponentConfig;
  97. };
  98. /*---------------------------------------------------------------------------
  99. This is the derived class for handling the IAbout interface from MMC
  100. Author: EricDav
  101. ---------------------------------------------------------------------------*/
  102. class CIPXAbout :
  103. public CAbout,
  104. public CComCoClass<CIPXAbout, &CLSID_IPXAdminAbout>
  105. {
  106. public:
  107. DECLARE_REGISTRY(CIPXAbout,
  108. _T("RouterSnapin.About.1"),
  109. _T("RouterSnapin.About"),
  110. IDS_SNAPIN_DESC,
  111. THREADFLAGS_BOTH)
  112. BEGIN_COM_MAP(CIPXAbout)
  113. COM_INTERFACE_ENTRY(ISnapinAbout) // Must have one static entry
  114. COM_INTERFACE_ENTRY_CHAIN(CAbout) // chain to the base class
  115. END_COM_MAP()
  116. DECLARE_NOT_AGGREGATABLE(CIPXAbout)
  117. // these must be overridden to provide values to the base class
  118. protected:
  119. virtual UINT GetAboutDescriptionId() { return IDS_ABOUT_DESCRIPTION; }
  120. virtual UINT GetAboutProviderId() { return IDS_ABOUT_PROVIDER; }
  121. virtual UINT GetAboutVersionId() { return IDS_ABOUT_VERSION; }
  122. virtual UINT GetAboutIconId() { return IDI_IPX_SNAPIN_ICON; }
  123. virtual UINT GetSmallRootId() { return 0; }
  124. virtual UINT GetSmallOpenRootId() { return 0; }
  125. virtual UINT GetLargeRootId() { return 0; }
  126. virtual COLORREF GetLargeColorMask() { return (COLORREF) 0; }
  127. };