diff --git a/reactos/lib/kernel32/file/find.c b/reactos/lib/kernel32/file/find.c index 4ebdf1d4ebd..5c915ad0030 100644 --- a/reactos/lib/kernel32/file/find.c +++ b/reactos/lib/kernel32/file/find.c @@ -1,4 +1,4 @@ -/* $Id: find.c,v 1.44 2004/05/13 20:32:18 navaraf Exp $ +/* $Id: find.c,v 1.45 2004/08/28 22:07:51 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -50,12 +50,6 @@ InternalFindNextFile ( 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) @@ -424,12 +418,14 @@ FindNextFileA ( UNICODE_STRING FileNameU; ANSI_STRING FileName; - IData = (PKERNEL32_FIND_FILE_DATA)hFindFile; - if (IData == NULL) + if (hFindFile == INVALID_HANDLE_VALUE) { + SetLastError (ERROR_INVALID_HANDLE); + DPRINT("Failing request\n"); return FALSE; } + IData = (PKERNEL32_FIND_FILE_DATA)hFindFile; if (!InternalFindNextFile (hFindFile)) { DPRINT("InternalFindNextFile() failed\n"); @@ -580,6 +576,13 @@ FindNextFileW ( { PKERNEL32_FIND_FILE_DATA IData; + if (hFindFile == INVALID_HANDLE_VALUE) + { + SetLastError (ERROR_INVALID_HANDLE); + DPRINT("Failing request\n"); + return FALSE; + } + IData = (PKERNEL32_FIND_FILE_DATA)hFindFile; if (!InternalFindNextFile(hFindFile)) {