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.

65 lines
1.5 KiB

  1. //***************************************************************************
  2. //
  3. // (c) 2000 Microsoft Corp. All Rights Reserved.
  4. //
  5. // ABSFILE.H
  6. //
  7. // Repository file wrappers for transacting
  8. //
  9. // raymcc 02-Nov-00
  10. //
  11. //***************************************************************************
  12. #ifndef __A51_ABSFILE_H_
  13. #define __A51_ABSFILE_H_
  14. #include "longstg.h"
  15. class CAbstractFile
  16. {
  17. protected:
  18. CLongFileStagingFile* m_pStage;
  19. int m_nId;
  20. public:
  21. CAbstractFile(CLongFileStagingFile* pStage, int nId)
  22. : m_pStage(pStage), m_nId(nId)
  23. {}
  24. DWORD Write(DWORD dwOffs, LPVOID pMem, DWORD dwBytes, DWORD *pdwWritten);
  25. DWORD Read(DWORD dwOffs, LPVOID pMem, DWORD dwBytes, DWORD *pdwRead);
  26. DWORD SetFileLength(DWORD dwLen);
  27. DWORD GetFileLength(DWORD* pdwLength);
  28. void Touch();
  29. };
  30. class CAbstractFileSource
  31. {
  32. private:
  33. CLongFileStagingFile m_Stage;
  34. public:
  35. CAbstractFileSource(){}
  36. long Create(LPCWSTR wszFileName, long lMaxFileSize,
  37. long lAbortTransactionFileSize);
  38. long Start();
  39. long Stop(DWORD dwShutDownFlags);
  40. DWORD Register(HANDLE hFile, int nID, bool bSupportsOverwrites,
  41. CAbstractFile **pFile);
  42. DWORD CloseAll();
  43. DWORD Begin(DWORD *pdwTransId); // To accomodate possible simultaneous transactions
  44. DWORD Commit(DWORD dwTransId);
  45. DWORD Rollback(DWORD dwTransId, bool* pbNonEmpty);
  46. void Dump(FILE* f);
  47. };
  48. #endif