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.

88 lines
2.4 KiB

  1. #ifndef _SAMPDATAOBJECT_H_
  2. #define _SAMPDATAOBJECT_H_
  3. #include <mmc.h>
  4. #include "delebase.h"
  5. class CDataObject : public IDataObject
  6. {
  7. private:
  8. ULONG m_cref;
  9. MMC_COOKIE m_lCookie;
  10. DATA_OBJECT_TYPES m_context;
  11. public:
  12. CDataObject( MMC_COOKIE cookie, DATA_OBJECT_TYPES context );
  13. ~CDataObject();
  14. ///////////////////////////////
  15. // Interface IUnknown
  16. ///////////////////////////////
  17. STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
  18. STDMETHODIMP_(ULONG) AddRef();
  19. STDMETHODIMP_(ULONG) Release();
  20. ///////////////////////////////
  21. // IDataObject methods
  22. ///////////////////////////////
  23. STDMETHODIMP GetDataHere ( FORMATETC *pformatetc, STGMEDIUM *pmedium );
  24. //
  25. // The rest are not implemented
  26. //
  27. STDMETHODIMP GetData (LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium)
  28. { return E_NOTIMPL; };
  29. STDMETHODIMP EnumFormatEtc (DWORD dwDirection, LPENUMFORMATETC* ppEnumFormatEtc)
  30. { return E_NOTIMPL; };
  31. STDMETHODIMP QueryGetData (LPFORMATETC lpFormatetc)
  32. { return E_NOTIMPL; };
  33. STDMETHODIMP GetCanonicalFormatEtc (LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut)
  34. { return E_NOTIMPL; };
  35. STDMETHODIMP SetData (LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease)
  36. { return E_NOTIMPL; };
  37. STDMETHODIMP DAdvise (LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection)
  38. { return E_NOTIMPL; };
  39. STDMETHODIMP DUnadvise (DWORD dwConnection)
  40. { return E_NOTIMPL; };
  41. STDMETHODIMP EnumDAdvise (LPENUMSTATDATA* ppEnumAdvise)
  42. { return E_NOTIMPL; };
  43. ///////////////////////////////
  44. // Custom Methods
  45. ///////////////////////////////
  46. CDelegationBase *GetBaseNodeObject()
  47. {
  48. return (CDelegationBase *)m_lCookie;
  49. }
  50. DATA_OBJECT_TYPES GetContext()
  51. {
  52. return m_context;
  53. }
  54. public:
  55. //
  56. // Clipboard formats
  57. //
  58. static UINT s_cfSZNodeType;
  59. static UINT s_cfDisplayName;
  60. static UINT s_cfNodeType;
  61. static UINT s_cfSnapinClsid;
  62. static UINT s_cfInternal;
  63. };
  64. HRESULT ExtractFromDataObject( IDataObject *lpDataObject, UINT cf, ULONG cb, HGLOBAL *phGlobal );
  65. CDataObject* GetOurDataObject( IDataObject *lpDataObject );
  66. BOOL IsMMCMultiSelectDataObject( IDataObject *lpDataObject );
  67. #endif _SAMPDATAOBJECT_H_