Dan Kegel : urlmon: IsValidUrl should not fail if first parameter is not NULL.

Alexandre Julliard julliard at winehq.org
Mon Mar 28 14:21:59 CDT 2011


Module: wine
Branch: master
Commit: 6bbd0b87d5e9a7568f42ee7e90c299ac836a70ec
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=6bbd0b87d5e9a7568f42ee7e90c299ac836a70ec

Author: Dan Kegel <dank at kegel.com>
Date:   Mon Mar 21 01:45:51 2011 +0000

urlmon: IsValidUrl should not fail if first parameter is not NULL.

---

 dlls/urlmon/tests/misc.c  |   11 +++++++++++
 dlls/urlmon/urlmon_main.c |    4 ++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/dlls/urlmon/tests/misc.c b/dlls/urlmon/tests/misc.c
index cd3372c..fc1ba53 100644
--- a/dlls/urlmon/tests/misc.c
+++ b/dlls/urlmon/tests/misc.c
@@ -1454,9 +1454,20 @@ static void test_MkParseDisplayNameEx(void)
 static void test_IsValidURL(void)
 {
     HRESULT hr;
+    IBindCtx *bctx = NULL;
 
     hr = IsValidURL(NULL, 0, 0);
     ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", hr);
+
+    hr = IsValidURL(NULL, wszHttpWineHQ, 0);
+    ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+
+    CreateBindCtx(0, &bctx);
+
+    hr = IsValidURL(bctx, wszHttpWineHQ, 0);
+    ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+
+    IBindCtx_Release(bctx);
 }
 
 START_TEST(misc)
diff --git a/dlls/urlmon/urlmon_main.c b/dlls/urlmon/urlmon_main.c
index 57eeaf9..01442c1 100644
--- a/dlls/urlmon/urlmon_main.c
+++ b/dlls/urlmon/urlmon_main.c
@@ -426,7 +426,7 @@ HRESULT WINAPI DllRegisterServerEx(void)
  * Determines if a specified string is a valid URL.
  *
  * PARAMS
- *  pBC        [I] ignored, must be NULL.
+ *  pBC        [I] ignored, should be NULL.
  *  szURL      [I] string that represents the URL in question.
  *  dwReserved [I] reserved and must be zero.
  *
@@ -442,7 +442,7 @@ HRESULT WINAPI IsValidURL(LPBC pBC, LPCWSTR szURL, DWORD dwReserved)
 {
     FIXME("(%p, %s, %d): stub\n", pBC, debugstr_w(szURL), dwReserved);
 
-    if (pBC || dwReserved || !szURL)
+    if (dwReserved || !szURL)
         return E_INVALIDARG;
 
     return S_OK;




More information about the wine-cvs mailing list