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.

124 lines
3.6 KiB

  1. //
  2. // Microsoft Corporation 1998
  3. //
  4. // DATAOBJ.H - IGPTDataobject
  5. //
  6. // {70f05689-5af0-41e6-a292-396697f04fce}
  7. DEFINE_GUID(IID_IGPTDataObject,
  8. 0x70f05689, 0x5af0, 0x41e6, 0xa2, 0x92, 0x39, 0x66, 0x97, 0xf0, 0x4f, 0xce);
  9. #ifndef _DATAOBJ_H_
  10. #define _DATAOBJ_H_
  11. //
  12. // This is a private dataobject interface for GPTs.
  13. // When the GPT snapin receives a dataobject and needs to determine
  14. // if it came from the GPT snapin or a different component, it can QI for
  15. // this interface.
  16. //
  17. #undef INTERFACE
  18. #define INTERFACE IGPTDataObject
  19. DECLARE_INTERFACE_(IGPTDataObject, IUnknown)
  20. {
  21. // *** IUnknown methods ***
  22. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  23. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  24. STDMETHOD_(ULONG,Release) (THIS) PURE;
  25. // *** IGPTDataObject methods ***
  26. STDMETHOD(SetType) (THIS_ DATA_OBJECT_TYPES type) PURE;
  27. STDMETHOD(GetType) (THIS_ DATA_OBJECT_TYPES *type) PURE;
  28. STDMETHOD(SetCookie) (THIS_ MMC_COOKIE cookie) PURE;
  29. STDMETHOD(GetCookie) (THIS_ MMC_COOKIE *cookie) PURE;
  30. };
  31. typedef IGPTDataObject *LPGPTDATAOBJECT;
  32. // CDataObject class
  33. class CDataObject : public IDataObject,
  34. public IGPTDataObject
  35. {
  36. friend class CSnapIn;
  37. protected:
  38. ULONG m_cRef;
  39. CComponentData *m_pcd;
  40. DATA_OBJECT_TYPES m_type;
  41. MMC_COOKIE m_cookie;
  42. // Clipboard formats that are required by the console
  43. static unsigned int m_cfNodeType;
  44. static unsigned int m_cfNodeTypeString;
  45. static unsigned int m_cfDisplayName;
  46. static unsigned int m_cfCoClass;
  47. public:
  48. CDataObject(CComponentData *pComponent);
  49. ~CDataObject();
  50. // IUnknown methods
  51. STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
  52. STDMETHODIMP_(ULONG) AddRef();
  53. STDMETHODIMP_(ULONG) Release();
  54. // Implemented IDataObject methods
  55. STDMETHOD(GetDataHere)(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium);
  56. // Unimplemented IDataObject methods
  57. STDMETHOD(GetData)(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium)
  58. { return E_NOTIMPL; };
  59. STDMETHOD(EnumFormatEtc)(DWORD dwDirection, LPENUMFORMATETC* ppEnumFormatEtc)
  60. { return E_NOTIMPL; };
  61. STDMETHOD(QueryGetData)(LPFORMATETC lpFormatetc)
  62. { return E_NOTIMPL; };
  63. STDMETHOD(GetCanonicalFormatEtc)(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut)
  64. { return E_NOTIMPL; };
  65. STDMETHOD(SetData)(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease)
  66. { return E_NOTIMPL; };
  67. STDMETHOD(DAdvise)(LPFORMATETC lpFormatetc, DWORD advf,
  68. LPADVISESINK pAdvSink, LPDWORD pdwConnection)
  69. { return E_NOTIMPL; };
  70. STDMETHOD(DUnadvise)(DWORD dwConnection)
  71. { return E_NOTIMPL; };
  72. STDMETHOD(EnumDAdvise)(LPENUMSTATDATA* ppEnumAdvise)
  73. { return E_NOTIMPL; };
  74. // Implemented IGPTDataObject methods
  75. STDMETHOD(SetType) (DATA_OBJECT_TYPES type)
  76. { m_type = type; return S_OK; };
  77. STDMETHOD(GetType) (DATA_OBJECT_TYPES *type)
  78. { *type = m_type; return S_OK; };
  79. STDMETHOD(SetCookie) (MMC_COOKIE cookie)
  80. { m_cookie = cookie; return S_OK; };
  81. STDMETHOD(GetCookie) (MMC_COOKIE *cookie)
  82. { *cookie = m_cookie; return S_OK; };
  83. private:
  84. HRESULT CreateNodeTypeData(LPSTGMEDIUM lpMedium);
  85. HRESULT CreateNodeTypeStringData(LPSTGMEDIUM lpMedium);
  86. HRESULT CreateDisplayName(LPSTGMEDIUM lpMedium);
  87. HRESULT CreateCoClassID(LPSTGMEDIUM lpMedium);
  88. HRESULT Create(LPVOID pBuffer, INT len, LPSTGMEDIUM lpMedium);
  89. };
  90. #endif // _DATAOBJ_H