mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:12:57 +00:00
[RTL]
Use RtlPrefixUnicodeString. svn path=/trunk/; revision=59165
This commit is contained in:
parent
b483880367
commit
b7f2a77833
1 changed files with 12 additions and 12 deletions
|
@ -479,13 +479,19 @@ RtlpDosPathNameToRelativeNtPathName_Ustr(IN BOOLEAN HaveRelative,
|
||||||
/* Capture input string */
|
/* Capture input string */
|
||||||
CapturedDosName = *DosName;
|
CapturedDosName = *DosName;
|
||||||
|
|
||||||
/* Check for \\?\ form */
|
/* Check for the presence of the NT prefix "\\?\" form */
|
||||||
if ((CapturedDosName.Length <= RtlpWin32NtRootSlash.Length) ||
|
if (RtlPrefixUnicodeString(&RtlpWin32NtRootSlash, &CapturedDosName, FALSE))
|
||||||
(CapturedDosName.Buffer[0] != RtlpWin32NtRootSlash.Buffer[0]) ||
|
|
||||||
(CapturedDosName.Buffer[1] != RtlpWin32NtRootSlash.Buffer[1]) ||
|
|
||||||
(CapturedDosName.Buffer[2] != RtlpWin32NtRootSlash.Buffer[2]) ||
|
|
||||||
(CapturedDosName.Buffer[3] != RtlpWin32NtRootSlash.Buffer[3]))
|
|
||||||
{
|
{
|
||||||
|
/* NT prefix is contained in the path */
|
||||||
|
|
||||||
|
/* Use the optimized path after acquiring the lock */
|
||||||
|
QuickPath = TRUE;
|
||||||
|
NewBuffer = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* NT prefix is not contained in the path */
|
||||||
|
|
||||||
/* Quick path won't be used */
|
/* Quick path won't be used */
|
||||||
QuickPath = FALSE;
|
QuickPath = FALSE;
|
||||||
|
|
||||||
|
@ -498,12 +504,6 @@ RtlpDosPathNameToRelativeNtPathName_Ustr(IN BOOLEAN HaveRelative,
|
||||||
DPRINT("MaxLength: %lx\n", MaxLength);
|
DPRINT("MaxLength: %lx\n", MaxLength);
|
||||||
if (!NewBuffer) return STATUS_NO_MEMORY;
|
if (!NewBuffer) return STATUS_NO_MEMORY;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Use the optimized path after acquiring the lock */
|
|
||||||
QuickPath = TRUE;
|
|
||||||
NewBuffer = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Lock the PEB and check if the quick path can be used */
|
/* Lock the PEB and check if the quick path can be used */
|
||||||
RtlAcquirePebLock();
|
RtlAcquirePebLock();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue