[KERNEL32]
authorChristoph von Wittich <christoph_vw@reactos.org>
Mon, 15 Mar 2010 22:04:15 +0000 (22:04 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Mon, 15 Mar 2010 22:04:15 +0000 (22:04 +0000)
sync parameter validation for SearchPath with wine 1.1.40

svn path=/trunk/; revision=46214

reactos/dll/win32/kernel32/file/dir.c

index c89afb6..97c0447 100644 (file)
@@ -837,6 +837,12 @@ SearchPathA (
         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 @@ SearchPathW(LPCWSTR lpPath,
 {
     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))
     {