Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/opcservices/tests/opcservices.c | 14 ++++++++++---- dlls/opcservices/uri.c | 21 +++++++++++++++++++-- 2 files changed, 29 insertions(+), 6 deletions(-)
diff --git a/dlls/opcservices/tests/opcservices.c b/dlls/opcservices/tests/opcservices.c index 986aae468a..ab8c2e47a5 100644 --- a/dlls/opcservices/tests/opcservices.c +++ b/dlls/opcservices/tests/opcservices.c @@ -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); diff --git a/dlls/opcservices/uri.c b/dlls/opcservices/uri.c index fa5ddbcde8..800ae34571 100644 --- a/dlls/opcservices/uri.c +++ b/dlls/opcservices/uri.c @@ -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,