From b7f2a778337854a01e0c442cb2e65af161fe389b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 2 Jun 2013 22:51:24 +0000 Subject: [PATCH] [RTL] Use RtlPrefixUnicodeString. svn path=/trunk/; revision=59165 --- reactos/lib/rtl/path.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/reactos/lib/rtl/path.c b/reactos/lib/rtl/path.c index 95a00ecb2a9..8d48262aadb 100644 --- a/reactos/lib/rtl/path.c +++ b/reactos/lib/rtl/path.c @@ -479,13 +479,19 @@ RtlpDosPathNameToRelativeNtPathName_Ustr(IN BOOLEAN HaveRelative, /* Capture input string */ CapturedDosName = *DosName; - /* Check for \\?\ form */ - if ((CapturedDosName.Length <= RtlpWin32NtRootSlash.Length) || - (CapturedDosName.Buffer[0] != RtlpWin32NtRootSlash.Buffer[0]) || - (CapturedDosName.Buffer[1] != RtlpWin32NtRootSlash.Buffer[1]) || - (CapturedDosName.Buffer[2] != RtlpWin32NtRootSlash.Buffer[2]) || - (CapturedDosName.Buffer[3] != RtlpWin32NtRootSlash.Buffer[3])) + /* Check for the presence of the NT prefix "\\?\" form */ + if (RtlPrefixUnicodeString(&RtlpWin32NtRootSlash, &CapturedDosName, FALSE)) { + /* 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 */ QuickPath = FALSE; @@ -498,12 +504,6 @@ RtlpDosPathNameToRelativeNtPathName_Ustr(IN BOOLEAN HaveRelative, DPRINT("MaxLength: %lx\n", MaxLength); 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 */ RtlAcquirePebLock();