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.

118 lines
4.2 KiB

  1. #ifndef __DATAIO_H__
  2. #define __DATAIO_H__
  3. /*****************************************************************************************************************
  4. FILENAME: DataIo.h
  5. COPYRIGHT 2001 Microsoft Corporation and Executive Software International, Inc.
  6. DESCRIPTION:
  7. Header file for the Data IO.
  8. *****************************************************************************************************************/
  9. //#include <objbase.h>
  10. //#include <initguid.h>
  11. // File Rescue GUIDS
  12. // {912F3920-B440-11d0-90DB-0060975EC077}
  13. DEFINE_GUID(CLSID_EsiUndelNtfs, 0x912f3920, 0xb440, 0x11d0, 0x90, 0xdb, 0x0, 0x60, 0x97, 0x5e, 0xc0, 0x77);
  14. // {E2B090D0-BAA3-11d0-90DE-0060975EC077}
  15. DEFINE_GUID(CLSID_EsiUndeleteUI, 0xe2b090d0, 0xbaa3, 0x11d0, 0x90, 0xde, 0x0, 0x60, 0x97, 0x5e, 0xc0, 0x77);
  16. // {260546E1-E9B4-11d0-910F-0060975EC077}
  17. DEFINE_GUID(CLSID_EsiRescueBin, 0x260546e1, 0xe9b4, 0x11d0, 0x91, 0xf, 0x0, 0x60, 0x97, 0x5e, 0xc0, 0x77);
  18. // {94665C20-C645-11d0-90EE-0060975EC077}
  19. DEFINE_GUID(CLSID_EsiUndelFat, 0x94665c20, 0xc645, 0x11d0, 0x90, 0xee, 0x0, 0x60, 0x97, 0x5e, 0xc0, 0x77);
  20. // {C2BD5645-F09A-11d0-9969-0060975B6ADB}
  21. DEFINE_GUID(CLSID_EsiFrFtrCtl, 0xc2bd5645, 0xf09a, 0x11d0, 0x99, 0x69, 0x0, 0x60, 0x97, 0x5b, 0x6a, 0xdb);
  22. /****************************************************************************************************************/
  23. // DKMS GUIDS
  24. // {AE6EFB51-2FBD-11d1-A1FC-0080C88593A5}
  25. DEFINE_GUID(CLSID_DfrgCtlDataIo, 0xae6efb51, 0x2fbd, 0x11d1, 0xa1, 0xfc, 0x0, 0x80, 0xc8, 0x85, 0x93, 0xa5);
  26. // {80EE4901-33A8-11d1-A213-0080C88593A5}
  27. DEFINE_GUID(CLSID_DfrgNtfs, 0x80ee4901, 0x33a8, 0x11d1, 0xa2, 0x13, 0x0, 0x80, 0xc8, 0x85, 0x93, 0xa5);
  28. // {80EE4902-33A8-11d1-A213-0080C88593A5}
  29. DEFINE_GUID(CLSID_DfrgFat, 0x80ee4902, 0x33a8, 0x11d1, 0xa2, 0x13, 0x0, 0x80, 0xc8, 0x85, 0x93, 0xa5);
  30. /****************************************************************************************************************/
  31. typedef struct {
  32. WORD dwID; // ESI data structre ID always = 0x4553 'ES'
  33. WORD dwType; // Type of data structure
  34. WORD dwVersion; // Version number
  35. WORD dwCompatibilty;// Compatibilty number
  36. ULONG ulDataSize; // Data size - zero = no data
  37. WPARAM wparam; // LOWORD(wparam) = Command
  38. TCHAR cData; // Start of data - NULL = no data
  39. } DATA_IO, *PDATA_IO;
  40. /****************************************************************************************************************/
  41. class CClassFactory : public IClassFactory {
  42. public:
  43. // IUnknown
  44. STDMETHODIMP QueryInterface (REFIID riid, void** ppv);
  45. STDMETHODIMP_(ULONG) AddRef(void) { return 1; };
  46. STDMETHODIMP_(ULONG) Release(void) { return 1; }
  47. // IClassFactory
  48. STDMETHODIMP CreateInstance (LPUNKNOWN punkOuter, REFIID iid, void **ppv);
  49. STDMETHODIMP LockServer (BOOL fLock) { return E_FAIL; };
  50. };
  51. /****************************************************************************************************************/
  52. class EsiDataObject : public IDataObject {
  53. protected:
  54. FORMATETC m_aFormatEtc[2];
  55. public:
  56. // IUnknown
  57. STDMETHOD(QueryInterface)(REFIID riid,void** ppv);
  58. STDMETHODIMP_(ULONG) AddRef(void) { return InterlockedIncrement(&m_cRef); };
  59. STDMETHODIMP_(ULONG) Release(void);
  60. STDMETHOD(GetData)(LPFORMATETC pformatetcIn, LPSTGMEDIUM pmedium );
  61. STDMETHOD(GetDataHere)(LPFORMATETC pformatetc, LPSTGMEDIUM pmedium );
  62. STDMETHOD(QueryGetData)(LPFORMATETC pformatetc );
  63. STDMETHOD(GetCanonicalFormatEtc)(LPFORMATETC pformatetc, LPFORMATETC pformatetcOut);
  64. STDMETHOD(SetData)(LPFORMATETC pformatetc, STGMEDIUM FAR * pmedium, BOOL fRelease);
  65. STDMETHOD(EnumFormatEtc)(DWORD dwDirection, LPENUMFORMATETC FAR* ppenumFormatEtc);
  66. STDMETHOD(DAdvise)(FORMATETC FAR* pFormatetc, DWORD advf, LPADVISESINK pAdvSink, DWORD FAR* pdwConnection);
  67. STDMETHOD(DUnadvise)(DWORD dwConnection);
  68. STDMETHOD(EnumDAdvise)(LPENUMSTATDATA FAR* ppenumAdvise);
  69. EsiDataObject(void);
  70. ~EsiDataObject(void);
  71. HANDLE hDataIn;
  72. HANDLE hDataOut;
  73. private:
  74. LONG m_cRef;
  75. };
  76. /****************************************************************************************************************/
  77. DWORD
  78. InitializeDataIo(
  79. IN REFCLSID refCLSID,
  80. DWORD dwRegCls
  81. );
  82. BOOL
  83. ExitDataIo(
  84. );
  85. #endif //__DATAIO_H__