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.

158 lines
4.5 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. /*++
  3. Copyright (C) Microsoft Corporation
  4. Module Name:
  5. LogCompD.cpp
  6. Abstract:
  7. The CLoggingComponentData class implements several interfaces which MMC uses:
  8. The IComponentData interface is basically how MMC talks to the snap-in
  9. to get it to implement the left-hand-side "scope" pane.
  10. The IExtendPropertySheet interface is how the snap-in adds property sheets
  11. for any of the items a user might click on.
  12. The IExtendContextMenu interface what we do to add custom entries
  13. to the menu which appears when a user right-clicks on a node.
  14. The IExtendControlBar interface allows us to support a custom
  15. iconic toolbar.
  16. See ComponentData.cpp for implementation.
  17. Note:
  18. Much of the functionality of this class is implemented in atlsnap.h
  19. by IComponentDataImpl. We are mostly overriding here.
  20. Revision History:
  21. mmaguire 11/6/97 - created using MMC snap-in wizard
  22. --*/
  23. //////////////////////////////////////////////////////////////////////////////
  24. #if !defined(_LOG_COMPONENT_DATA_H_)
  25. #define _LOG_COMPONENT_DATA_H_
  26. #pragma once
  27. //////////////////////////////////////////////////////////////////////////////
  28. // BEGIN INCLUDES
  29. //
  30. // where we can find what this class derives from:
  31. //
  32. //Moved to Precompiled.h: #include <atlsnap.h>
  33. //
  34. //
  35. // where we can find what this class has or uses:
  36. //
  37. #include "LogMacNd.h"
  38. //
  39. // END INCLUDES
  40. //////////////////////////////////////////////////////////////////////////////
  41. //
  42. // hack start
  43. //
  44. // This is a big hack to work around a atlsnap.h bug: Atlsnap.h
  45. // can't support extending multiple nodes. So we basically just
  46. // copied EXTENSION_SNAPIN_NODEINFO_ENTRY() here. We need to change
  47. // this after the atlsnap.h fix -- MAM: 08-06-98 -- yeah right
  48. //
  49. //
  50. // The following statements are copied from atlsnap.h and then changed
  51. // to support multiple extending node
  52. //
  53. // IsSupportedGUID will also set the m_enumExtendedSnapin flag in side m_##dataClass object
  54. // which, in our case, is CLoggingMachineNode
  55. //
  56. #define EXTENSION_SNAPIN_NODEINFO_ENTRY_EX(dataClass) \
  57. if ( m_##dataClass.IsSupportedGUID( guid ) )\
  58. { \
  59. *ppItem = m_##dataClass.GetExtNodeObject(pDataObject, &m_##dataClass); \
  60. _ASSERTE(*ppItem != NULL); \
  61. (*ppItem)->InitDataClass(pDataObject, &m_##dataClass); \
  62. return hr; \
  63. }
  64. //
  65. // hack end
  66. //
  67. class CLoggingComponent;
  68. class CLoggingComponentData :
  69. public CComObjectRootEx<CComSingleThreadModel>
  70. , public CSnapInObjectRoot<1, CLoggingComponentData>
  71. , public IComponentDataImpl<CLoggingComponentData, CLoggingComponent>
  72. , public IExtendPropertySheetImpl<CLoggingComponentData>
  73. , public IExtendContextMenuImpl<CLoggingComponentData>
  74. , public IExtendControlbarImpl<CLoggingComponentData>
  75. , public ISnapinHelp
  76. , public CComCoClass<CLoggingComponentData, &CLSID_LoggingSnapin>,
  77. private IASTraceInitializer
  78. {
  79. public:
  80. CLoggingComponentData();
  81. ~CLoggingComponentData();
  82. DECLARE_NO_REGISTRY()
  83. EXTENSION_SNAPIN_DATACLASS(CLoggingMachineNode)
  84. BEGIN_EXTENSION_SNAPIN_NODEINFO_MAP(CLoggingComponentData)
  85. EXTENSION_SNAPIN_NODEINFO_ENTRY_EX(CLoggingMachineNode)
  86. END_EXTENSION_SNAPIN_NODEINFO_MAP()
  87. BEGIN_COM_MAP(CLoggingComponentData)
  88. COM_INTERFACE_ENTRY(IComponentData)
  89. COM_INTERFACE_ENTRY(IExtendPropertySheet2)
  90. COM_INTERFACE_ENTRY(IExtendContextMenu)
  91. COM_INTERFACE_ENTRY(IExtendControlbar)
  92. COM_INTERFACE_ENTRY(ISnapinHelp)
  93. END_COM_MAP()
  94. DECLARE_NOT_AGGREGATABLE(CLoggingComponentData)
  95. STDMETHOD(Initialize)(LPUNKNOWN pUnknown);
  96. STDMETHOD(CompareObjects)(
  97. LPDATAOBJECT lpDataObjectA
  98. , LPDATAOBJECT lpDataObjectB
  99. );
  100. STDMETHOD(CreateComponent)(LPCOMPONENT *ppComponent);
  101. // ISnapinHelp method(s)
  102. STDMETHOD(GetHelpTopic)(LPOLESTR * lpCompiledHelpFile)
  103. {return E_UNEXPECTED;};
  104. // We are overiding ATLsnap.h's IComponentImpl implementation of this
  105. // in order to correctly handle messages which it is incorrectly
  106. // ignoring (e.g. MMCN_COLUMN_CLICK and MMCN_SNAPINHELP)
  107. STDMETHOD(Notify)(
  108. LPDATAOBJECT lpDataObject
  109. , MMC_NOTIFY_TYPE event
  110. , LPARAM arg
  111. , LPARAM param
  112. );
  113. virtual HRESULT OnPropertyChange(
  114. LPARAM arg
  115. , LPARAM param
  116. );
  117. };
  118. #endif // _LOG_COMPONENT_DATA_H_