- Cancelled my last change.

svn path=/trunk/; revision=9638
This commit is contained in:
Hartmut Birr 2004-06-06 17:29:57 +00:00
parent 36b12d1025
commit 4a7c01adb6

View file

@ -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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries * PROJECT: ReactOS system libraries
@ -241,26 +241,18 @@ GetTempPathW (
if (!NT_SUCCESS(Status) && Status != STATUS_BUFFER_TOO_SMALL) 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.Length = RtlGetCurrentDirectory_U (Value.MaximumLength,
Value.Buffer); Value.Buffer);
} }
} }
Value.Length /= sizeof(WCHAR); if (NT_SUCCESS(Status))
if (NT_SUCCESS(Status) && Value.Length > 0 && Value.Length + 1 < nBufferLength)
{ {
lpBuffer[Value.Length] = L'\\'; lpBuffer[Value.Length / sizeof(WCHAR)] = L'\\';
lpBuffer[Value.Length + 1] = 0; lpBuffer[Value.Length / sizeof(WCHAR) + 1] = 0;
if (!RtlDoesFileExists_U(lpBuffer))
{
Value.Length = 0;
}
} }
return Value.Length ? Value.Length + 1 : 0; return Value.Length / sizeof(WCHAR) + 1;
} }