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.

219 lines
4.2 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. filelist.h
  5. Abstract:
  6. This is a local header file for filelist.c
  7. Author:
  8. Paul McDaniel (paulmcd) 23-Jan-2000
  9. Revision History:
  10. --*/
  11. #ifndef _FILELIST_H_
  12. #define _FILELIST_H_
  13. NTSTATUS
  14. SrGetObjectName (
  15. IN PSR_DEVICE_EXTENSION pExtension OPTIONAL,
  16. IN PVOID pObject,
  17. OUT PUNICODE_STRING pName,
  18. IN ULONG NameLength
  19. );
  20. PWSTR
  21. SrpFindFilePartW (
  22. IN PWSTR pPath
  23. );
  24. PSTR
  25. SrpFindFilePart (
  26. IN PSTR pPath
  27. );
  28. NTSTATUS
  29. SrFindCharReverse(
  30. IN PWSTR pToken,
  31. IN ULONG TokenLength,
  32. IN WCHAR FindChar,
  33. OUT PWSTR * ppToken,
  34. OUT PULONG pTokenLength
  35. );
  36. NTSTATUS
  37. SrGetDestFileName(
  38. IN PSR_DEVICE_EXTENSION pExtension,
  39. IN PUNICODE_STRING pFileName,
  40. OUT PUNICODE_STRING pDestFileName
  41. );
  42. NTSTATUS
  43. SrGetNextFileNumber (
  44. OUT PULONG pNextFileNumber
  45. );
  46. NTSTATUS
  47. SrGetNextSeqNumber (
  48. OUT PINT64 pNextSeqNumber
  49. );
  50. NTSTATUS
  51. SrGetSystemVolume (
  52. OUT PUNICODE_STRING pFileName,
  53. OUT PSR_DEVICE_EXTENSION *ppSystemVolumeExtension,
  54. IN ULONG FileNameLength
  55. );
  56. //
  57. // a backup history, for only performing one backup per session
  58. //
  59. #define BACKUP_BUCKET_COUNT 2003 // a prime number
  60. #define BACKUP_BUCKET_LENGTH (5 * 1024 * 1024) // 5mb
  61. NTSTATUS
  62. SrMarkFileBackedUp(
  63. IN PSR_DEVICE_EXTENSION pExtension,
  64. IN PUNICODE_STRING pFileName,
  65. IN USHORT StreamNameLength,
  66. IN SR_EVENT_TYPE CurrentEvent,
  67. IN SR_EVENT_TYPE FutureEventsToIgnore
  68. );
  69. BOOLEAN
  70. SrHasFileBeenBackedUp(
  71. IN PSR_DEVICE_EXTENSION pExtension,
  72. IN PUNICODE_STRING pFileName,
  73. IN USHORT StreamNameLength,
  74. IN SR_EVENT_TYPE EventType
  75. );
  76. NTSTATUS
  77. SrResetBackupHistory (
  78. IN PSR_DEVICE_EXTENSION pExtension,
  79. IN PUNICODE_STRING pFileName OPTIONAL,
  80. IN USHORT StreamNameLength OPTIONAL,
  81. IN SR_EVENT_TYPE EventType
  82. );
  83. //
  84. // the size of the full buffer
  85. //
  86. #define SR_RENAME_BUFFER_LENGTH ( sizeof(FILE_RENAME_INFORMATION) \
  87. +SR_MAX_FILENAME_LENGTH \
  88. +sizeof(WCHAR) )
  89. #define SR_FILENAME_BUFFER_LENGTH ( sizeof(UNICODE_STRING) \
  90. +SR_MAX_FILENAME_LENGTH \
  91. +sizeof(WCHAR) )
  92. #define SR_FILENAME_BUFFER_DEPTH 50
  93. PVOID
  94. SrResetHistory(
  95. IN PHASH_KEY pKey,
  96. IN PVOID pEntryContext,
  97. PUNICODE_STRING pDirectoryName
  98. );
  99. PDEVICE_OBJECT
  100. SrGetVolumeDevice (
  101. PFILE_OBJECT pFileObject
  102. );
  103. NTSTATUS
  104. SrSetFileSecurity (
  105. IN HANDLE FileHandle,
  106. IN BOOLEAN SystemOnly,
  107. IN BOOLEAN SetDacl
  108. );
  109. NTSTATUS
  110. SrGetVolumeGuid (
  111. IN PUNICODE_STRING pVolumeName,
  112. OUT PWCHAR pVolumeGuid
  113. );
  114. NTSTATUS
  115. SrAllocateFileNameBuffer (
  116. IN ULONG TokenLength,
  117. OUT PUNICODE_STRING * ppBuffer
  118. );
  119. VOID
  120. SrFreeFileNameBuffer (
  121. IN PUNICODE_STRING pBuffer
  122. );
  123. NTSTATUS
  124. SrGetNumberOfLinks (
  125. IN PDEVICE_OBJECT NextDeviceObject,
  126. IN PFILE_OBJECT FileObject,
  127. OUT ULONG * pNumberOfLinks
  128. );
  129. NTSTATUS
  130. SrCheckVolume (
  131. IN PSR_DEVICE_EXTENSION pExtension,
  132. IN BOOLEAN ForceCheck
  133. );
  134. NTSTATUS
  135. SrCheckForRestoreLocation (
  136. IN PSR_DEVICE_EXTENSION pExtension
  137. );
  138. NTSTATUS
  139. SrGetMountVolume (
  140. IN PFILE_OBJECT pFileObject,
  141. OUT PUNICODE_STRING * ppMountVolume
  142. );
  143. NTSTATUS
  144. SrCheckFreeDiskSpace (
  145. IN HANDLE FileHandle,
  146. IN PUNICODE_STRING pVolumeName OPTIONAL
  147. );
  148. NTSTATUS
  149. SrSetSecurityObjectAsSystem (
  150. IN HANDLE Handle,
  151. IN SECURITY_INFORMATION SecurityInformation,
  152. IN PSECURITY_DESCRIPTOR SecurityDescriptor
  153. );
  154. NTSTATUS
  155. SrCheckForMountsInPath(
  156. IN PSR_DEVICE_EXTENSION pExtension,
  157. IN PFILE_OBJECT pFileObject,
  158. OUT BOOLEAN * pMountInPath
  159. );
  160. NTSTATUS
  161. SrGetShortFileName (
  162. IN PSR_DEVICE_EXTENSION pExtension,
  163. IN PFILE_OBJECT pFileObject,
  164. OUT PUNICODE_STRING pShortName
  165. );
  166. #endif // _FILELIST_H_