diff --git a/reactos/include/ndk/mmfuncs.h b/reactos/include/ndk/mmfuncs.h index 30347061554..667995a25d7 100644 --- a/reactos/include/ndk/mmfuncs.h +++ b/reactos/include/ndk/mmfuncs.h @@ -23,6 +23,7 @@ Author: // Dependencies // #include +#include #ifndef NTOS_MODE_USER diff --git a/reactos/include/ndk/rtlfuncs.h b/reactos/include/ndk/rtlfuncs.h index 2542845ddd8..594a7aaf4a1 100644 --- a/reactos/include/ndk/rtlfuncs.h +++ b/reactos/include/ndk/rtlfuncs.h @@ -2512,13 +2512,6 @@ RtlDetermineDosPathNameType_U( IN PCWSTR Path ); -NTSYSAPI -RTL_PATH_TYPE -NTAPI -RtlDetermineDosPathNameType_Ustr( - IN PCUNICODE_STRING Path -); - NTSYSAPI ULONG NTAPI @@ -2619,6 +2612,13 @@ RtlGetFullPathName_UstrEx( OUT PSIZE_T LengthNeeded ); +NTSYSAPI +ULONG +NTAPI +RtlGetLongestNtPathLength( + VOID +); + NTSYSAPI ULONG NTAPI diff --git a/reactos/lib/rtl/path.c b/reactos/lib/rtl/path.c index 45858153643..ba53f968fd6 100644 --- a/reactos/lib/rtl/path.c +++ b/reactos/lib/rtl/path.c @@ -50,6 +50,42 @@ PRTLP_CURDIR_REF RtlpCurDirRef; /* PRIVATE FUNCTIONS **********************************************************/ +RTL_PATH_TYPE +NTAPI +RtlDetermineDosPathNameType_Ustr(IN PCUNICODE_STRING PathString) +{ + PWCHAR Path; + ULONG Chars; + + /* Validate the input */ + if (!PathString) return RtlPathTypeUnknown; + + Path = PathString->Buffer; + Chars = PathString->Length / sizeof(WCHAR); + + /* Return if there are no characters */ + if (!Chars) return RtlPathTypeUnknown; + + /* + * The algorithm is similar to RtlDetermineDosPathNameType_U but here we + * actually check for the path length before touching the characters + */ + if ((Chars < 1) || (IS_PATH_SEPARATOR(Path[0]))) + { + if ((Chars < 2) || !(IS_PATH_SEPARATOR(Path[1]))) return RtlPathTypeRooted; /* \x */ + if ((Chars < 3) || ((Path[2] != L'.') && (Path[2] != L'?'))) return RtlPathTypeUncAbsolute;/* \\x */ + if ((Chars >= 4) && (IS_PATH_SEPARATOR(Path[3]))) return RtlPathTypeLocalDevice; /* \\.\x or \\?\x */ + if (Chars != 3) return RtlPathTypeUncAbsolute; /* \\.x or \\?x */ + return RtlPathTypeRootLocalDevice; /* \\. or \\? */ + } + else + { + if ((Chars < 2) || (!(Path[0]) || (Path[1] != L':'))) return RtlPathTypeRelative; /* x */ + if ((Chars < 3) || (IS_PATH_SEPARATOR(Path[2]))) return RtlPathTypeDriveAbsolute; /* x:\ */ + return RtlPathTypeDriveRelative; /* x: */ + } +} + ULONG NTAPI RtlIsDosDeviceName_Ustr(IN PCUNICODE_STRING PathString) @@ -211,42 +247,6 @@ RtlIsDosDeviceName_Ustr(IN PCUNICODE_STRING PathString) return 0; } -RTL_PATH_TYPE -NTAPI -RtlDetermineDosPathNameType_Ustr(IN PCUNICODE_STRING PathString) -{ - PWCHAR Path; - ULONG Chars; - - /* Validate the input */ - if (!PathString) return RtlPathTypeUnknown; - - Path = PathString->Buffer; - Chars = PathString->Length / sizeof(WCHAR); - - /* Return if there are no characters */ - if (!Chars) return RtlPathTypeUnknown; - - /* - * The algorithm is similar to RtlDetermineDosPathNameType_U but here we - * actually check for the path length before touching the characters - */ - if ((Chars < 1) || (IS_PATH_SEPARATOR(Path[0]))) - { - if ((Chars < 2) || !(IS_PATH_SEPARATOR(Path[1]))) return RtlPathTypeRooted; /* \x */ - if ((Chars < 3) || ((Path[2] != L'.') && (Path[2] != L'?'))) return RtlPathTypeUncAbsolute;/* \\x */ - if ((Chars >= 4) && (IS_PATH_SEPARATOR(Path[3]))) return RtlPathTypeLocalDevice; /* \\.\x or \\?\x */ - if (Chars != 3) return RtlPathTypeUncAbsolute; /* \\.x or \\?x */ - return RtlPathTypeRootLocalDevice; /* \\. or \\? */ - } - else - { - if ((Chars < 2) || (!(Path[0]) || (Path[1] != L':'))) return RtlPathTypeRelative; /* x */ - if ((Chars < 3) || (IS_PATH_SEPARATOR(Path[2]))) return RtlPathTypeDriveAbsolute; /* x:\ */ - return RtlPathTypeDriveRelative; /* x: */ - } -} - NTSTATUS NTAPI RtlpCheckDeviceName(IN PUNICODE_STRING FileName,