Mike McCormack : wininet: Return correct errors in InternetOpenUrlW.

Alexandre Julliard julliard at wine.codeweavers.com
Tue May 16 06:24:40 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 2eec6b04c04807617d5a5dc33905abba60c6cf08
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=2eec6b04c04807617d5a5dc33905abba60c6cf08

Author: Mike McCormack <mike at codeweavers.com>
Date:   Mon May 15 22:02:34 2006 +0900

wininet: Return correct errors in InternetOpenUrlW.

---

 dlls/wininet/internet.c       |    7 +++++++
 dlls/wininet/tests/internet.c |    8 ++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c
index e58fca1..42b0255 100644
--- a/dlls/wininet/internet.c
+++ b/dlls/wininet/internet.c
@@ -2934,6 +2934,7 @@ HINTERNET WINAPI INTERNET_InternetOpenUr
 	/* gopher doesn't seem to be implemented in wine, but it's supposed
 	 * to be supported by InternetOpenUrlA. */
     default:
+        INTERNET_SetLastError(ERROR_INTERNET_UNRECOGNIZED_SCHEME);
 	break;
     }
 
@@ -2963,6 +2964,12 @@ HINTERNET WINAPI InternetOpenUrlW(HINTER
 	dump_INTERNET_FLAGS(dwFlags);
     }
 
+    if (!lpszUrl)
+    {
+        SetLastError(ERROR_INVALID_PARAMETER);
+        goto lend;
+    }
+
     hIC = (LPWININETAPPINFOW) WININET_GetObject( hInternet );
     if (NULL == hIC ||  hIC->hdr.htype != WH_HINIT) {
 	INTERNET_SetLastError(ERROR_INTERNET_INCORRECT_HANDLE_TYPE);
diff --git a/dlls/wininet/tests/internet.c b/dlls/wininet/tests/internet.c
index 43d17d6..a0737e3 100644
--- a/dlls/wininet/tests/internet.c
+++ b/dlls/wininet/tests/internet.c
@@ -143,6 +143,14 @@ static void test_null(void)
   ok(GetLastError() == ERROR_INVALID_HANDLE, "wrong error\n");
   ok(hc == NULL, "connect failed\n");
 
+  hc = InternetOpenUrlW(hi, NULL, NULL, 0, 0, 0);
+  ok(GetLastError() == ERROR_INVALID_PARAMETER, "wrong error\n");
+  ok(hc == NULL, "connect failed\n");
+
+  hc = InternetOpenUrlW(hi, szServer, NULL, 0, 0, 0);
+  ok(GetLastError() == ERROR_INTERNET_UNRECOGNIZED_SCHEME, "wrong error\n");
+  ok(hc == NULL, "connect failed\n");
+
   InternetCloseHandle(hi);
 }
 




More information about the wine-cvs mailing list