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.

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