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.

162 lines
4.4 KiB

  1. //
  2. // IRSOPDataObject interface id
  3. //
  4. // {4AE19823-BCEE-11d0-9484-080036B11A03}
  5. DEFINE_GUID(IID_IRSOPDataObject, 0x4ae19823, 0xbcee, 0x11d0, 0x94, 0x84, 0x8, 0x0, 0x36, 0xb1, 0x1a, 0x3);
  6. #ifndef _RSOPDOBJ_H_
  7. #define _RSOPDOBJ_H_
  8. //
  9. // This is a private dataobject interface for GPE.
  10. // When the GPE snapin receives a dataobject and needs to determine
  11. // if it came from the GPE snapin or a different component, it can QI for
  12. // this interface.
  13. //
  14. #undef INTERFACE
  15. #define INTERFACE IRSOPDataObject
  16. DECLARE_INTERFACE_(IRSOPDataObject, 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. // *** IRSOPDataObject 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 IRSOPDataObject *LPRSOPDATAOBJECT;
  29. //
  30. // CRSOPDataObject class
  31. //
  32. class CRSOPDataObject : public IDataObject,
  33. public IRSOPInformation,
  34. public IRSOPDataObject
  35. {
  36. friend class CSnapIn;
  37. protected:
  38. ULONG m_cRef;
  39. CRSOPComponentData *m_pcd;
  40. DATA_OBJECT_TYPES m_type;
  41. MMC_COOKIE m_cookie;
  42. //
  43. // Clipboard formats that are required by the console
  44. //
  45. static unsigned int m_cfNodeType;
  46. static unsigned int m_cfNodeTypeString;
  47. static unsigned int m_cfDisplayName;
  48. static unsigned int m_cfCoClass;
  49. static unsigned int m_cfPreloads;
  50. static unsigned int m_cfNodeID;
  51. static unsigned int m_cfDescription;
  52. static unsigned int m_cfHTMLDetails;
  53. public:
  54. CRSOPDataObject(CRSOPComponentData *pComponent);
  55. ~CRSOPDataObject();
  56. //
  57. // IUnknown methods
  58. //
  59. STDMETHODIMP QueryInterface(REFIID, LPVOID FAR *);
  60. STDMETHODIMP_(ULONG) AddRef();
  61. STDMETHODIMP_(ULONG) Release();
  62. //
  63. // Implemented IDataObject methods
  64. //
  65. STDMETHOD(GetDataHere)(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium);
  66. STDMETHOD(GetData)(LPFORMATETC lpFormatetcIn, LPSTGMEDIUM lpMedium);
  67. //
  68. // Unimplemented IDataObject methods
  69. //
  70. STDMETHOD(EnumFormatEtc)(DWORD dwDirection, LPENUMFORMATETC* ppEnumFormatEtc)
  71. { return E_NOTIMPL; };
  72. STDMETHOD(QueryGetData)(LPFORMATETC lpFormatetc)
  73. { return E_NOTIMPL; };
  74. STDMETHOD(GetCanonicalFormatEtc)(LPFORMATETC lpFormatetcIn, LPFORMATETC lpFormatetcOut)
  75. { return E_NOTIMPL; };
  76. STDMETHOD(SetData)(LPFORMATETC lpFormatetc, LPSTGMEDIUM lpMedium, BOOL bRelease)
  77. { return E_NOTIMPL; };
  78. STDMETHOD(DAdvise)(LPFORMATETC lpFormatetc, DWORD advf,
  79. LPADVISESINK pAdvSink, LPDWORD pdwConnection)
  80. { return E_NOTIMPL; };
  81. STDMETHOD(DUnadvise)(DWORD dwConnection)
  82. { return E_NOTIMPL; };
  83. STDMETHOD(EnumDAdvise)(LPENUMSTATDATA* ppEnumAdvise)
  84. { return E_NOTIMPL; };
  85. //
  86. // Implemented IRSOPInformation methods
  87. //
  88. STDMETHOD(GetNamespace) (DWORD dwSection, LPOLESTR pszName, int cchMaxLength);
  89. STDMETHOD(GetFlags) (DWORD * pdwFlags);
  90. STDMETHOD(GetEventLogEntryText) (LPOLESTR pszEventSource, LPOLESTR pszEventLogName,
  91. LPOLESTR pszEventTime, DWORD dwEventID, LPOLESTR *ppszText);
  92. //
  93. // Implemented IRSOPDataObject methods
  94. //
  95. STDMETHOD(SetType) (DATA_OBJECT_TYPES type)
  96. { m_type = type; return S_OK; };
  97. STDMETHOD(GetType) (DATA_OBJECT_TYPES *type)
  98. { *type = m_type; return S_OK; };
  99. STDMETHOD(SetCookie) (MMC_COOKIE cookie)
  100. { m_cookie = cookie; return S_OK; };
  101. STDMETHOD(GetCookie) (MMC_COOKIE *cookie)
  102. { *cookie = m_cookie; return S_OK; };
  103. private:
  104. HRESULT CreateNodeTypeData(LPSTGMEDIUM lpMedium);
  105. HRESULT CreateNodeTypeStringData(LPSTGMEDIUM lpMedium);
  106. HRESULT CreateDisplayName(LPSTGMEDIUM lpMedium);
  107. HRESULT CreateCoClassID(LPSTGMEDIUM lpMedium);
  108. HRESULT CreatePreloadsData(LPSTGMEDIUM lpMedium);
  109. HRESULT CreateNodeIDData(LPSTGMEDIUM lpMedium);
  110. HRESULT Create(LPVOID pBuffer, INT len, LPSTGMEDIUM lpMedium);
  111. };
  112. #endif // _RSOPDOBJ_H