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.

173 lines
4.6 KiB

  1. /*++
  2. 1998 Seagate Software, Inc. All rights reserved.
  3. Module Name:
  4. fsaprem.h
  5. Abstract:
  6. Header file for the premigrated list classes.
  7. Author:
  8. Ron White [ronw] 18-Feb-1997
  9. Revision History:
  10. --*/
  11. #ifndef _FSAPREM_
  12. #define _FSAPREM_
  13. #include "resource.h" // main symbols
  14. #include "wsbdb.h"
  15. #include "fsa.h"
  16. #include "fsaprv.h"
  17. #define PREMIGRATED_REC_TYPE 1
  18. #define PREMIGRATED_BAGID_OFFSETS_KEY_TYPE 1
  19. #define PREMIGRATED_ACCESS_TIME_KEY_TYPE 2
  20. #define PREMIGRATED_SIZE_KEY_TYPE 3
  21. #define RECOVERY_REC_TYPE 2
  22. #define RECOVERY_KEY_TYPE 1
  23. #define RECOVERY_KEY_SIZE (IDB_MAX_KEY_SIZE - 1)
  24. // This may be problem if longer path names are used:
  25. #define PREMIGRATED_MAX_PATH_SIZE 65536
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CFsaPremigratedDb
  28. class CFsaPremigratedDb :
  29. public IFsaPremigratedDb,
  30. public CWsbDb,
  31. public CComCoClass<CFsaPremigratedDb,&CLSID_CFsaPremigratedDb>
  32. {
  33. public:
  34. CFsaPremigratedDb() {}
  35. BEGIN_COM_MAP(CFsaPremigratedDb)
  36. COM_INTERFACE_ENTRY(IFsaPremigratedDb)
  37. COM_INTERFACE_ENTRY2(IWsbDb, IFsaPremigratedDb)
  38. COM_INTERFACE_ENTRY(IWsbDbPriv)
  39. COM_INTERFACE_ENTRY(IPersistStream)
  40. END_COM_MAP()
  41. //DECLARE_NO_REGISTRY()
  42. DECLARE_REGISTRY_RESOURCEID(IDR_FsaPremigratedDb)
  43. DECLARE_PROTECT_FINAL_CONSTRUCT();
  44. // IWsbDb
  45. WSB_FROM_CWSBDB;
  46. // IPersist
  47. public:
  48. STDMETHOD(GetClassID)(LPCLSID pclsid);
  49. // IPersistStream
  50. public:
  51. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pSize) {
  52. return(CWsbDb::GetSizeMax(pSize)); }
  53. STDMETHOD(Load)(IStream* pStream);
  54. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  55. // IFsaPremigrated
  56. public:
  57. STDMETHOD(FinalConstruct)(void);
  58. STDMETHOD(FinalRelease)(void);
  59. STDMETHOD(Init)(OLECHAR* name, IWsbDbSys* pDbSys, BOOL* pCreated);
  60. private:
  61. };
  62. /////////////////////////////////////////////////////////////////////////////
  63. // CFsaPremigratedRec
  64. class CFsaPremigratedRec :
  65. public CWsbDbEntity,
  66. public IFsaPremigratedRec,
  67. public CComCoClass<CFsaPremigratedRec,&CLSID_CFsaPremigratedRec>
  68. {
  69. public:
  70. CFsaPremigratedRec() {}
  71. BEGIN_COM_MAP(CFsaPremigratedRec)
  72. COM_INTERFACE_ENTRY(IFsaPremigratedRec)
  73. COM_INTERFACE_ENTRY2(IWsbDbEntity, CWsbDbEntity)
  74. COM_INTERFACE_ENTRY(IWsbDbEntityPriv)
  75. COM_INTERFACE_ENTRY(IPersistStream)
  76. COM_INTERFACE_ENTRY(IWsbCollectable)
  77. END_COM_MAP()
  78. //DECLARE_NO_REGISTRY()
  79. DECLARE_REGISTRY_RESOURCEID(IDR_FsaPremigratedRec)
  80. // IFsaPremigratedRec
  81. public:
  82. STDMETHOD(FinalConstruct)(void);
  83. STDMETHOD(FinalRelease)(void);
  84. // IPersist
  85. public:
  86. STDMETHOD(GetClassID)(LPCLSID pClsid);
  87. // IPersistStream
  88. public:
  89. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pSize);
  90. STDMETHOD(Load)(IStream* pStream);
  91. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  92. // IWsbDbEntity
  93. public:
  94. STDMETHOD(Print)(IStream* pStream);
  95. STDMETHOD(UpdateKey)(IWsbDbKey *pKey);
  96. WSB_FROM_CWSBDBENTITY;
  97. // IWsbTestable
  98. STDMETHOD(Test)(USHORT* /*passed*/, USHORT* /*failed*/) {
  99. return(E_NOTIMPL); }
  100. // IFsaPremigratedRec
  101. public:
  102. STDMETHOD(GetAccessTime)(FILETIME* pAccessTime);
  103. STDMETHOD(GetBagId)(GUID* pId);
  104. STDMETHOD(GetBagOffset)(LONGLONG* pOffset);
  105. STDMETHOD(GetFileId)(LONGLONG* pFileId);
  106. STDMETHOD(GetFileUSN)(LONGLONG* pFileUSN);
  107. STDMETHOD(GetOffset)(LONGLONG* pOffset);
  108. STDMETHOD(GetPath)(OLECHAR** ppPath, ULONG bufferSize);
  109. STDMETHOD(GetRecallTime)(FILETIME* pTime);
  110. STDMETHOD(GetSize)(LONGLONG* pSize);
  111. STDMETHOD(IsWaitingForClose)(void);
  112. STDMETHOD(SetAccessTime)(FILETIME AccessTime);
  113. STDMETHOD(SetBagId)(GUID id);
  114. STDMETHOD(SetBagOffset)(LONGLONG offset);
  115. STDMETHOD(SetFileId)(LONGLONG FileId);
  116. STDMETHOD(SetFileUSN)(LONGLONG FileUSN);
  117. STDMETHOD(SetFromScanItem)(IFsaScanItem* pScanItem, LONGLONG offset, LONGLONG size, BOOL isWaitingForClose);
  118. STDMETHOD(SetIsWaitingForClose)(BOOL isWaiting);
  119. STDMETHOD(SetOffset)(LONGLONG offset);
  120. STDMETHOD(SetPath)(OLECHAR* pPath);
  121. STDMETHOD(SetRecallTime)(FILETIME Time);
  122. STDMETHOD(SetSize)(LONGLONG Size);
  123. private:
  124. FILETIME m_AccessTime;
  125. GUID m_BagId;
  126. LONGLONG m_BagOffset; // fileStart in the placeholder
  127. LONGLONG m_FileId;
  128. BOOL m_IsWaitingForClose;
  129. LONGLONG m_Offset; // dataStreamStart in the placeholder
  130. CWsbStringPtr m_Path;
  131. FILETIME m_RecallTime;
  132. LONGLONG m_Size;
  133. LONGLONG m_FileUSN; // USN Journal number
  134. };
  135. #endif // _FSAPREM_