mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 04:03:02 +00:00
[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?!
svn path=/trunk/; revision=52624
This commit is contained in:
parent
2507c181d0
commit
67f44266b0
1 changed files with 19 additions and 22 deletions
|
@ -66,32 +66,29 @@ RtlGetLongestNtPathLength(VOID)
|
|||
* @implemented
|
||||
*
|
||||
*/
|
||||
ULONG NTAPI
|
||||
RtlDetermineDosPathNameType_U(PCWSTR Path)
|
||||
ULONG
|
||||
NTAPI
|
||||
RtlDetermineDosPathNameType_U(IN PCWSTR Path)
|
||||
{
|
||||
DPRINT("RtlDetermineDosPathNameType_U %S\n", Path);
|
||||
DPRINT("RtlDetermineDosPathNameType_U %S\n", Path);
|
||||
ASSERT(Path != NULL);
|
||||
|
||||
if (Path == NULL)
|
||||
{
|
||||
return RtlPathTypeUnknown;
|
||||
}
|
||||
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 */
|
||||
|
||||
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 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 */
|
||||
}
|
||||
return RtlPathTypeDriveRelative; /* x:xxx */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue