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.

75 lines
1.8 KiB

  1. typedef struct _sResetRecord{
  2. ULARGE_INTEGER uliXOffset;
  3. } sResetRec;
  4. typedef struct _sResetRecordV1{
  5. ULARGE_INTEGER uliVOffset;
  6. ULARGE_INTEGER uliXOffset;
  7. } sResetRecV1;
  8. typedef sResetRec * LPRESETREC;
  9. typedef struct _sHeaderInfo{
  10. DWORD dwVerInfo;
  11. ULONG cRecs;
  12. ULONG cbRecSize;
  13. ULONG cbSize;
  14. ULARGE_INTEGER uliVSpaceSize;
  15. ULARGE_INTEGER uliTxSpaceSize;
  16. ULONG ulBlockSize;
  17. ULONG unused;
  18. } sHeader;
  19. typedef sHeader * LPSHEADER;
  20. class CXResetData
  21. {
  22. public:
  23. ULONG GetRecordNum(){ return m_cFillRecs;};
  24. ULONG FindRecord(ULARGE_INTEGER uliOffset,
  25. ULARGE_INTEGER *puliXOffset,
  26. BOOL *pfLastRecord);
  27. BOOL FGetRecord(ULONG iRecNum,
  28. ULARGE_INTEGER *puliOffset,
  29. ULARGE_INTEGER *puliXOffset,
  30. BOOL *pfLastRecord);
  31. HRESULT AddRecord(ULARGE_INTEGER uliOffset, ULARGE_INTEGER uliXOffset);
  32. HRESULT DeleteRecord(ULONG ulRecNum);
  33. CXResetData();
  34. ~CXResetData();
  35. HRESULT InitResetTable(IStorage *pStg,
  36. ULARGE_INTEGER *puliVSpaceSize,
  37. ULARGE_INTEGER *puliTxSpaceSize,
  38. ULONG ulBlockSize);
  39. HRESULT CommitResetTable(ULARGE_INTEGER uliVSpaceSize,
  40. ULARGE_INTEGER uliTxSpaceSize);
  41. HRESULT GetResetTblStream(IStorage *pStg, IStream **ppStm);
  42. private:
  43. HFILE m_hFile;
  44. LPRESETREC m_pSyncTbl;
  45. ULONG m_cFillRecs;
  46. ULONG m_cEmptyRecs;
  47. BOOL m_fDirty;
  48. IStream *m_pStm;
  49. IStorage *m_pStg;
  50. ULONG m_ulBlockSize;
  51. HRESULT DumpStream(IStream *pTempStrm, LPSTR pFileName);
  52. ULONG BinarySearch(
  53. LPRESETREC pTbl,
  54. ULONG ulStart,
  55. ULONG ulEnd,
  56. ULARGE_INTEGER ulKey
  57. );
  58. };