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.

128 lines
4.2 KiB

  1. //==============================================================;
  2. //
  3. // This source code is only intended as a supplement to existing Microsoft documentation.
  4. //
  5. //
  6. //
  7. //
  8. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  9. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  10. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  11. // PURPOSE.
  12. //
  13. // Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  14. //
  15. //
  16. //
  17. //==============================================================;
  18. #ifndef _CNamespaceExtension_H_
  19. #define _CNamespaceExtension_H_
  20. #include <tchar.h>
  21. #include <mmc.h>
  22. #include <crtdbg.h>
  23. #include "DeleBase.h"
  24. #include "globals.h"
  25. #include "resource.h"
  26. #include "LocalRes.h"
  27. class CComponentData : public IComponentData,
  28. IExtendContextMenu
  29. {
  30. friend class CComponent;
  31. private:
  32. ULONG m_cref;
  33. LPCONSOLE m_ipConsole;
  34. LPCONSOLENAMESPACE m_ipConsoleNameSpace;
  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 format
  42. static UINT s_cfDisplayName;
  43. static UINT s_cfSnapInCLSID;
  44. static UINT s_cfNodeType;
  45. // {2974380F-4C4B-11d2-89D8-000021473128}
  46. static const GUID skybasedvehicleGuid;
  47. public:
  48. CComponentData();
  49. ~CComponentData();
  50. const GUID & getPrimaryNodeType() { return skybasedvehicleGuid; }
  51. HRESULT OnExpand(IConsoleNameSpace *pConsoleNameSpace, IConsole *pConsole, HSCOPEITEM parent);
  52. ///////////////////////////////
  53. // Interface IUnknown
  54. ///////////////////////////////
  55. STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
  56. STDMETHODIMP_(ULONG) AddRef();
  57. STDMETHODIMP_(ULONG) Release();
  58. ///////////////////////////////
  59. // Interface IComponentData
  60. ///////////////////////////////
  61. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Initialize(
  62. /* [in] */ LPUNKNOWN pUnknown);
  63. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateComponent(
  64. /* [out] */ LPCOMPONENT __RPC_FAR *ppComponent);
  65. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Notify(
  66. /* [in] */ LPDATAOBJECT lpDataObject,
  67. /* [in] */ MMC_NOTIFY_TYPE event,
  68. /* [in] */ LPARAM arg,
  69. /* [in] */ LPARAM param);
  70. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Destroy( void);
  71. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE QueryDataObject(
  72. /* [in] */ MMC_COOKIE cookie,
  73. /* [in] */ DATA_OBJECT_TYPES type,
  74. /* [out] */ LPDATAOBJECT __RPC_FAR *ppDataObject);
  75. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDisplayInfo(
  76. /* [out][in] */ SCOPEDATAITEM __RPC_FAR *pScopeDataItem);
  77. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CompareObjects(
  78. /* [in] */ LPDATAOBJECT lpDataObjectA,
  79. /* [in] */ LPDATAOBJECT lpDataObjectB);
  80. ///////////////////////////////
  81. // Interface IExtendContextMenu
  82. ///////////////////////////////
  83. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AddMenuItems(
  84. /* [in] */ LPDATAOBJECT piDataObject,
  85. /* [in] */ LPCONTEXTMENUCALLBACK piCallback,
  86. /* [out][in] */ long __RPC_FAR *pInsertionAllowed);
  87. virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Command(
  88. /* [in] */ long lCommandID,
  89. /* [in] */ LPDATAOBJECT piDataObject);
  90. public:
  91. static HBITMAP m_pBMapSm;
  92. static HBITMAP m_pBMapLg;
  93. protected:
  94. static void LoadBitmaps() {
  95. m_pBMapSm = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_SMICONS));
  96. m_pBMapLg = LoadBitmap(g_hinst, MAKEINTRESOURCE(IDR_LGICONS));
  97. }
  98. BOOL bExpanded;
  99. };
  100. #endif _CNamespaceExtension_H_