Author: cwittich
Date: Mon Mar 15 23:04:15 2010
New Revision: 46214
URL:
http://svn.reactos.org/svn/reactos?rev=46214&view=rev
Log:
[KERNEL32]
sync parameter validation for SearchPath with wine 1.1.40
Modified:
trunk/reactos/dll/win32/kernel32/file/dir.c
Modified: trunk/reactos/dll/win32/kernel32/file/dir.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/file/di…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/file/dir.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/file/dir.c [iso-8859-1] Mon Mar 15 23:04:15 2010
@@ -837,6 +837,12 @@
DWORD RetValue = 0;
NTSTATUS Status = STATUS_SUCCESS;
+ if (!lpFileName)
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return 0;
+ }
+
RtlInitAnsiString (&Path,
(LPSTR)lpPath);
RtlInitAnsiString (&FileName,
@@ -985,6 +991,12 @@
{
DWORD ret = 0;
+ if (!lpFileName || !lpFileName[0])
+ {
+ SetLastError(ERROR_INVALID_PARAMETER);
+ return 0;
+ }
+
/* If the name contains an explicit path, ignore the path */
if (ContainsPath(lpFileName))
{