Source code of Windows XP (NT5)
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.

167 lines
4.5 KiB

  1. //
  2. // IGPEDataobject interface id
  3. //
  4. // {4AE19822-BCEE-11d0-9484-080036B11A03}
  5. DEFINE_GUID(IID_IGPEDataObject, 0x4ae19822, 0xbcee, 0x11d0, 0x94, 0x84, 0x8, 0x0, 0x36, 0xb1, 0x1a, 0x3);
  6. #ifndef _DATAOBJ_H_
  7. #define _DATAOBJ_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 IGPEDataObject
  16. DECLARE_INTERFACE_(IGPEDataObject, 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. // *** IGPEDataObject 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 IGPEDataObject *LPGPEDATAOBJECT;
  29. //
  30. // CDataObject class
  31. //
  32. class CDataObject : public IDataObject,
  33. public IGPEInformation,
  34. public IGPEDataObject
  35. {
  36. friend class CSnapIn;
  37. protected:
  38. ULONG m_cRef;
  39. CComponentData *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. CDataObject(CComponentData *pComponent);
  55. ~CDataObject();
  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 IGPEInformation methods
  87. //
  88. STDMETHOD(GetName) (LPOLESTR pszName, int cchMaxLength);
  89. STDMETHOD(GetDisplayName) (LPOLESTR pszName, int cchMaxLength);
  90. STDMETHOD(GetRegistryKey) (DWORD dwSection, HKEY *hKey);
  91. STDMETHOD(GetDSPath) (DWORD dwSection, LPOLESTR pszPath, int cchMaxPath);
  92. STDMETHOD(GetFileSysPath) (DWORD dwSection, LPOLESTR pszPath, int cchMaxPath);
  93. STDMETHOD(GetOptions) (DWORD *dwOptions);
  94. STDMETHOD(GetType) (GROUP_POLICY_OBJECT_TYPE *gpoType);
  95. STDMETHOD(GetHint) (GROUP_POLICY_HINT_TYPE *gpHint);
  96. STDMETHOD(PolicyChanged) (BOOL bMachine, BOOL bAdd, GUID *pGuidExtension, GUID *pGuidSnapin);
  97. //
  98. // Implemented IGPEDataObject methods
  99. //
  100. STDMETHOD(SetType) (DATA_OBJECT_TYPES type)
  101. { m_type = type; return S_OK; };
  102. STDMETHOD(GetType) (DATA_OBJECT_TYPES *type)
  103. { *type = m_type; return S_OK; };
  104. STDMETHOD(SetCookie) (MMC_COOKIE cookie)
  105. { m_cookie = cookie; return S_OK; };
  106. STDMETHOD(GetCookie) (MMC_COOKIE *cookie)
  107. { *cookie = m_cookie; return S_OK; };
  108. private:
  109. HRESULT CreateNodeTypeData(LPSTGMEDIUM lpMedium);
  110. HRESULT CreateNodeTypeStringData(LPSTGMEDIUM lpMedium);
  111. HRESULT CreateDisplayName(LPSTGMEDIUM lpMedium);
  112. HRESULT CreateCoClassID(LPSTGMEDIUM lpMedium);
  113. HRESULT CreatePreloadsData(LPSTGMEDIUM lpMedium);
  114. HRESULT CreateNodeIDData(LPSTGMEDIUM lpMedium);
  115. HRESULT Create(LPVOID pBuffer, INT len, LPSTGMEDIUM lpMedium);
  116. };
  117. #endif // _DATAOBJ_H