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.

89 lines
2.9 KiB

  1. // SegDb.h : Declaration of the CSegDb
  2. #include "resource.h" // main symbols
  3. #include "Wsb.h" // Wsb Collectable Class
  4. #include "wsbdb.h"
  5. #define SEG_KEY_TYPE 1
  6. #define MEDIA_INFO_KEY_TYPE 1
  7. #define BAG_INFO_KEY_TYPE 1
  8. #define BAG_HOLE_KEY_TYPE 1
  9. #define VOL_ASSIGN_KEY_TYPE 1
  10. #define SEG_DB_MAX_MEDIA_NAME_LEN MAX_COMPUTERNAME_LENGTH + 128 + 2
  11. #define SEG_DB_MAX_MEDIA_BAR_CODE_LEN MAX_COMPUTERNAME_LENGTH + 128 + 2
  12. /////////////////////////////////////////////////////////////////////////////
  13. // seg
  14. class CSegDb :
  15. public CWsbDb,
  16. public ISegDb,
  17. public CComCoClass<CSegDb,&CLSID_CSegDb>
  18. {
  19. public:
  20. CSegDb() {}
  21. BEGIN_COM_MAP(CSegDb)
  22. COM_INTERFACE_ENTRY(ISegDb)
  23. COM_INTERFACE_ENTRY2(IWsbDb, ISegDb)
  24. COM_INTERFACE_ENTRY(IWsbDbPriv)
  25. COM_INTERFACE_ENTRY(IPersistStream)
  26. // COM_INTERFACE_ENTRY(IWsbTestable)
  27. END_COM_MAP()
  28. DECLARE_REGISTRY(CSegDb, _T("Seg.SegDb.1"), _T("Seg.SegDb"), IDS_SEGDB_DESC, THREADFLAGS_BOTH)
  29. DECLARE_PROTECT_FINAL_CONSTRUCT();
  30. STDMETHOD(FinalConstruct)(void);
  31. STDMETHOD(FinalRelease)(void);
  32. // IWsbTestable
  33. public:
  34. STDMETHOD(Test)(USHORT *pTestsPassed, USHORT* pTestsFailed);
  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. // ISegDb
  47. public:
  48. STDMETHOD(Erase)( void );
  49. STDMETHOD(Initialize)(OLECHAR* root, IWsbDbSys* pDbSys, BOOL* pCreateFlag);
  50. STDMETHOD(BagHoleAdd)(IWsbDbSession* pDbSession, GUID bagId, LONGLONG segStartLoc,
  51. LONGLONG segLen);
  52. STDMETHOD(BagHoleFind)(IWsbDbSession* pDbSession, GUID bagId, LONGLONG segStartLoc,
  53. LONGLONG segLen, IBagHole** ppIBagHole );
  54. STDMETHOD(BagHoleSubtract)(IWsbDbSession* pDbSession, GUID bagId, LONGLONG segStartLoc,
  55. LONGLONG segLen);
  56. STDMETHOD(SegAdd)(IWsbDbSession* pDbSession, GUID bagId, LONGLONG segStartLoc,
  57. LONGLONG segLen, GUID MediaId, LONGLONG mediaStart, BOOL indirectRecord = FALSE );
  58. STDMETHOD(SegFind)(IWsbDbSession* pDbSession, GUID bagId, LONGLONG segStartLoc,
  59. LONGLONG segLen, ISegRec** ppISegRec );
  60. STDMETHOD(SegSubtract)(IWsbDbSession* pDbSession, GUID bagId, LONGLONG segStartLoc,
  61. LONGLONG SegLen);
  62. STDMETHOD(VolAssignAdd)(IWsbDbSession* pDbSession, GUID bagId, LONGLONG segStartLoc,
  63. LONGLONG segLen, GUID VolId);
  64. STDMETHOD(VolAssignFind)(IWsbDbSession* pDbSession, GUID bagId, LONGLONG segStartLoc,
  65. LONGLONG segLen, IVolAssign** ppIVolAssign );
  66. STDMETHOD(VolAssignSubtract)(IWsbDbSession* pDbSession, GUID bagId, LONGLONG segStartLoc,
  67. LONGLONG segLen);
  68. private:
  69. LONG m_value;
  70. };