Author: ion
Date: Mon Jul 18 13:46:43 2011
New Revision: 52728

URL: http://svn.reactos.org/svn/reactos?rev=52728&view=rev
Log:
[RTL]: Makes sure there is a curdir handle.

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=52728&r1=52727&r2=52728&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:46:43 2011
@@ -593,14 +593,17 @@
             PCURDIR cd;
             UNICODE_STRING us;
             cd = (PCURDIR)&(NtCurrentPeb 
()->ProcessParameters->CurrentDirectory.DosPath);
-            RtlInitUnicodeString(&us, Buffer);
-            if (RtlEqualUnicodeString(&us, &cd->DosPath, TRUE))
+            if (cd->Handle)
             {
-                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;
+                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