Commit in reactos on MAIN
include/ntdll/rtl.h+14-21.52 -> 1.53
lib/ntdll/rtl/path.c+45-281.29 -> 1.30
+59-30
2 modified files
RtlDetermineDosPathNameType_U: give meaningfull names to constands (from wine)

reactos/include/ntdll
rtl.h 1.52 -> 1.53
diff -u -r1.52 -r1.53
--- rtl.h	19 Nov 2004 01:30:34 -0000	1.52
+++ rtl.h	29 Nov 2004 00:05:31 -0000	1.53
@@ -1,4 +1,4 @@
-/* $Id: rtl.h,v 1.52 2004/11/19 01:30:34 weiden Exp $
+/* $Id: rtl.h,v 1.53 2004/11/29 00:05:31 gdalsnes Exp $
  *
  */
 
@@ -263,10 +263,22 @@
 
 /* Path functions */
 
+typedef enum
+{
+    INVALID_PATH = 0,
+    UNC_PATH,              /* "//foo" */
+    ABSOLUTE_DRIVE_PATH,   /* "c:/foo" */
+    RELATIVE_DRIVE_PATH,   /* "c:foo" */
+    ABSOLUTE_PATH,         /* "/foo" */
+    RELATIVE_PATH,         /* "foo" */
+    DEVICE_PATH,           /* "//./foo" */
+    UNC_DOT_PATH           /* "//." */
+} DOS_PATHNAME_TYPE;
+
 ULONG
 STDCALL
 RtlDetermineDosPathNameType_U (
-	PWSTR Path
+   PCWSTR Path
 	);
 
 BOOLEAN

reactos/lib/ntdll/rtl
path.c 1.29 -> 1.30
diff -u -r1.29 -r1.30
--- path.c	25 Aug 2004 15:04:19 -0000	1.29
+++ path.c	29 Nov 2004 00:05:31 -0000	1.30
@@ -1,4 +1,4 @@
-/* $Id: path.c,v 1.29 2004/08/25 15:04:19 navaraf Exp $
+/* $Id: path.c,v 1.30 2004/11/29 00:05:31 gdalsnes Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
@@ -171,46 +171,63 @@
 }
 
 
+
+
+/***********************************************************************
+ *             RtlDetermineDosPathNameType_U   (NTDLL.@)
+ */
+DOS_PATHNAME_TYPE WINAPI RtlDetermineDosPathNameType_U( PCWSTR path )
+{
+    if (IS_SEPARATOR(path[0]))
+    {
+        if (!IS_SEPARATOR(path[1])) return ABSOLUTE_PATH;       /* "/foo" */
+        if (path[2] != '.') return UNC_PATH;                    /* "//foo" */
+        if (IS_SEPARATOR(path[3])) return DEVICE_PATH;          /* "//./foo" */
+        if (path[3]) return UNC_PATH;                           /* "//.foo" */
+        return UNC_DOT_PATH;                                    /* "//." */
+    }
+    else
+    {
+        if (!path[0] || path[1] != ':') return RELATIVE_PATH;   /* "foo" */
+        if (IS_SEPARATOR(path[2])) return ABSOLUTE_DRIVE_PATH;  /* "c:/foo" */
+        return RELATIVE_DRIVE_PATH;                             /* "c:foo" */
+    }
+}
+
 /*
  * @implemented
+ *
  */
 ULONG STDCALL
-RtlDetermineDosPathNameType_U(PWSTR Path)
+RtlDetermineDosPathNameType_U(PCWSTR Path)
 {
    DPRINT("RtlDetermineDosPathNameType_U %S\n", Path);
 
    if (Path == NULL)
-     {
-	return 0;
-     }
+   {
+      return INVALID_PATH;
+   }
 
    if (IS_PATH_SEPARATOR(Path[0]))
-     {
-	if (!IS_PATH_SEPARATOR(Path[1]))
-	  {
-	     return 4;			/* \xxx   */
-	  }
-
-	if (Path[2] != L'.')
-	  return 1;			/* \\xxx   */
-
-	if (IS_PATH_SEPARATOR(Path[3]))
-	  return 6;			/* \\.\xxx */
+   {
+      if (!IS_PATH_SEPARATOR(Path[1])) return ABSOLUTE_PATH;         /* \xxx   */
+      if (Path[2] != L'.') return UNC_PATH;                          /* \\xxx   */
+      if (IS_PATH_SEPARATOR(Path[3])) return DEVICE_PATH;            /* \\.\xxx */
+      if (Path[3]) return UNC_PATH;                                  /* \\.xxxx */
 
-	if (Path[3])
-	  return 1;			/* \\.xxxx */
-
-	return 7;				/* \\.     */
-     }
+      return UNC_DOT_PATH;                                           /* \\.     */
+   }
    else
-     {
-	if (Path[1] != L':')
-		return 5;			/* xxx     */
-
-	if (IS_PATH_SEPARATOR(Path[2]))
-		return 2;			/* x:\xxx  */
+   {
+      /* FIXME: the Wine version of this line reads:
+       * if (!Path[1] || Path[1] != L':')    return RELATIVE_PATH
+       * Should we do this too?
+       * -Gunnar
+       */ 
+      if (Path[1] != L':') return RELATIVE_PATH;                     /* xxx     */
+      if (IS_PATH_SEPARATOR(Path[2])) return ABSOLUTE_DRIVE_PATH;    /* x:\xxx  */
 
-	return 3;				/* x:xxx   */
+      return RELATIVE_DRIVE_PATH;                                    /* x:xxx   */
    }
 }
 
CVSspam 0.2.8