[PATCH] urlmon/uri: Implement IsEqual for external implementations.

Nikolay Sivov nsivov at codeweavers.com
Sun Sep 16 23:00:11 CDT 2018


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/opcservices/tests/opcservices.c |  3 +--
 dlls/urlmon/uri.c                    | 18 ++++++++++++++++--
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/dlls/opcservices/tests/opcservices.c b/dlls/opcservices/tests/opcservices.c
index 936e2c751d..cfd11491ee 100644
--- a/dlls/opcservices/tests/opcservices.c
+++ b/dlls/opcservices/tests/opcservices.c
@@ -531,10 +531,9 @@ static void test_rel_part_uri(void)
             ok(SUCCEEDED(hr), "Failed to get source uri, hr %#x.\n", hr);
             ok(source_uri != source_uri2, "Unexpected instance.\n");
             hr = IOpcUri_IsEqual(source_uri, (IUri *)source_uri2, &ret);
-        todo_wine {
             ok(SUCCEEDED(hr), "IsEqual failed, hr %#x.\n", hr);
             ok(ret, "Expected equal uris.\n");
-        }
+
             hr = IOpcUri_QueryInterface(source_uri, &IID_IOpcPartUri, (void **)&unk);
             ok(hr == (is_root ? E_NOINTERFACE : S_OK), "Unexpected hr %#x, %s.\n", hr, rel_part_uri_tests[i].uri);
             if (unk)
diff --git a/dlls/urlmon/uri.c b/dlls/urlmon/uri.c
index 92978dc53f..20a7c1a5f3 100644
--- a/dlls/urlmon/uri.c
+++ b/dlls/urlmon/uri.c
@@ -5017,8 +5017,22 @@ static HRESULT WINAPI Uri_IsEqual(IUri *iface, IUri *pUri, BOOL *pfEqual)
 
     /* Try to convert it to a Uri (allows for a more simple comparison). */
     if(!(other = get_uri_obj(pUri))) {
-        FIXME("(%p)->(%p %p) No support for unknown IUri's yet.\n", iface, pUri, pfEqual);
-        return E_NOTIMPL;
+        IUri *other_uri;
+        HRESULT hr;
+        BSTR raw;
+
+        hr = IUri_GetRawUri(pUri, &raw);
+        if (FAILED(hr))
+            return hr;
+
+        hr = CreateUri(raw, Uri_CREATE_ALLOW_RELATIVE, 0, &other_uri);
+        SysFreeString(raw);
+        if (FAILED(hr))
+            return hr;
+
+        hr = Uri_IsEqual(iface, other_uri, pfEqual);
+        IUri_Release(other_uri);
+        return hr;
     }
 
     TRACE("comparing to %s\n", debugstr_w(other->canon_uri));
-- 
2.18.0




More information about the wine-devel mailing list