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.

122 lines
3.1 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation
  3. Module Name:
  4. dataobj.h
  5. Abstract:
  6. header file defines CDataObject class
  7. Author:
  8. William Hsieh (williamh) created
  9. Revision History:
  10. --*/
  11. #ifndef _DATAOBJ_H
  12. #define _DATAOBJ_H
  13. class CDataObject;
  14. class CDataObjectRoot;
  15. class CDataObjectDeviceTreeByType;
  16. class CDataObjectDeviceTreeByConnection;
  17. class CCookie;
  18. class CDataObject : public IDataObject
  19. {
  20. public:
  21. CDataObject() : m_Ref(1)
  22. {}
  23. ~CDataObject()
  24. {}
  25. // IUnknown interface
  26. STDMETHOD_(ULONG, AddRef)();
  27. STDMETHOD_(ULONG, Release)();
  28. STDMETHOD(QueryInterface)(REFIID riid, void** ppv);
  29. // IDataObject interface
  30. STDMETHOD(GetData)(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium);
  31. STDMETHOD(GetDataHere)(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium);
  32. STDMETHOD(EnumFormatEtc)(DWORD dwDirection, LPENUMFORMATETC* ppEnumFormatEtc);
  33. virtual HRESULT Initialize(DATA_OBJECT_TYPES Type, COOKIE_TYPE ct, CCookie* pCookie, String& strMachineName);
  34. // Not Implemented
  35. private:
  36. STDMETHOD(QueryGetData)(LPFORMATETC lpFormatetc)
  37. {
  38. UNREFERENCED_PARAMETER(lpFormatetc);
  39. return E_NOTIMPL;
  40. };
  41. STDMETHOD(GetCanonicalFormatEtc)(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut)
  42. {
  43. UNREFERENCED_PARAMETER(lpFormatetcIn);
  44. UNREFERENCED_PARAMETER(lpFormatetcOut);
  45. return E_NOTIMPL;
  46. };
  47. STDMETHOD(SetData)(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease)
  48. {
  49. UNREFERENCED_PARAMETER(lpFormatetc);
  50. UNREFERENCED_PARAMETER(lpMedium);
  51. UNREFERENCED_PARAMETER(bRelease);
  52. return E_NOTIMPL;
  53. };
  54. STDMETHOD(DAdvise)(LPFORMATETC lpFormatetc, DWORD advf,
  55. LPADVISESINK pAdvSink, LPDWORD pdwConnection)
  56. {
  57. UNREFERENCED_PARAMETER(lpFormatetc);
  58. UNREFERENCED_PARAMETER(advf);
  59. UNREFERENCED_PARAMETER(pAdvSink);
  60. UNREFERENCED_PARAMETER(pdwConnection);
  61. return E_NOTIMPL;
  62. };
  63. STDMETHOD(DUnadvise)(DWORD dwConnection)
  64. {
  65. UNREFERENCED_PARAMETER(dwConnection);
  66. return E_NOTIMPL;
  67. };
  68. STDMETHOD(EnumDAdvise)(LPENUMSTATDATA* ppEnumAdvise)
  69. {
  70. UNREFERENCED_PARAMETER(ppEnumAdvise);
  71. return E_NOTIMPL;
  72. };
  73. public:
  74. // Clipboard formats that are required by the console
  75. static unsigned int m_cfNodeType;
  76. static unsigned int m_cfNodeTypeString;
  77. static unsigned int m_cfDisplayName;
  78. static unsigned int m_cfSnapinInternal;
  79. static unsigned int m_cfCoClass;
  80. static unsigned int m_cfMachineName;
  81. static unsigned int m_cfClassGuid;
  82. static unsigned int m_cfDeviceID;
  83. protected:
  84. COOKIE_TYPE m_ct;
  85. CCookie* m_pCookie;
  86. int m_idsNodeName;
  87. private:
  88. DATA_OBJECT_TYPES m_Type;
  89. String m_strMachineName;
  90. LONG m_Ref;
  91. };
  92. extern HRESULT ExtractData(IDataObject* pIDataObject, unsigned int cfClipFormat,
  93. BYTE* pBuffer, DWORD cbBuffer
  94. );
  95. #endif