From 624300da515769d2f9abc23162777033ca94d6e6 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Thu, 13 May 2004 20:32:18 +0000 Subject: [PATCH] - Report a failure for FindNextFile(NULL) instead of crashing. svn path=/trunk/; revision=9371 --- reactos/lib/kernel32/file/find.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/reactos/lib/kernel32/file/find.c b/reactos/lib/kernel32/file/find.c index c8b1b29b675..4ebdf1d4ebd 100644 --- a/reactos/lib/kernel32/file/find.c +++ b/reactos/lib/kernel32/file/find.c @@ -1,4 +1,4 @@ -/* $Id: find.c,v 1.43 2004/01/23 21:16:03 ekohl Exp $ +/* $Id: find.c,v 1.44 2004/05/13 20:32:18 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -48,6 +48,14 @@ InternalFindNextFile ( IO_STATUS_BLOCK IoStatusBlock; NTSTATUS Status; + DPRINT("InternalFindNextFile(%lx)\n", hFindFile); + + if (hFindFile == NULL) + { + SetLastError (ERROR_INVALID_HANDLE); + return FALSE; + } + IData = (PKERNEL32_FIND_FILE_DATA)hFindFile; if (IData->pFileInfo->NextEntryOffset != 0)