22#define MAX_PFX_SIZE 16
24#define IS_PATH_SEPARATOR(x) (((x)==L'\\')||((x)==L'/'))
26#define RTL_CURDIR_IS_REMOVABLE 0x1
27#define RTL_CURDIR_DROP_OLD_HANDLE 0x2
28#define RTL_CURDIR_ALL_FLAGS (RTL_CURDIR_DROP_OLD_HANDLE | RTL_CURDIR_IS_REMOVABLE)
66 Path = PathString->Buffer;
67 Chars = PathString->Length /
sizeof(
WCHAR);
98 USHORT PathChars, ColonCount = 0;
103 if (!PathString)
return 0;
127 PathCopy = *PathString;
128 OriginalLength = PathString->
Length;
132 if (!PathChars)
return 0;
135 if (PathCopy.
Buffer[PathChars - 1] ==
L':')
139 if (!--PathChars)
return 0;
149 c = PathCopy.
Buffer[PathChars - 1];
150 if ((
c !=
L'.') && (
c !=
L' '))
break;
157 }
while (--PathChars);
163 for (End = &PathCopy.
Buffer[PathChars - 1];
176 if ((End < &PathCopy.
Buffer[OriginalLength /
sizeof(
WCHAR)]) &&
177 ((
c ==
L'l') || (
c ==
L'c') || (
c ==
L'p') || (
c ==
L'a') || (
c ==
L'n')))
183 PathCopy.
Length = OriginalLength - ReturnOffset - (ColonCount *
sizeof(
WCHAR));
200 if ((
c !=
L'l') && (
c !=
L'c') && (
c !=
L'p') && (
c !=
L'a') && (
c !=
L'n'))
209 End = &
Start[PathChars];
213 if ((
c ==
L'.') || (
c ==
L':'))
break;
225 if ((PathChars == 4) &&
238 else if ((PathChars == 3) &&
319 if (*
p ==
L'/') *
p =
L'\\';
358 while (
p >
Path + mark &&
p[-1] !=
L'\\')
p--;
370 while (
p >
Path + mark &&
p[-1] !=
L'\\')
p--;
382 while (*
p && *
p !=
L'\\')
p++;
386 if (
p >
Path + mark &&
p[-1] ==
L'.')
400 if (SkipTrailingPathSeparators)
406 while (
p >
Path && (
p[-1] ==
L' ' ||
p[-1] ==
L'.'))
p--;
448 IN PVOID UnicodeStringOrUnicodeStringBuffer,
455 if (
Flags || UnicodeStringOrUnicodeStringBuffer ==
NULL || LengthFunction ==
NULL)
457 DPRINT1(
"ERROR: Flags=0x%x, UnicodeStringOrUnicodeStringBuffer=%p, LengthFunction=%p\n",
458 Flags, UnicodeStringOrUnicodeStringBuffer, LengthFunction);
526 Path->Buffer[5] !=
':' ||
594 UNICODE_STRING ImagePathName, DllNameOnly, CopyRealName, CopyLocalName;
600 CopyRealName = *RealName;
601 CopyLocalName = *LocalName;
618 DllNameOnly = *DllName;
630 &DllNameOnly, &ExtensionChar, &
Position)))
720 if (CopyRealName.
Buffer && CopyRealName.
Buffer != RealName->Buffer)
722 if (CopyLocalName.
Buffer && CopyLocalName.
Buffer != LocalName->Buffer)
727 *RealName = CopyRealName;
728 *LocalName = CopyLocalName;
745 BOOLEAN SkipTrailingPathSeparators;
754 WCHAR EnvVarNameBuffer[4];
758 ULONG PrefixLength = 0;
800 DPRINT(
"DOS length for filename: %lx %wZ\n", DosLength,
FileName);
807 DosLengthOffset =
HIWORD(DosLength);
808 DosLength =
LOWORD(DosLength);
823 if (FullLength <
Size)
860 CurDirName = &
NtCurrentPeb()->ProcessParameters->CurrentDirectory.DosPath;
883 PrefixLength = 3 *
sizeof(
WCHAR);
885 SourceLength -= 3 *
sizeof(
WCHAR);
893 WCHAR CurDrive, NewDrive;
896 SourceLength -= 2 *
sizeof(
WCHAR);
901 if ((NewDrive != CurDrive) || CurDirName->
Buffer[1] !=
L':')
903 EnvVarNameBuffer[0] =
L'=';
904 EnvVarNameBuffer[1] = NewDrive;
905 EnvVarNameBuffer[2] =
L':';
910 EnvVarName.
Buffer = EnvVarNameBuffer;
946 DPRINT1(
"RtlQueryEnvironmentVariable_U(\"%wZ\") returned 0x%08lx\n", &EnvVarName,
Status);
948 EnvVarNameBuffer[0] = NewDrive;
949 EnvVarNameBuffer[1] =
L':';
950 EnvVarNameBuffer[2] =
L'\\';
952 Prefix = EnvVarNameBuffer;
953 PrefixLength = 3 *
sizeof(
WCHAR);
963 DPRINT(
"RtlPathTypeDriveRelative - Using fall-through to RtlPathTypeRelative\n");
969 PrefixLength = CurDirName->
Length;
970 if (CurDirName->
Buffer[1] !=
L':')
983 if (CurDirName->
Buffer[1] ==
L':')
990 PrefixLength = 3 *
sizeof(
WCHAR);
997 PrefixLength = PrefixCut *
sizeof(
WCHAR);
1008 SourceLength -= 3 *
sizeof(
WCHAR);
1019 reqsize = PrefixLength;
1020 if (reqsize + SourceLength +
sizeof(
WCHAR) >
Size)
1023 reqsize += SourceLength +
sizeof(
WCHAR);
1093 DosLength = DosPath->Length;
1113 RtlInitEmptyUnicodeString(&RelativeName->RelativeName,
NULL, 0);
1114 RelativeName->ContainingDirectory =
NULL;
1115 RelativeName->CurDirRef = 0;
1122 p = &NewBuffer[DosLength /
sizeof(
WCHAR)];
1123 while (--
p > NewBuffer)
1134 if ((
p > NewBuffer) && *
p)
1147 NtPath->Buffer = NewBuffer;
1148 NtPath->Length = (
USHORT)DosLength;
1172 DPRINT(
"Relative: %lx DosName: %wZ NtName: %p, PartName: %p, RelativeName: %p\n",
1173 HaveRelative,
DosName, NtName, PartName, RelativeName);
1174 MaxLength =
sizeof(BigBuffer);
1201 DPRINT(
"MaxLength: %lx\n", MaxLength);
1252 DPRINT(
"Buffer: %S Type: %lx\n",
Buffer, BufferPathType);
1253 switch (BufferPathType)
1290 NtName->Buffer = NewBuffer;
1292 NtName->MaximumLength = (
USHORT)MaxLength;
1294 DPRINT(
"New buffer: %S\n", NewBuffer);
1295 DPRINT(
"NT Name: %wZ\n", NtName);
1298 if ((PartName) && (*PartName))
1305 *PartName = &NewBuffer[LengthChars - (PartNameString.
Length /
sizeof(
WCHAR))];
1320 RtlInitEmptyUnicodeString(&RelativeName->RelativeName,
NULL, 0);
1321 RelativeName->ContainingDirectory =
NULL;
1322 RelativeName->CurDirRef =
NULL;
1350 RelativeName->RelativeName.Buffer = (
PWSTR)((
ULONG_PTR)NewBuffer + PrefixLength + FullPath.
Length - PrefixCut *
sizeof(
WCHAR));
1355 RelativeName->RelativeName.Buffer++;
1356 RelativeName->RelativeName.Length -=
sizeof(
WCHAR);
1358 RelativeName->RelativeName.MaximumLength = RelativeName->RelativeName.Length;
1359 DPRINT(
"RelativeName: %wZ\n", &(RelativeName->RelativeName));
1369 if (RelativeName->CurDirRef)
1537 if (RelativeName->CurDirRef)
1543 NtClose(RelativeName->CurDirRef->Handle);
1544 RtlFreeHeap(RtlGetProcessHeap(), 0, RelativeName->CurDirRef);
1546 RelativeName->CurDirRef =
NULL;
1589 NumChars = PathString->Length /
sizeof(
WCHAR);
1615 DPRINT(
"RtlDetermineDosPathNameType_U %S\n",
Path);
1672 CurDir = &
NtCurrentPeb()->ProcessParameters->CurrentDirectory;
1749 ULONG SavedLength, CharLength, FullPathLength;
1752 DPRINT(
"RtlSetCurrentDirectory_U %wZ\n",
Path);
1755 RtlInitEmptyUnicodeString(&NtName,
NULL, 0);
1765 CurDir = &
NtCurrentPeb()->ProcessParameters->CurrentDirectory;
1770 OldHandle = CurDir->
Handle;
1788 if (!FullPathLength)
1795 CharLength = FullPathLength /
sizeof(
WCHAR);
1825 sizeof(FileFsDeviceInfo),
1849 sizeof(FileFsDeviceInfo),
1865 if ((CharLength + 1) *
sizeof(
WCHAR) > SavedLength)
1899 CurDir->
Handle = CurDirHandle;
1901 CurDirHandle =
NULL;
1922 if (CurDirHandle)
NtClose(CurDirHandle);
1924 if (OldHandle)
NtClose(OldHandle);
1926 if (OldCurDirHandle)
NtClose(OldCurDirHandle);
2113 if (AlternatePrefix)
2114 Len += AlternatePrefix->Length;
2123 if (AlternatePrefix)
2127 Len - AlternatePrefix->Length);
2178 PWCHAR NewBuffer, BufferStart;
2215 ExtensionLength = 0;
2222 ExtensionLength = TempString.
Length;
2245 DbgPrint(
"%s: Failing due to out of memory (RtlAllocateHeap failure)\n",
2254 BufferStart = NewBuffer;
2258 while (*
Path !=
L';')
2261 *BufferStart++ = *
Path++;
2280 if (ExtensionLength)
2285 ExtensionLength +
sizeof(
WCHAR));
2334 StaticBuffer =
NULL;
2340 if (FilePartSize) *FilePartSize = 0;
2370 DPRINT(
"Length: %u StaticBuffer: %S\n",
Length, StaticBuffer);
2374 DbgPrint(
"%s(%d) - RtlGetFullPathName_Ustr() returned 0\n",
2410 if ((StaticBuffer) && (
Length < StaticLength))
2427 StaticBuffer =
NULL;
2443 DbgPrint(
"%s line %d: RtlGetFullPathName_Ustr() returned 0\n",
2477 if (!TempDynamicString.
Buffer)
2488 TempDynamicString.
Buffer,
2495 DbgPrint(
"%s line %d: RtlGetFullPathName_Ustr() returned 0\n",
2537 if (TempDynamicString.
Buffer)
2546 DbgPrint(
"RTL: %s - failing on filename %wZ with status %08lx\n",
2573 PWCHAR p, End, CandidateEnd, SegmentEnd;
2575 USHORT NamePlusExtLength, WorstCaseLength, ExtensionLength = 0;
2577 DPRINT(
"DOS Path Search: %lx %wZ %wZ %wZ %wZ %wZ\n",
2581 RtlInitEmptyUnicodeString(&StaticCandidateString,
2582 StaticCandidateBuffer,
2583 sizeof(StaticCandidateBuffer));
2586 if (FullNameOut ) *FullNameOut =
NULL;
2587 if (FilePartSize) *FilePartSize = 0;
2598 !(FileNameString) ||
2613 (FileNameString->Length >= (2 *
sizeof(
WCHAR))) &&
2614 (FileNameString->Buffer[0] ==
L'.') &&
2616 ((FileNameString->Buffer[1] ==
L'.') &&
2617 ((FileNameString->Length >= (3 *
sizeof(
WCHAR))) &&
2631 FullIsolatedPath =
NULL;
2644 if (FullNameOut) *FullNameOut = FullIsolatedPath;
2650 DbgPrint(
"%s: Failing because call to "
2651 "RtlDosApplyIsolationRedirection_Ustr(%wZ) failed with "
2661 if (ExtensionString)
2664 ExtensionLength = ExtensionString->Length;
2665 if (FileNameString->Length)
2668 End = &FileNameString->Buffer[FileNameString->Length /
sizeof(
WCHAR)];
2669 while (End > FileNameString->Buffer)
2678 ExtensionString =
NULL;
2679 ExtensionLength = 0;
2687 if (PathString->Length)
2690 End = &PathString->Buffer[PathString->Length /
sizeof(
WCHAR)];
2692 while ((
p > PathString->Buffer) && (*--
p ==
L';'))
2695 PathSize = End -
p - 1;
2699 if (PathSize > MaxPathSize) MaxPathSize = PathSize;
2708 if (PathSize > MaxPathSize) MaxPathSize = PathSize;
2711 MaxPathSize *=
sizeof(
WCHAR);
2715 WorstCaseLength = ExtensionLength +
2716 FileNameString->Length +
2722 DbgPrint(
"%s returning STATUS_NAME_TOO_LONG because the computed "
2723 "worst case file name length is %Iu bytes\n",
2731 p = PathString->Buffer;
2732 End = &
p[PathString->Length /
sizeof(
WCHAR)];
2736 for (SegmentEnd =
p;
2737 ((SegmentEnd != End) && (*SegmentEnd !=
L';'));
2752 (
SegmentSize + ExtensionLength + FileNameString->Length))
2755 ASSERT(StaticCandidateString.
Buffer == StaticCandidateBuffer);
2756 if (StaticCandidateString.
Buffer != StaticCandidateBuffer)
2760 "CandidateString.Buffer = %p; "
2761 "StaticCandidateBuffer = %p\n",
2763 StaticCandidateString.
Buffer,
2764 StaticCandidateBuffer);
2772 if ((
SegmentSize + ExtensionLength + FileNameString->Length) >
2776 DbgPrint(
"%s: internal error #2; SegmentSize = %u, "
2777 "FileName->Length = %u, DefaultExtensionLength = %u\n",
2780 FileNameString->Length,
2787 StaticCandidateString.
MaximumLength = FileNameString->Length +
2791 if (!StaticCandidateString.
Buffer)
2794 DbgPrint(
"%s: Unable to allocate %u byte buffer for path candidate\n",
2814 FileNameString->Buffer,
2815 FileNameString->Length);
2816 CandidateEnd += (FileNameString->Length /
sizeof(
WCHAR));
2819 if (ExtensionString)
2823 ExtensionString->Buffer,
2824 ExtensionString->Length);
2825 CandidateEnd += (ExtensionString->Length /
sizeof(
WCHAR));
2833 StaticCandidateString.
Buffer) *
2853 DbgPrint(
"%s: Failing because we thought we found %wZ on "
2854 "the search path, but RtlGetfullPathNameUStrEx() "
2857 &StaticCandidateString,
2860 DPRINT(
"Status: %lx BUFFER: %S\n",
Status, CallerBuffer->Buffer);
2866 if (SegmentEnd != End)
2884 DPRINT(
"%wZ\n", FileNameString);
2888 if (!(ExtensionString) || !(ExtensionString->Length))
2896 if (!(
Flags & 4) && (FileNameString->Length))
2899 p = FileNameString->Buffer;
2900 End = &
p[FileNameString->Length /
sizeof(
WCHAR)];
2917 NamePlusExtLength = FileNameString->Length +
2918 ExtensionString->Length +
2923 DbgPrint(
"%s: Failing because filename plus extension (%Iu bytes) is too big\n",
2931 if (NamePlusExtLength > StaticCandidateString.
MaximumLength)
2937 if (!StaticCandidateString.
Buffer)
2940 DbgPrint(
"%s: Failing because allocating the dynamic filename buffer failed\n",
2954 DPRINT(
"SB: %wZ\n", &StaticCandidateString);
2975 DbgPrint(
"%s: Failing on \"%wZ\" because RtlGetfullPathNameUStrEx() "
2976 "failed with status %08lx\n",
2978 &StaticCandidateString,
2981 DPRINT(
"Status: %lx BUFFER: %S\n",
Status, CallerBuffer->Buffer);
2998 DbgPrint(
"%s: Failing because RtlGetfullPathNameUStrEx() on %wZ "
2999 "failed with status %08lx\n",
3004 DPRINT(
"Status: %lx BUFFER: %S\n",
Status, CallerBuffer->Buffer);
3013 if ((StaticCandidateString.
Buffer) &&
3014 (StaticCandidateString.
Buffer != StaticCandidateBuffer))
static IN BOOLEAN SucceedIfBusy
IN PUNICODE_STRING StaticString
IN PUNICODE_STRING IN PUNICODE_STRING DynamicString
IN PUNICODE_STRING IN PUNICODE_STRING IN PUNICODE_STRING * StringUsed
IN PUNICODE_STRING IN PUNICODE_STRING IN PUNICODE_STRING IN PSIZE_T FilePartSize OUT PBOOLEAN NameInvalid
static IN ULONG IN PWSTR OUT PCWSTR OUT PBOOLEAN OUT PATH_TYPE_AND_UNKNOWN * PathType
static IN ULONG IN PWSTR OUT PCWSTR OUT PBOOLEAN InvalidName
PRTL_UNICODE_STRING_BUFFER Path
#define OBJ_NAME_PATH_SEPARATOR
#define InterlockedIncrement
#define InterlockedDecrement
#define FILE_DIRECTORY_FILE
WCHAR FileNameBuffer[MAX_PATH]
WCHAR CurrentDirectory[1024]
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
#define RtlpAllocateStringMemory(Bytes, Tag)
NTSYSAPI NTSTATUS NTAPI RtlDosApplyFileIsolationRedirection_Ustr(IN ULONG Flags, IN PUNICODE_STRING OriginalName, IN PUNICODE_STRING Extension, IN OUT PUNICODE_STRING StaticString, IN OUT PUNICODE_STRING DynamicString, IN OUT PUNICODE_STRING *NewName, IN PULONG NewFlags, IN PSIZE_T FileNameSize, IN PSIZE_T RequiredLength)
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
UNICODE_STRING * PUNICODE_STRING
IN PDCB IN POEM_STRING IN PUNICODE_STRING IN OUT POEM_STRING ShortName
struct _FileName FileName
_Inout_opt_ PUNICODE_STRING Extension
_Must_inspect_result_ _In_ PFILE_OBJECT _In_opt_ HANDLE _In_ ULONG FileNameLength
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ SECURITY_INFORMATION _In_ ULONG _Out_opt_ PULONG LengthNeeded
#define FILE_SYNCHRONOUS_IO_NONALERT
@ FileFsDeviceInformation
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define OBJ_CASE_INSENSITIVE
NTSYSAPI void WINAPI RtlReleasePebLock(void)
NTSYSAPI void WINAPI RtlAcquirePebLock(void)
NTSYSAPI NTSTATUS WINAPI RtlInitUnicodeStringEx(PUNICODE_STRING, PCWSTR)
NTSYSAPI DWORD WINAPI RtlGetLongestNtPathLength(void)
NTSYSAPI PEB *WINAPI RtlGetCurrentPeb(void)
NTSYSAPI NTSTATUS WINAPI RtlDosPathNameToNtPathName_U_WithStatus(PCWSTR, PUNICODE_STRING, PWSTR *, CURDIR *)
#define memcpy(s1, s2, n)
#define memmove(s1, s2, n)
static OUT PIO_STATUS_BLOCK IoStatusBlock
#define InitializeObjectAttributes(p, n, a, r, s)
#define _Out_writes_bytes_(size)
#define _Out_z_bytecap_(size)
#define _Out_bytecap_(size)
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
NTSYSAPI NTSTATUS NTAPI ZwQueryAttributesFile(_In_ POBJECT_ATTRIBUTES ObjectAttributes, _Out_ PFILE_BASIC_INFORMATION FileInformation)
#define RTL_UNCHANGED_DOS_PATH
NTSYSAPI NTSTATUS NTAPI RtlDosSearchPath_Ustr(_In_ ULONG Flags, _In_ PUNICODE_STRING PathString, _In_ PUNICODE_STRING FileNameString, _In_ PUNICODE_STRING ExtensionString, _In_ PUNICODE_STRING CallerBuffer, _Inout_opt_ PUNICODE_STRING DynamicString, _Out_opt_ PUNICODE_STRING *FullNameOut, _Out_opt_ PSIZE_T FilePartSize, _Out_opt_ PSIZE_T LengthNeeded)
#define RTL_CONVERTED_NT_PATH
NTSYSAPI RTL_PATH_TYPE NTAPI RtlDetermineDosPathNameType_U(_In_ PCWSTR Path)
#define RTL_CONVERTED_UNC_PATH
NTSYSAPI NTSTATUS NTAPI RtlSetCurrentDirectory_U(_In_ PUNICODE_STRING name)
NTSYSAPI ULONG NTAPI RtlGetFullPathName_U(_In_ PCWSTR FileName, _In_ ULONG Size, _Out_z_bytecap_(Size) PWSTR Buffer, _Out_opt_ PWSTR *ShortName)
#define RTL_UNCHANGED_UNK_PATH
NTSYSAPI NTSTATUS NTAPI RtlQueryEnvironmentVariable_U(_In_opt_ PWSTR Environment, _In_ PCUNICODE_STRING Name, _Out_ PUNICODE_STRING Value)
NTSYSAPI ULONG NTAPI RtlGetCurrentDirectory_U(_In_ ULONG MaximumLength, _Out_bytecap_(MaximumLength) PWSTR Buffer)
struct _RTL_UNICODE_STRING_BUFFER * PRTL_UNICODE_STRING_BUFFER
@ RtlPathTypeRootLocalDevice
@ RtlPathTypeDriveRelative
@ RtlPathTypeDriveAbsolute
#define RTL_USER_PROCESS_PARAMETERS_NORMALIZED
enum _RTL_PATH_TYPE RTL_PATH_TYPE
WCHAR NTAPI RtlpUpcaseUnicodeChar(_In_ WCHAR Source)
WCHAR NTAPI RtlpDowncaseUnicodeChar(_In_ WCHAR Source)
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
NTSYSAPI NTSTATUS NTAPI NtOpenFile(OUT PHANDLE phFile, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG ShareMode, IN ULONG OpenMode)
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
NTSYSAPI BOOLEAN NTAPI RtlPrefixUnicodeString(IN PUNICODE_STRING String1, IN PUNICODE_STRING String2, IN BOOLEAN CaseInSensitive)
#define FILE_REMOVABLE_MEDIA
#define UNICODE_STRING_MAX_CHARS
#define UNICODE_STRING_MAX_BYTES
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define OBJ_HANDLE_TAGBITS
#define RTL_FIND_CHAR_IN_UNICODE_STRING_START_AT_END
NTSTATUS NTAPI RtlFindCharInUnicodeString(_In_ ULONG Flags, _In_ PCUNICODE_STRING SearchString, _In_ PCUNICODE_STRING MatchString, _Out_ PUSHORT Position)
#define STATUS_INTERNAL_ERROR
#define STATUS_SXS_KEY_NOT_FOUND
#define STATUS_NAME_TOO_LONG
static unsigned __int64 next
#define RtlpFreeStringMemory
ULONG NTAPI RtlIsDosDeviceName_U(IN PCWSTR Path)
NTSTATUS NTAPI RtlpDosPathNameToRelativeNtPathName_Ustr(IN BOOLEAN HaveRelative, IN PCUNICODE_STRING DosName, OUT PUNICODE_STRING NtName, OUT PCWSTR *PartName, OUT PRTL_RELATIVE_NAME_U RelativeName)
BOOLEAN NTAPI RtlDoesFileExists_UStr(IN PUNICODE_STRING FileName)
NTSTATUS NTAPI RtlpWin32NTNameToNtPathName_U(IN PUNICODE_STRING DosPath, OUT PUNICODE_STRING NtPath, OUT PCWSTR *PartName, OUT PRTL_RELATIVE_NAME_U RelativeName)
const UNICODE_STRING DeviceRootString
PRTLP_CURDIR_REF RtlpCurDirRef
const UNICODE_STRING RtlpDosNULDevice
const UNICODE_STRING RtlpDosSlashCONDevice
ULONG NTAPI RtlIsDosDeviceName_Ustr(IN PCUNICODE_STRING PathString)
static ULONG RtlpCollapsePath(PWSTR Path, ULONG mark, BOOLEAN SkipTrailingPathSeparators)
const UNICODE_STRING RtlpDosCONDevice
ULONG NTAPI RtlDosSearchPath_U(IN PCWSTR Path, IN PCWSTR FileName, IN PCWSTR Extension, IN ULONG Size, IN PWSTR Buffer, OUT PWSTR *PartName)
static SIZE_T RtlpSkipUNCPrefix(PCWSTR FileNameBuffer)
#define RTL_CURDIR_DROP_OLD_HANDLE
static const UNICODE_STRING RtlpDotLocal
const UNICODE_STRING RtlpDosPRNDevice
ULONG NTAPI RtlGetFullPathName_UEx(_In_ PWSTR FileName, _In_ ULONG BufferLength, _Out_writes_bytes_(BufferLength) PWSTR Buffer, _Out_opt_ PWSTR *FilePart, _Out_opt_ RTL_PATH_TYPE *InputPathType)
const UNICODE_STRING RtlpDosCOMDevice
static const UNICODE_STRING RtlpPathDividers
BOOLEAN NTAPI RtlDoesFileExists_U(IN PCWSTR FileName)
RTL_PATH_TYPE NTAPI RtlDetermineDosPathNameType_Ustr(IN PCUNICODE_STRING PathString)
BOOLEAN NTAPI RtlDosPathNameToRelativeNtPathName_Ustr(IN PCUNICODE_STRING DosName, OUT PUNICODE_STRING NtName, OUT PCWSTR *PartName, OUT PRTL_RELATIVE_NAME_U RelativeName)
const UNICODE_STRING RtlpDosDevicesUncPrefix
BOOLEAN NTAPI RtlDoesFileExists_UstrEx(IN PCUNICODE_STRING FileName, IN BOOLEAN SucceedIfBusy)
NTSTATUS NTAPI RtlGetLengthWithoutTrailingPathSeparators(IN ULONG Flags, IN PCUNICODE_STRING PathString, OUT PULONG Length)
ULONG NTAPI RtlGetFullPathName_Ustr(_In_ PUNICODE_STRING FileName, _In_ ULONG Size, _Out_z_bytecap_(Size) PWSTR Buffer, _Out_opt_ PCWSTR *ShortName, _Out_opt_ PBOOLEAN InvalidName, _Out_ RTL_PATH_TYPE *PathType)
NTSTATUS NTAPI RtlComputePrivatizedDllName_U(_In_ PUNICODE_STRING DllName, _Inout_ PUNICODE_STRING RealName, _Inout_ PUNICODE_STRING LocalName)
#define RTL_CURDIR_IS_REMOVABLE
BOOLEAN NTAPI RtlDosPathNameToNtPathName_U(IN PCWSTR DosName, OUT PUNICODE_STRING NtName, OUT PCWSTR *PartName, OUT PRTL_RELATIVE_NAME_U RelativeName)
NTSTATUS NTAPI RtlGetLengthWithoutLastFullDosOrNtPathElement(IN ULONG Flags, IN PCUNICODE_STRING Path, OUT PULONG LengthOut)
const UNICODE_STRING RtlpDosLPTDevice
const UNICODE_STRING RtlpDosDevicesPrefix
NTSTATUS NTAPI RtlpDosPathNameToRelativeNtPathName_U(IN BOOLEAN HaveRelative, IN PCWSTR DosName, OUT PUNICODE_STRING NtName, OUT PCWSTR *PartName, OUT PRTL_RELATIVE_NAME_U RelativeName)
NTSTATUS NTAPI RtlDosPathNameToRelativeNtPathName_U_WithStatus(IN PCWSTR DosName, OUT PUNICODE_STRING NtName, OUT PCWSTR *PartName, OUT PRTL_RELATIVE_NAME_U RelativeName)
NTSTATUS NTAPI RtlGetFullPathName_UstrEx(IN PUNICODE_STRING FileName, IN PUNICODE_STRING StaticString, IN PUNICODE_STRING DynamicString, IN PUNICODE_STRING *StringUsed, IN PSIZE_T FilePartSize, OUT PBOOLEAN NameInvalid, OUT RTL_PATH_TYPE *PathType, OUT PSIZE_T LengthNeeded)
NTSTATUS NTAPI RtlNtPathNameToDosPathName(IN ULONG Flags, IN OUT PRTL_UNICODE_STRING_BUFFER Path, OUT PULONG PathType, PULONG Unknown)
#define IS_PATH_SEPARATOR(x)
const UNICODE_STRING RtlpWin32NtRootSlash
NTSTATUS NTAPI RtlpCheckDeviceName(IN PUNICODE_STRING FileName, IN ULONG Length, OUT PBOOLEAN NameInvalid)
const UNICODE_STRING RtlpDoubleSlashPrefix
const UNICODE_STRING RtlpDosAUXDevice
VOID NTAPI RtlReleaseRelativeName(IN PRTL_RELATIVE_NAME_U RelativeName)
BOOLEAN NTAPI RtlDosPathNameToRelativeNtPathName_U(IN PCWSTR DosName, OUT PUNICODE_STRING NtName, OUT PCWSTR *PartName, OUT PRTL_RELATIVE_NAME_U RelativeName)
BOOLEAN NTAPI RtlDoesFileExists_UEx(IN PCWSTR FileName, IN BOOLEAN SucceedIfBusy)
#define RTL_CURDIR_ALL_FLAGS
static const UNICODE_STRING RtlpDefaultExtension
NTSTATUS NTAPI RtlpApplyLengthFunction(IN ULONG Flags, IN ULONG Type, IN PVOID UnicodeStringOrUnicodeStringBuffer, IN NTSTATUS(NTAPI *LengthFunction)(ULONG, PUNICODE_STRING, PULONG))
NTSTATUS NTAPI NtQueryVolumeInformationFile(HANDLE FileHandle, PIO_STATUS_BLOCK IoStatusBlock, PVOID FsInformation, ULONG Length, FS_INFORMATION_CLASS FsInformationClass)
#define STATUS_BUFFER_TOO_SMALL
PULONG MinorVersion OPTIONAL
PRTL_USER_PROCESS_PARAMETERS ProcessParameters
UNICODE_STRING RelativeName
HANDLE ContainingDirectory
UNICODE_STRING ImagePathName
#define RTL_CONSTANT_STRING(s)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define RtlMoveMemory(Destination, Source, Length)
#define STATUS_NOT_A_DIRECTORY
#define STATUS_ACCESS_DENIED
#define STATUS_INVALID_PARAMETER
#define STATUS_NO_SUCH_FILE
#define STATUS_SHARING_VIOLATION
#define STATUS_OBJECT_NAME_INVALID
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ ULONG _Out_ PVOID _Out_ PULONG RequiredSize
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
_In_ WDFDMATRANSACTION _In_ size_t MaximumLength
BOOL WINAPI EndPath(_In_ HDC)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
_Must_inspect_result_ _In_ ULONG Flags
_Inout_ PVOID _In_ ULONG SegmentSize
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _In_ LARGE_INTEGER ByteCount
_Out_ PUNICODE_STRING DosName
_In_ __drv_aliasesMem PSTRING Prefix