opcservices: Implement CombinePartUri().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2018-09-19 14:19:32 +03:00 committed by Alexandre Julliard
parent 960cbe80c4
commit 2546e47bb2
2 changed files with 29 additions and 6 deletions

View File

@ -1053,19 +1053,25 @@ static void test_combine_uri(void)
hr = CreateUri(relativeW, Uri_CREATE_ALLOW_RELATIVE, 0, &relative_uri);
ok(SUCCEEDED(hr), "%u: failed to create relative uri, hr %#x.\n", i, hr);
combined_uri = (void *)0xdeadbeef;
hr = IOpcUri_CombinePartUri(uri, NULL, &combined_uri);
ok(hr == E_POINTER, "%u: failed to combine uris, hr %#x.\n", i, hr);
ok(!combined_uri, "Unexpected instance.\n");
hr = IOpcUri_CombinePartUri(uri, relative_uri, NULL);
ok(hr == E_POINTER, "%u: failed to combine uris, hr %#x.\n", i, hr);
hr = IOpcUri_CombinePartUri(uri, relative_uri, &combined_uri);
todo_wine
ok(SUCCEEDED(hr), "%u: failed to combine uris, hr %#x.\n", i, hr);
if (SUCCEEDED(hr))
{
hr = IOpcPartUri_GetRawUri(combined_uri, &str);
ok(SUCCEEDED(hr), "%u: failed to get raw uri, hr %#x.\n", i, hr);
todo_wine_if(i == 2 || i == 3)
ok(!lstrcmpW(str, combinedW), "%u: unexpected uri %s.\n", i, wine_dbgstr_w(str));
SysFreeString(str);
IOpcPartUri_Release(combined_uri);
}
heap_free(uriW);
heap_free(relativeW);
heap_free(combinedW);

View File

@ -357,9 +357,26 @@ static HRESULT WINAPI opc_uri_GetRelativeUri(IOpcPartUri *iface, IOpcPartUri *pa
static HRESULT WINAPI opc_uri_CombinePartUri(IOpcPartUri *iface, IUri *relative_uri, IOpcPartUri **combined)
{
FIXME("iface %p, relative_uri %p, combined %p stub!\n", iface, relative_uri, combined);
struct opc_uri *uri = impl_from_IOpcPartUri(iface);
IUri *combined_uri;
HRESULT hr;
return E_NOTIMPL;
TRACE("iface %p, relative_uri %p, combined %p.\n", iface, relative_uri, combined);
if (!combined)
return E_POINTER;
*combined = NULL;
if (!relative_uri)
return E_POINTER;
if (FAILED(hr = CoInternetCombineIUri(uri->uri, relative_uri, 0, &combined_uri, 0)))
return hr;
hr = opc_part_uri_create(combined_uri, NULL, combined);
IUri_Release(combined_uri);
return hr;
}
static HRESULT WINAPI opc_uri_ComparePartUri(IOpcPartUri *iface, IOpcPartUri *part_uri,