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.

111 lines
3.4 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 _SAMPDATAOBJECT_H_
  19. #define _SAMPDATAOBJECT_H_
  20. #include <mmc.h>
  21. #include "DeleBase.h"
  22. class CDataObject : public IDataObject
  23. {
  24. private:
  25. ULONG m_cref;
  26. MMC_COOKIE m_lCookie;
  27. DATA_OBJECT_TYPES m_context;
  28. public:
  29. CDataObject(MMC_COOKIE cookie, DATA_OBJECT_TYPES context);
  30. ~CDataObject();
  31. ///////////////////////////////
  32. // Interface IUnknown
  33. ///////////////////////////////
  34. STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppv);
  35. STDMETHODIMP_(ULONG) AddRef();
  36. STDMETHODIMP_(ULONG) Release();
  37. ///////////////////////////////
  38. // IDataObject methods
  39. ///////////////////////////////
  40. STDMETHODIMP GetDataHere (FORMATETC *pformatetc, STGMEDIUM *pmedium);
  41. STDMETHODIMP GetData (LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium);
  42. // The rest are not implemented
  43. // STDMETHODIMP GetData (LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium)
  44. // { return E_NOTIMPL; };
  45. STDMETHODIMP EnumFormatEtc (DWORD dwDirection, LPENUMFORMATETC* ppEnumFormatEtc)
  46. { return E_NOTIMPL; };
  47. STDMETHODIMP QueryGetData (LPFORMATETC lpFormatetc)
  48. { return E_NOTIMPL; };
  49. STDMETHODIMP GetCanonicalFormatEtc (LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut)
  50. { return E_NOTIMPL; };
  51. STDMETHODIMP SetData (LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease)
  52. { return E_NOTIMPL; };
  53. STDMETHODIMP DAdvise (LPFORMATETC lpFormatetc, DWORD advf, LPADVISESINK pAdvSink, LPDWORD pdwConnection)
  54. { return E_NOTIMPL; };
  55. STDMETHODIMP DUnadvise (DWORD dwConnection)
  56. { return E_NOTIMPL; };
  57. STDMETHODIMP EnumDAdvise (LPENUMSTATDATA* ppEnumAdvise)
  58. { return E_NOTIMPL; };
  59. ///////////////////////////////
  60. // Custom Methods and Data
  61. ///////////////////////////////
  62. CDelegationBase *GetBaseNodeObject() {
  63. return (CDelegationBase *)m_lCookie;
  64. }
  65. DATA_OBJECT_TYPES GetContext() {
  66. return m_context;
  67. }
  68. MMC_COOKIE GetCookie() { return m_lCookie; }
  69. void AddMultiSelectCookie(int nIndexCookies, LPARAM lParam ) { pCookies[nIndexCookies] = (MMC_COOKIE)lParam; }
  70. MMC_COOKIE GetMultiSelectCookie(int n) { return pCookies[n]; }
  71. private:
  72. enum { MAX_COOKIES = 20 }; // MAX_COOKIES == MAX_CHILDREN declared
  73. // in CSpaceStation class
  74. MMC_COOKIE* pCookies;
  75. public:
  76. // clipboard formats
  77. static UINT s_cfSZNodeType;
  78. static UINT s_cfDisplayName;
  79. static UINT s_cfNodeType;
  80. static UINT s_cfSnapinClsid;
  81. static UINT s_cfInternal;
  82. static UINT s_cfMultiSelect;
  83. };
  84. HRESULT ExtractFromDataObject(IDataObject *lpDataObject,UINT cf,ULONG cb,HGLOBAL *phGlobal);
  85. CDataObject* GetOurDataObject(IDataObject *lpDataObject);
  86. BOOL IsMMCMultiSelectDataObject(IDataObject *lpDataObject);
  87. #endif _SAMPDATAOBJECT_H_