mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
- Fix handling of INVALID_HANDLE_VALUE case in FindNextFile.
svn path=/trunk/; revision=10722
This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user