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.

186 lines
3.4 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. sibp.h
  5. Abstract:
  6. Internal headers for the SIS Backup dll.
  7. Author:
  8. Bill Bolosky [bolosky] March 1998
  9. Revision History:
  10. --*/
  11. #include <nt.h>
  12. #include <ntrtl.h>
  13. #include <nturtl.h>
  14. #include <ntioapi.h>
  15. #include <windows.h>
  16. #include <stdlib.h>
  17. #include <stdio.h>
  18. #include <malloc.h>
  19. #include <rpc.h>
  20. #include "assert.h"
  21. #include "sisbkup.h"
  22. #include "..\filter\sis.h"
  23. #include "pool.h"
  24. #include "avl.h"
  25. LONG
  26. CsidCompare(
  27. IN PCSID id1,
  28. IN PCSID id2);
  29. class BackupFileEntry {
  30. public:
  31. BackupFileEntry(void) {}
  32. ~BackupFileEntry(void) {}
  33. int operator<=(
  34. BackupFileEntry *peer)
  35. {
  36. return(CsidCompare(&CSid,&peer->CSid) <= 0);
  37. }
  38. int operator<(
  39. BackupFileEntry *peer)
  40. {
  41. return(CsidCompare(&CSid,&peer->CSid) < 0);
  42. }
  43. int operator==(
  44. BackupFileEntry *peer)
  45. {
  46. return(CsidCompare(&CSid,&peer->CSid) == 0);
  47. }
  48. int operator>=(
  49. BackupFileEntry *peer)
  50. {
  51. return(CsidCompare(&CSid,&peer->CSid) >= 0);
  52. }
  53. int operator>(
  54. BackupFileEntry *peer)
  55. {
  56. return(CsidCompare(&CSid,&peer->CSid) > 0);
  57. }
  58. //
  59. // The index of the common store file.
  60. //
  61. CSID CSid;
  62. PVOID callerContext;
  63. };
  64. typedef struct _SIB_BACKUP_VOLUME_STRUCTURE {
  65. AVLTree<BackupFileEntry> *linkTree;
  66. PWCHAR volumeRoot;
  67. CRITICAL_SECTION criticalSection[1];
  68. } SIB_BACKUP_VOLUME_STRUCTURE, *PSIB_BACKUP_VOLUME_STRUCTURE;
  69. struct PendingRestoredFile {
  70. PWCHAR fileName;
  71. LONGLONG CSFileChecksum;
  72. struct PendingRestoredFile *next;
  73. };
  74. class RestoreFileEntry {
  75. public:
  76. RestoreFileEntry(void) {}
  77. ~RestoreFileEntry(void) {}
  78. int operator<=(
  79. RestoreFileEntry *peer)
  80. {
  81. return(CsidCompare(&CSid,&peer->CSid) <= 0);
  82. }
  83. int operator<(
  84. RestoreFileEntry *peer)
  85. {
  86. return(CsidCompare(&CSid,&peer->CSid) < 0);
  87. }
  88. int operator==(
  89. RestoreFileEntry *peer)
  90. {
  91. return(CsidCompare(&CSid,&peer->CSid) == 0);
  92. }
  93. int operator>=(
  94. RestoreFileEntry *peer)
  95. {
  96. return(CsidCompare(&CSid,&peer->CSid) >= 0);
  97. }
  98. int operator>(
  99. RestoreFileEntry *peer)
  100. {
  101. return(CsidCompare(&CSid,&peer->CSid) > 0);
  102. }
  103. //
  104. // The index of the common store file.
  105. //
  106. CSID CSid;
  107. //
  108. // The various files that have been restored that point at this CS file.
  109. //
  110. PendingRestoredFile *files;
  111. };
  112. typedef struct _SIB_RESTORE_VOLUME_STRUCTURE {
  113. AVLTree<RestoreFileEntry> *linkTree;
  114. PWCHAR volumeRoot;
  115. CRITICAL_SECTION criticalSection[1];
  116. //
  117. // The sector size for this volume.
  118. //
  119. ULONG VolumeSectorSize;
  120. //
  121. // A sector buffer to hold the backpointer stream data.
  122. //
  123. PSIS_BACKPOINTER sector;
  124. //
  125. // An aligned sector buffer to use in extending ValidDataLength.
  126. //
  127. PVOID alignedSectorBuffer;
  128. PVOID alignedSector;
  129. //
  130. // If we're restoring SIS links, we need to assure that this is
  131. // a SIS enabled volume. We do this check only once we've restored
  132. // a link.
  133. //
  134. BOOLEAN checkedForSISEnabledVolume;
  135. BOOLEAN isSISEnabledVolume;
  136. } SIB_RESTORE_VOLUME_STRUCTURE, *PSIB_RESTORE_VOLUME_STRUCTURE;