From bf6c33299c944aaa113a0795231348b8a4a51fe8 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Sun, 16 Feb 2003 18:56:04 +0000 Subject: [PATCH] - Set the last error if SearchPathW fails. svn path=/trunk/; revision=4162 --- reactos/lib/kernel32/file/dir.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/reactos/lib/kernel32/file/dir.c b/reactos/lib/kernel32/file/dir.c index 4a6c05aff7d..cd14ebb4eeb 100644 --- a/reactos/lib/kernel32/file/dir.c +++ b/reactos/lib/kernel32/file/dir.c @@ -1,4 +1,4 @@ -/* $Id: dir.c,v 1.33 2003/01/15 21:24:33 chorns Exp $ +/* $Id: dir.c,v 1.34 2003/02/16 18:56:04 hbirr Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -598,6 +598,7 @@ SearchPathW ( len * sizeof(WCHAR)); if (EnvironmentBufferW == NULL) { + SetLastError(ERROR_OUTOFMEMORY); return 0; } @@ -620,6 +621,10 @@ SearchPathW ( { RtlFreeHeap(GetProcessHeap(), 0, EnvironmentBufferW); } + if (retCode == 0) + { + SetLastError(ERROR_FILE_NOT_FOUND); + } return retCode; }