kernelbase: Do not return S_FALSE from UrlGetPartW().

Only return it from UrlGetPartA().

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2022-03-22 23:28:00 -05:00 committed by Alexandre Julliard
parent 17a8fd8454
commit a521bfd3f4
2 changed files with 4 additions and 7 deletions

View File

@ -4166,6 +4166,7 @@ HRESULT WINAPI UrlGetPartA(const char *url, char *out, DWORD *out_len, DWORD par
len2 = WideCharToMultiByte(CP_ACP, 0, outW, len + 1, out, *out_len, NULL, NULL);
*out_len = len2 - 1;
heap_free(inW);
if (hr == S_OK && !*out_len) hr = S_FALSE;
return hr;
}
@ -4382,7 +4383,7 @@ HRESULT WINAPI UrlGetPartW(const WCHAR *url, WCHAR *out, DWORD *out_len, DWORD p
}
TRACE("len=%ld %s\n", *out_len, wine_dbgstr_w(out));
return *out_len ? S_OK : S_FALSE;
return S_OK;
}
BOOL WINAPI UrlIsA(const char *url, URLIS Urlis)

View File

@ -748,8 +748,6 @@ static void test_UrlGetPart(void)
{"telnet://hostname/", URL_PART_HOSTNAME, URL_PARTFLAG_KEEPSCHEME, S_OK, "telnet:hostname"},
};
winetest_mute_threshold = 5;
hr = UrlGetPartA(NULL, NULL, NULL, URL_PART_SCHEME, 0);
ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
@ -837,7 +835,7 @@ static void test_UrlGetPart(void)
size = 1;
wcscpy(bufferW, L"x");
hr = UrlGetPartW(urlW, bufferW, &size, part, flags);
todo_wine_if (tests[i].todo_hr || tests[i].hr == S_FALSE)
todo_wine_if (tests[i].todo_hr)
{
if (tests[i].hr == S_OK)
ok(hr == E_POINTER, "Got hr %#lx.\n", hr);
@ -870,7 +868,7 @@ static void test_UrlGetPart(void)
size = ARRAY_SIZE(bufferW);
wcscpy(bufferW, L"x");
hr = UrlGetPartW(urlW, bufferW, &size, part, flags);
todo_wine_if ((tests[i].hr == S_FALSE || tests[i].todo_hr) && strcmp(url, "a:") && strcmp(url, "0:"))
todo_wine_if (tests[i].todo_hr && strcmp(url, "a:") && strcmp(url, "0:"))
ok(hr == (tests[i].hr == S_FALSE ? S_OK : tests[i].hr), "Got hr %#lx.\n", hr);
if (SUCCEEDED(hr))
{
@ -886,8 +884,6 @@ static void test_UrlGetPart(void)
winetest_pop_context();
}
winetest_mute_threshold = 42;
}
/* ########################### */