Author: ion
Date: Mon Jul 18 13:45:32 2011
New Revision: 52727

URL: http://svn.reactos.org/svn/reactos?rev=52727&view=rev
Log:
[RTL]: Fix a typo in RtlpDosPathNameToRelativeNtPathName_Ustr thanks so smiley.
[RTL]: Implement the unimplemented corner case based on the old ReactOS code.

Modified:
    trunk/reactos/lib/rtl/path.c

Modified: trunk/reactos/lib/rtl/path.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/rtl/path.c?rev=52727&r1=52726&r2=52727&view=diff
==============================================================================
--- trunk/reactos/lib/rtl/path.c [iso-8859-1] (original)
+++ trunk/reactos/lib/rtl/path.c [iso-8859-1] Mon Jul 18 13:45:32 2011
@@ -449,7 +449,7 @@
     CapturedDosName = *DosName;
 
     /* Check for \\?\\ form */
-    if ((CapturedDosName.Length <= RtlpWin32NtRootSlash.Length) |
+    if ((CapturedDosName.Length <= RtlpWin32NtRootSlash.Length) ||
         (CapturedDosName.Buffer[0] != RtlpWin32NtRootSlash.Buffer[0]) ||
         (CapturedDosName.Buffer[1] != RtlpWin32NtRootSlash.Buffer[1]) ||
         (CapturedDosName.Buffer[2] != RtlpWin32NtRootSlash.Buffer[2]) ||
@@ -589,11 +589,19 @@
         /* Check if the input path itself was relative */
         if (InputPathType == RtlPathTypeRelative)
         {
-            /* Don't handle this yet */
-            DPRINT1("UNIMPLEMENTED CORNER CASE\n");
-            RtlFreeHeap(RtlGetProcessHeap(), 0, NewBuffer);
-            RtlReleasePebLock();
-            return STATUS_NOT_IMPLEMENTED;
+            /* FIXME: HACK: Old code */
+            PCURDIR cd;
+            UNICODE_STRING us;
+            cd = (PCURDIR)&(NtCurrentPeb 
()->ProcessParameters->CurrentDirectory.DosPath);
+            RtlInitUnicodeString(&us, Buffer);
+            if (RtlEqualUnicodeString(&us, &cd->DosPath, TRUE))
+            {
+                Length = ((cd->DosPath.Length / sizeof(WCHAR)) - PrefixCut) + 
((InputPathType == 1) ? 8 : 4);
+                RelativeName->RelativeName.Buffer = NewBuffer + Length;
+                RelativeName->RelativeName.Length = NtName->Length - (Length * 
sizeof(WCHAR));
+                RelativeName->RelativeName.MaximumLength = 
RelativeName->RelativeName.Length;
+                RelativeName->ContainingDirectory = cd->Handle;
+            }
         }
     }
 


Reply via email to