Author: weiden
Date: Sun Jul 15 02:49:47 2007
New Revision: 27668
URL:
http://svn.reactos.org/svn/reactos?rev=27668&view=rev
Log:
Simplify code
Modified:
trunk/reactos/dll/win32/kernel32/file/find.c
Modified: trunk/reactos/dll/win32/kernel32/file/find.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/fi…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/find.c (original)
+++ trunk/reactos/dll/win32/kernel32/file/find.c Sun Jul 15 02:49:47 2007
@@ -371,7 +371,7 @@
if (FALSE == bResult)
{
SetLastError(ERROR_PATH_NOT_FOUND);
- return NULL;
+ return INVALID_HANDLE_VALUE;
}
/* Save the buffer pointer for later, we need to free it! */
@@ -473,7 +473,7 @@
}
SetLastErrorByStatus (Status);
- return(NULL);
+ return INVALID_HANDLE_VALUE;
}
if (PathFileName.Length == 0)
@@ -484,7 +484,7 @@
0,
NtPathBuffer);
SetLastError(ERROR_FILE_NOT_FOUND);
- return NULL;
+ return INVALID_HANDLE_VALUE;
}
IHeader = RtlAllocateHeap (hProcessHeap,
@@ -499,7 +499,7 @@
NtClose(hDirectory);
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- return NULL;
+ return INVALID_HANDLE_VALUE;
}
IHeader->Type = FileFind;
@@ -532,7 +532,7 @@
if (!bResult)
{
FindClose((HANDLE)IHeader);
- return NULL;
+ return INVALID_HANDLE_VALUE;
}
RtlInitializeCriticalSection(&IData->Lock);
@@ -680,8 +680,6 @@
LPVOID lpSearchFilter,
DWORD dwAdditionalFlags)
{
- HANDLE Handle;
-
if (fInfoLevelId != FindExInfoStandard)
{
SetLastError(ERROR_INVALID_PARAMETER);
@@ -696,17 +694,10 @@
return INVALID_HANDLE_VALUE;
}
- Handle = InternalFindFirstFile (lpFileName,
- fSearchOp == FindExSearchLimitToDirectories,
- lpFindFileData,
- TRUE);
- if (Handle == NULL)
- {
- DPRINT("Failing request\n");
- return INVALID_HANDLE_VALUE;
- }
-
- return Handle;
+ return InternalFindFirstFile (lpFileName,
+ fSearchOp == FindExSearchLimitToDirectories,
+ lpFindFileData,
+ TRUE);
}
SetLastError(ERROR_INVALID_PARAMETER);
@@ -758,13 +749,6 @@
FALSE);
RtlFreeUnicodeString (&FileNameU);
-
- if (Handle == NULL)
- {
- DPRINT("Failing request\n");
- return INVALID_HANDLE_VALUE;
- }
-
return Handle;
}