reactos/lib/kernel32/file
diff -u -r1.42 -r1.43
--- curdir.c 6 Jun 2004 08:50:26 -0000 1.42
+++ curdir.c 6 Jun 2004 17:29:57 -0000 1.43
@@ -1,4 +1,4 @@
-/* $Id: curdir.c,v 1.42 2004/06/06 08:50:26 hbirr Exp $
+/* $Id: curdir.c,v 1.43 2004/06/06 17:29:57 hbirr Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
@@ -241,26 +241,18 @@
if (!NT_SUCCESS(Status) && Status != STATUS_BUFFER_TOO_SMALL)
{
- /*
- * FIXME: Should we use the current directory or the windows directory ?
- */
Value.Length = RtlGetCurrentDirectory_U (Value.MaximumLength,
Value.Buffer);
}
}
-
- Value.Length /= sizeof(WCHAR);
- if (NT_SUCCESS(Status) && Value.Length > 0 && Value.Length + 1 < nBufferLength)
+
+ if (NT_SUCCESS(Status))
{
- lpBuffer[Value.Length] = L'\\';
- lpBuffer[Value.Length + 1] = 0;
- if (!RtlDoesFileExists_U(lpBuffer))
- {
- Value.Length = 0;
- }
+ lpBuffer[Value.Length / sizeof(WCHAR)] = L'\\';
+ lpBuffer[Value.Length / sizeof(WCHAR) + 1] = 0;
}
- return Value.Length ? Value.Length + 1 : 0;
+ return Value.Length / sizeof(WCHAR) + 1;
}