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.

200 lines
4.4 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. ntdllp.h
  5. Abstract:
  6. Private definitions for ntdll.
  7. Author:
  8. Michael J. Grier (mgrier) 6/30/2000
  9. Revision History:
  10. --*/
  11. #ifndef _NTDLLP_
  12. #define _NTDLLP_
  13. #pragma once
  14. #include <nt.h>
  15. #include <ntrtl.h>
  16. #include <nturtl.h>
  17. #include <string.h>
  18. #include <sxstypes.h>
  19. #include <ntrtlpath.h>
  20. VOID
  21. NTAPI
  22. RtlpAssemblyStorageMapResolutionDefaultCallback(
  23. ULONG Reason,
  24. PASSEMBLY_STORAGE_MAP_RESOLUTION_CALLBACK_DATA Data,
  25. PVOID Context
  26. );
  27. NTSTATUS
  28. RtlpGetAssemblyStorageMapRootLocation(
  29. HANDLE KeyHandle,
  30. PCUNICODE_STRING SubKeyName,
  31. PUNICODE_STRING Root
  32. );
  33. VOID
  34. RtlpCheckRelativeDrive(
  35. WCHAR NewDrive
  36. );
  37. ULONG
  38. RtlIsDosDeviceName_Ustr(
  39. IN PUNICODE_STRING DosFileName
  40. );
  41. ULONG
  42. RtlGetFullPathName_Ustr(
  43. PUNICODE_STRING FileName,
  44. ULONG nBufferLength,
  45. PWSTR lpBuffer,
  46. PWSTR *lpFilePart OPTIONAL,
  47. PBOOLEAN NameInvalid,
  48. RTL_PATH_TYPE *InputPathType
  49. );
  50. NTSTATUS
  51. RtlGetFullPathName_UstrEx(
  52. PUNICODE_STRING FileName,
  53. PUNICODE_STRING StaticString,
  54. PUNICODE_STRING DynamicString,
  55. PUNICODE_STRING *StringUsed,
  56. SIZE_T *FilePartPrefixCch OPTIONAL,
  57. PBOOLEAN NameInvalid,
  58. RTL_PATH_TYPE *InputPathType,
  59. OUT SIZE_T *BytesRequired OPTIONAL
  60. );
  61. ULONG
  62. RtlpComputeBackupIndex(
  63. IN PCURDIR CurDir
  64. );
  65. ULONG
  66. RtlGetLongestNtPathLength(
  67. VOID
  68. );
  69. VOID
  70. RtlpResetDriveEnvironment(
  71. IN WCHAR DriveLetter
  72. );
  73. VOID
  74. RtlpValidateCurrentDirectory(
  75. PCURDIR CurDir
  76. );
  77. NTSTATUS
  78. RtlpCheckDeviceName(
  79. PUNICODE_STRING DevName,
  80. ULONG DeviceNameOffset,
  81. BOOLEAN* NameInvalid
  82. );
  83. NTSTATUS
  84. RtlpWin32NTNameToNtPathName_U(
  85. IN PUNICODE_STRING DosFileName,
  86. OUT PUNICODE_STRING NtFileName,
  87. OUT PWSTR *FilePart OPTIONAL,
  88. OUT PRTL_RELATIVE_NAME RelativeName OPTIONAL
  89. );
  90. #define RTLP_GOOD_DOS_ROOT_PATH 0
  91. #define RTLP_BAD_DOS_ROOT_PATH_WIN32NT_PREFIX 1 /* \\?\ */
  92. #define RTLP_BAD_DOS_ROOT_PATH_WIN32NT_UNC_PREFIX 2 /* \\?\unc */
  93. #define RTLP_BAD_DOS_ROOT_PATH_NT_PATH 3 /* \??\, this is only rough */
  94. #define RTLP_BAD_DOS_ROOT_PATH_MACHINE_NO_SHARE 4 /* \\machine or \\?\unc\machine */
  95. CONST CHAR*
  96. RtlpDbgBadDosRootPathTypeToString(
  97. IN ULONG Flags,
  98. IN ULONG RootType
  99. );
  100. NTSTATUS
  101. RtlpCheckForBadDosRootPath(
  102. IN ULONG Flags,
  103. IN PCUNICODE_STRING RootString,
  104. OUT ULONG* RootType
  105. );
  106. NTSTATUS
  107. NTAPI
  108. RtlpBadDosRootPathToEmptyString(
  109. IN ULONG Flags,
  110. IN OUT PUNICODE_STRING Path
  111. );
  112. #define RTL_DETERMINE_DOS_PATH_NAME_TYPE_IN_FLAG_OLD (0x00000010)
  113. //
  114. // This bit means to do extra validation on \\? paths, to reject \\?\a\b,
  115. // To only allow \\? followed by the documented forms \\?\unc\foo and \\?\c:
  116. //
  117. #define RTL_DETERMINE_DOS_PATH_NAME_TYPE_IN_FLAG_STRICT_WIN32NT (0x00000020)
  118. #define RTLP_DETERMINE_DOS_PATH_NAME_TYPE_OUT_TYPE_MASK (0x0000000F)
  119. //
  120. // These bits add more information to RtlPathTypeUncAbsolute, which is what \\?
  121. // is reported as.
  122. //
  123. //
  124. // The path starts "\\?".
  125. //
  126. #define RTLP_DETERMINE_DOS_PATH_NAME_TYPE_OUT_FLAG_WIN32NT (0x00000010)
  127. //
  128. // The path starts "\\?\x:".
  129. //
  130. #define RTLP_DETERMINE_DOS_PATH_NAME_TYPE_OUT_FLAG_WIN32NT_DRIVE_ABSOLUTE (0x00000020)
  131. //
  132. // The path starts "\\?\unc".
  133. //
  134. #define RTLP_DETERMINE_DOS_PATH_NAME_TYPE_OUT_FLAG_WIN32NT_UNC_ABSOLUTE (0x00000040)
  135. //
  136. //future this would indicate \\machine instead of \\machine\share
  137. //define RTLP_DETERMINE_DOS_PATH_NAME_TYPE_OUT_FLAG_WIN32NT_UNC_MACHINE_ONLY (0x00000080)
  138. //future this would indicate \\ or \\?\unc
  139. //define RTLP_DETERMINE_DOS_PATH_NAME_TYPE_OUT_FLAG_WIN32NT_UNC_EMPTY (0x00000100)
  140. //
  141. //
  142. // So far, this means something like \\?\a was seen, instead of \\?\unc or \\?\a:
  143. // You have to request it with RTL_DETERMINE_DOS_PATH_NAME_TYPE_IN_FLAG_STRICT_WIN32NT.
  144. //
  145. #define RTLP_DETERMINE_DOS_PATH_NAME_TYPE_OUT_FLAG_INVALID (0x00000200)
  146. //
  147. // stuff like \\ \\? \\?\unc \\?\unc\
  148. //
  149. #define RTLP_DETERMINE_DOS_PATH_NAME_TYPE_OUT_FLAG_INCOMPLETE_ROOT (0x00000400)
  150. NTSTATUS
  151. NTAPI
  152. RtlpDetermineDosPathNameType4(
  153. IN ULONG InFlags,
  154. IN PCUNICODE_STRING DosPath,
  155. OUT RTL_PATH_TYPE* OutType,
  156. OUT ULONG* OutFlags
  157. );
  158. #define RTLP_IMPLIES(x,y) ((x) ? (y) : TRUE)
  159. #endif // _NTDLLP_