Author: ion
Date: Mon Jul 11 00:47:44 2011
New Revision: 52624
URL: http://svn.reactos.org/svn/reactos?rev=52624&view=rev
Log:
[RTL]: RtlDetermineDosPathNameType_U Path is not optional. Checked build
ASSERTs if not present. Also, \\? is valid, not only \\., so this should fix a
bunch of incorrect path determinations. Aren't there supposed to be unit tests
for these things?!
Modified:
trunk/reactos/lib/rtl/path.c
Modified: trunk/reactos/lib/rtl/path.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/path.c?rev=52624&r1=52623&r2=52624&view=diff
==============================================================================
--- trunk/reactos/lib/rtl/path.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/path.c [iso-8859-1] Mon Jul 11 00:47:44 2011
@@ -66,32 +66,29 @@
* @implemented
*
*/
-ULONG NTAPI
-RtlDetermineDosPathNameType_U(PCWSTR Path)
-{
- DPRINT("RtlDetermineDosPathNameType_U %S\n", Path);
-
- if (Path == NULL)
- {
- return RtlPathTypeUnknown;
- }
-
- if (IS_PATH_SEPARATOR(Path[0]))
- {
- if (!IS_PATH_SEPARATOR(Path[1])) return RtlPathTypeRooted; /*
\xxx */
- if (Path[2] != L'.') return RtlPathTypeUncAbsolute;
/* \\xxx */
- if (IS_PATH_SEPARATOR(Path[3])) return RtlPathTypeLocalDevice;
/* \\.\xxx */
- if (Path[3]) return RtlPathTypeUncAbsolute;
/* \\.xxxx */
-
- return RtlPathTypeRootLocalDevice;
/* \\. */
- }
- else
- {
- if (!Path[0] || Path[1] != L':') return RtlPathTypeRelative; /*
xxx */
- if (IS_PATH_SEPARATOR(Path[2])) return RtlPathTypeDriveAbsolute; /*
x:\xxx */
-
- return RtlPathTypeDriveRelative; /*
x:xxx */
- }
+ULONG
+NTAPI
+RtlDetermineDosPathNameType_U(IN PCWSTR Path)
+{
+ DPRINT("RtlDetermineDosPathNameType_U %S\n", Path);
+ ASSERT(Path != NULL);
+
+ if (IS_PATH_SEPARATOR(Path[0]))
+ {
+ if (!IS_PATH_SEPARATOR(Path[1])) return RtlPathTypeRooted;
/* \xxx */
+ if ((Path[2] != L'.') && (Path[2] != L'?')) return
RtlPathTypeUncAbsolute;/* \\xxx */
+ if (IS_PATH_SEPARATOR(Path[3])) return RtlPathTypeLocalDevice;
/* \\.\xxx */
+ if (Path[3]) return RtlPathTypeUncAbsolute;
/* \\.xxxx */
+
+ return RtlPathTypeRootLocalDevice;
/* \\. */
+ }
+ else
+ {
+ if (!(Path[0]) || (Path[1] != L':')) return RtlPathTypeRelative;
/* xxx */
+ if (IS_PATH_SEPARATOR(Path[2])) return RtlPathTypeDriveAbsolute;
/* x:\xxx */
+
+ return RtlPathTypeDriveRelative;
/* x:xxx */
+ }
}