[RTL/NDK]
authorThomas Faber <thomas.faber@reactos.org>
Wed, 25 Apr 2012 07:24:17 +0000 (07:24 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Wed, 25 Apr 2012 07:24:17 +0000 (07:24 +0000)
- Add missing mmtypes.h include in mmfuncs.h
- Remove RtlDetermineDosPathNameType_Ustr from rtlfuncs.h, move it up in path.c
- Add RtlGetLongestNtPathLength to rtlfuncs.h

svn path=/trunk/; revision=56410

reactos/include/ndk/mmfuncs.h
reactos/include/ndk/rtlfuncs.h
reactos/lib/rtl/path.c

index 3034706..667995a 100644 (file)
@@ -23,6 +23,7 @@ Author:
 // Dependencies
 //
 #include <umtypes.h>
+#include <mmtypes.h>
 
 #ifndef NTOS_MODE_USER
 
index 2542845..594a7aa 100644 (file)
@@ -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
index 4585815..ba53f96 100644 (file)
@@ -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,