mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 18:46:29 +00:00
- Fix handling of INVALID_HANDLE_VALUE case in FindNextFile.
svn path=/trunk/; revision=10722
This commit is contained in:
parent
20ab7d6b27
commit
9008b900fe
1 changed files with 12 additions and 9 deletions
|
@ -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))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue