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.

121 lines
4.0 KiB

  1. //==============================================================;
  2. //
  3. // This source code is only intended as a supplement to existing Microsoft documentation.
  4. //
  5. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  6. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  7. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  8. // PURPOSE.
  9. //
  10. // Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  11. //==============================================================;
  12. // ClassExtSnap.h : Declaration of the CClassExtSnap
  13. #ifndef __CLASSEXTSNAP_H_
  14. #define __CLASSEXTSNAP_H_
  15. #include <mmc.h>
  16. #include "ExtSnap.h"
  17. #include "DeleBase.h"
  18. #include <tchar.h>
  19. #include <crtdbg.h>
  20. #include "globals.h" // main symbols
  21. #include "resource.h"
  22. #include "LocalRes.h"
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CClassExtSnap
  25. class ATL_NO_VTABLE CClassExtSnap :
  26. public CComObjectRootEx<CComSingleThreadModel>,
  27. public CComCoClass<CClassExtSnap, &CLSID_ClassExtSnap>,
  28. public IClassExtSnap, IComponentData//, IExtendContextMenu
  29. {
  30. friend class CComponent;
  31. private:
  32. ULONG m_cref;
  33. LPCONSOLE2 m_ipConsole2;
  34. LPCONSOLENAMESPACE2 m_ipConsoleNameSpace2;
  35. HRESULT ExtractObjectTypeGUID( IDataObject* piDataObject, GUID* pguidObjectType );
  36. HRESULT ExtractSnapInCLSID( IDataObject* piDataObject, CLSID* pclsidSnapin );
  37. HRESULT ExtractString( IDataObject *piDataObject, CLIPFORMAT cfClipFormat, _TCHAR *pstr, DWORD cchMaxLength);
  38. HRESULT ExtractData( IDataObject* piDataObject, CLIPFORMAT cfClipFormat, BYTE* pbData, DWORD cbData );
  39. enum { NUMBER_OF_CHILDREN = 1 };
  40. CDelegationBase *children[1];
  41. // Clipboard formats needed for extending Computer Management
  42. static UINT s_cfMachineName;
  43. static UINT s_cfSnapInCLSID;
  44. static UINT s_cfNodeType;
  45. // {476e6449-aaff-11d0-b944-00c04fd8d5b0}
  46. static const GUID structuuidNodetypeServerApps;
  47. public:
  48. CClassExtSnap();
  49. ~CClassExtSnap();
  50. const GUID & getPrimaryNodeType() { return structuuidNodetypeServerApps; }
  51. HRESULT CreateChildNode(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent, _TCHAR *pszMachineName);
  52. static HBITMAP m_pBMapSm;
  53. static HBITMAP m_pBMapLg;
  54. DECLARE_REGISTRY_RESOURCEID(IDR_CLASSEXTSNAP)
  55. DECLARE_NOT_AGGREGATABLE(CClassExtSnap)
  56. DECLARE_PROTECT_FINAL_CONSTRUCT()
  57. BEGIN_COM_MAP(CClassExtSnap)
  58. COM_INTERFACE_ENTRY(IComponentData)
  59. END_COM_MAP()
  60. public:
  61. ///////////////////////////////
  62. // Interface IComponentData
  63. ///////////////////////////////
  64. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
  65. /* [in] */ LPUNKNOWN pUnknown);
  66. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateComponent(
  67. /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent);
  68. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Notify(
  69. /* [in] */ LPDATAOBJECT lpDataObject,
  70. /* [in] */ MMC_NOTIFY_TYPE event,
  71. /* [in] */ LPARAM arg,
  72. /* [in] */ LPARAM param);
  73. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Destroy( void);
  74. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryDataObject(
  75. /* [in] */ MMC_COOKIE cookie,
  76. /* [in] */ DATA_OBJECT_TYPES type,
  77. /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
  78. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDisplayInfo(
  79. /* [out][in] */ SCOPEDATAITEM __RPC_FAR *pScopeDataItem);
  80. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CompareObjects(
  81. /* [in] */ LPDATAOBJECT lpDataObjectA,
  82. /* [in] */ LPDATAOBJECT lpDataObjectB);
  83. protected:
  84. static void LoadBitmaps() {
  85. m_pBMapSm = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_SMICONS));
  86. m_pBMapLg = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_LGICONS));
  87. }
  88. BOOL bExpanded;
  89. };
  90. #endif //__CLASSEXTSNAP_H_