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.

136 lines
3.2 KiB

  1. /*++
  2. Module Name:
  3. fsaunmdb.h
  4. Abstract:
  5. Header file for the Unmanage Db classes (db and rec)
  6. Author:
  7. Ran Kalach [rankala] 05-Dec-2000
  8. Revision History:
  9. --*/
  10. #ifndef _FSAUNMDB_
  11. #define _FSAUNMDB_
  12. #include "resource.h"
  13. #include "wsbdb.h"
  14. // Simple Db - one rec type with one index
  15. #define UNMANAGE_KEY_TYPE 1
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CFsaUnmanageDb
  18. class CFsaUnmanageDb :
  19. public IFsaUnmanageDb,
  20. public CWsbDb,
  21. public CComCoClass<CFsaUnmanageDb,&CLSID_CFsaUnmanageDb>
  22. {
  23. public:
  24. CFsaUnmanageDb() {}
  25. BEGIN_COM_MAP(CFsaUnmanageDb)
  26. COM_INTERFACE_ENTRY(IFsaUnmanageDb)
  27. COM_INTERFACE_ENTRY2(IWsbDb, IFsaUnmanageDb)
  28. COM_INTERFACE_ENTRY(IWsbDbPriv)
  29. COM_INTERFACE_ENTRY(IPersistStream)
  30. END_COM_MAP()
  31. DECLARE_REGISTRY_RESOURCEID(IDR_FsaUnmanageDb)
  32. DECLARE_PROTECT_FINAL_CONSTRUCT();
  33. STDMETHOD(FinalConstruct)(void);
  34. STDMETHOD(FinalRelease)(void);
  35. // IWsbDb
  36. WSB_FROM_CWSBDB;
  37. // IPersist
  38. public:
  39. STDMETHOD(GetClassID)(LPCLSID pclsid);
  40. // IPersistStream
  41. public:
  42. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pSize) {
  43. return(CWsbDb::GetSizeMax(pSize)); }
  44. STDMETHOD(Load)(IStream* pStream);
  45. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  46. // IFsaUnmanageDb
  47. public:
  48. STDMETHOD(Init)(OLECHAR* name, IWsbDbSys* pDbSys, BOOL* pCreated);
  49. private:
  50. };
  51. /////////////////////////////////////////////////////////////////////////////
  52. // CFsaUnmanageRec
  53. class CFsaUnmanageRec :
  54. public CWsbDbEntity,
  55. public IFsaUnmanageRec,
  56. public CComCoClass<CFsaUnmanageRec,&CLSID_CFsaUnmanageRec>
  57. {
  58. public:
  59. CFsaUnmanageRec() {}
  60. BEGIN_COM_MAP(CFsaUnmanageRec)
  61. COM_INTERFACE_ENTRY(IFsaUnmanageRec)
  62. COM_INTERFACE_ENTRY2(IWsbDbEntity, CWsbDbEntity)
  63. COM_INTERFACE_ENTRY(IWsbDbEntityPriv)
  64. COM_INTERFACE_ENTRY(IPersistStream)
  65. COM_INTERFACE_ENTRY(IWsbCollectable)
  66. END_COM_MAP()
  67. //DECLARE_NO_REGISTRY()
  68. DECLARE_REGISTRY_RESOURCEID(IDR_FsaUnmanageRec)
  69. STDMETHOD(FinalConstruct)(void);
  70. STDMETHOD(FinalRelease)(void);
  71. // IPersist
  72. public:
  73. STDMETHOD(GetClassID)(LPCLSID pClsid);
  74. // IPersistStream
  75. public:
  76. STDMETHOD(GetSizeMax)(ULARGE_INTEGER* pSize);
  77. STDMETHOD(Load)(IStream* pStream);
  78. STDMETHOD(Save)(IStream* pStream, BOOL clearDirty);
  79. // IWsbDbEntity
  80. public:
  81. STDMETHOD(Print)(IStream* pStream);
  82. STDMETHOD(UpdateKey)(IWsbDbKey *pKey);
  83. WSB_FROM_CWSBDBENTITY;
  84. // IWsbTestable
  85. STDMETHOD(Test)(USHORT* /*passed*/, USHORT* /*failed*/) {
  86. return(E_NOTIMPL); }
  87. // IFsaUnmanageRec
  88. public:
  89. STDMETHOD(GetMediaId)(GUID* pId);
  90. STDMETHOD(GetFileOffset)(LONGLONG* pOffset);
  91. STDMETHOD(GetFileId)(LONGLONG* pFileId);
  92. STDMETHOD(SetMediaId)(GUID id);
  93. STDMETHOD(SetFileOffset)(LONGLONG offset);
  94. STDMETHOD(SetFileId)(LONGLONG FileId);
  95. private:
  96. GUID m_MediaId; // id of media where the file resides
  97. LONGLONG m_FileOffset; // absolute offset of the file on media
  98. LONGLONG m_FileId; // file id
  99. };
  100. #endif // _FSAUNMDB_