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.

147 lines
3.5 KiB

  1. //
  2. // IID_IIEAKDataObject interface id
  3. //
  4. // {C14C50E2-FA21-11d0-8CF9-C64377000000}
  5. DEFINE_GUID(IID_IIEAKDataObject,0xc14c50e2, 0xfa21, 0x11d0, 0x8c, 0xf9, 0xc6, 0x43, 0x77, 0x0, 0x0, 0x0);
  6. #ifndef _DATAOBJ_H_
  7. #define _DATAOBJ_H_
  8. //
  9. // This is a private dataobject interface for our extension.
  10. // When the IEAK snapin extension receives a dataobject and needs to determine
  11. // if it came from the IEAK snapin extension or a different component, it can QI for
  12. // this interface.
  13. //
  14. #undef INTERFACE
  15. #define INTERFACE IIEAKDataObject
  16. DECLARE_INTERFACE_(IIEAKDataObject, IUnknown)
  17. {
  18. // *** IUnknown methods ***
  19. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  20. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  21. STDMETHOD_(ULONG,Release) (THIS) PURE;
  22. // *** IIEAKDataObject methods ***
  23. STDMETHOD(SetType) (THIS_ DATA_OBJECT_TYPES type) PURE;
  24. STDMETHOD(GetType) (THIS_ DATA_OBJECT_TYPES *type) PURE;
  25. STDMETHOD(SetCookie) (THIS_ MMC_COOKIE cookie) PURE;
  26. STDMETHOD(GetCookie) (THIS_ MMC_COOKIE *cookie) PURE;
  27. };
  28. typedef IIEAKDataObject *LPIEAKDATAOBJECT;
  29. //
  30. // CDataObject class
  31. //
  32. class CDataObject : public IDataObject,
  33. public IIEAKDataObject
  34. {
  35. friend class CSnapIn;
  36. protected:
  37. ULONG m_cRef;
  38. CComponentData *m_pcd;
  39. DATA_OBJECT_TYPES m_type;
  40. MMC_COOKIE m_cookie;
  41. //
  42. // Clipboard formats that are required by the console
  43. //
  44. static unsigned int m_cfNodeType;
  45. static unsigned int m_cfNodeTypeString;
  46. static unsigned int m_cfDisplayName;
  47. static unsigned int m_cfCoClass;
  48. public:
  49. CDataObject(CComponentData *pComponent);
  50. ~CDataObject();
  51. //
  52. // IUnknown methods
  53. //
  54. STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
  55. STDMETHODIMP_(ULONG) AddRef();
  56. STDMETHODIMP_(ULONG) Release();
  57. //
  58. // Implemented IDataObject methods
  59. //
  60. STDMETHOD(GetDataHere)(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium);
  61. //
  62. // Unimplemented IDataObject methods
  63. //
  64. STDMETHOD(GetData)(LPFORMATETC, LPSTGMEDIUM)
  65. { return E_NOTIMPL; };
  66. STDMETHOD(EnumFormatEtc)(DWORD, LPENUMFORMATETC*)
  67. { return E_NOTIMPL; };
  68. STDMETHOD(QueryGetData)(LPFORMATETC)
  69. { return E_NOTIMPL; };
  70. STDMETHOD(GetCanonicalFormatEtc)(LPFORMATETC, LPFORMATETC)
  71. { return E_NOTIMPL; };
  72. STDMETHOD(SetData)(LPFORMATETC, LPSTGMEDIUM, BOOL)
  73. { return E_NOTIMPL; };
  74. STDMETHOD(DAdvise)(LPFORMATETC, DWORD, LPADVISESINK, LPDWORD)
  75. { return E_NOTIMPL; };
  76. STDMETHOD(DUnadvise)(DWORD)
  77. { return E_NOTIMPL; };
  78. STDMETHOD(EnumDAdvise)(LPENUMSTATDATA*)
  79. { return E_NOTIMPL; };
  80. //
  81. // Implemented IIEAKDataObject methods
  82. //
  83. STDMETHOD(SetType) (DATA_OBJECT_TYPES type)
  84. { m_type = type; return S_OK; };
  85. STDMETHOD(GetType) (DATA_OBJECT_TYPES *type)
  86. { *type = m_type; return S_OK; };
  87. STDMETHOD(SetCookie) (MMC_COOKIE cookie)
  88. { m_cookie = cookie; return S_OK; };
  89. STDMETHOD(GetCookie) (MMC_COOKIE *cookie)
  90. { *cookie = m_cookie; return S_OK; };
  91. private:
  92. HRESULT CreateNodeTypeData(LPSTGMEDIUM lpMedium);
  93. HRESULT CreateNodeTypeStringData(LPSTGMEDIUM lpMedium);
  94. HRESULT CreateDisplayName(LPSTGMEDIUM lpMedium);
  95. HRESULT CreateCoClassID(LPSTGMEDIUM lpMedium);
  96. HRESULT Create(LPVOID pBuffer, INT len, LPSTGMEDIUM lpMedium);
  97. };
  98. #endif // _DATAOBJ_H