From 6bbd0b87d5e9a7568f42ee7e90c299ac836a70ec Mon Sep 17 00:00:00 2001 From: Dan Kegel Date: Mon, 21 Mar 2011 01:45:51 +0000 Subject: [PATCH] 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 cd3372c7f6c..fc1ba5303d2 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 57eeaf97105..01442c1f5c5 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;