Author: tfaber
Date: Wed Apr 25 07:24:17 2012
New Revision: 56410

URL: http://svn.reactos.org/svn/reactos?rev=56410&view=rev
Log:
[RTL/NDK]
- 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

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

Modified: trunk/reactos/include/ndk/mmfuncs.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/mmfuncs.h?rev=56410&r1=56409&r2=56410&view=diff
==============================================================================
--- trunk/reactos/include/ndk/mmfuncs.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/mmfuncs.h [iso-8859-1] Wed Apr 25 07:24:17 2012
@@ -23,6 +23,7 @@
 // Dependencies
 //
 #include <umtypes.h>
+#include <mmtypes.h>
 
 #ifndef NTOS_MODE_USER
 

Modified: trunk/reactos/include/ndk/rtlfuncs.h
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtlfuncs.h?rev=56410&r1=56409&r2=56410&view=diff
==============================================================================
--- trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/rtlfuncs.h [iso-8859-1] Wed Apr 25 07:24:17 2012
@@ -2513,13 +2513,6 @@
 );
 
 NTSYSAPI
-RTL_PATH_TYPE
-NTAPI
-RtlDetermineDosPathNameType_Ustr(
-    IN PCUNICODE_STRING Path
-);
-
-NTSYSAPI
 ULONG
 NTAPI
 RtlDosSearchPath_U(
@@ -2617,6 +2610,13 @@
     OUT PBOOLEAN NameInvalid,
     OUT RTL_PATH_TYPE* PathType,
     OUT PSIZE_T LengthNeeded
+);
+
+NTSYSAPI
+ULONG
+NTAPI
+RtlGetLongestNtPathLength(
+    VOID
 );
 
 NTSYSAPI

Modified: trunk/reactos/lib/rtl/path.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/path.c?rev=56410&r1=56409&r2=56410&view=diff
==============================================================================
--- trunk/reactos/lib/rtl/path.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/path.c [iso-8859-1] Wed Apr 25 07:24:17 2012
@@ -50,6 +50,42 @@
 
 /* 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)
@@ -209,42 +245,6 @@
 
     /* Otherwise, this is not a valid DOS device */
     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


Reply via email to