diff --git a/dlls/opcservices/package.c b/dlls/opcservices/package.c index 6e1a024c19e..ae610ac82d6 100644 --- a/dlls/opcservices/package.c +++ b/dlls/opcservices/package.c @@ -1011,9 +1011,16 @@ static HRESULT WINAPI opc_part_set_DeletePart(IOpcPartSet *iface, IOpcPartUri *n static HRESULT WINAPI opc_part_set_PartExists(IOpcPartSet *iface, IOpcPartUri *name, BOOL *exists) { - FIXME("iface %p, name %p, exists %p stub!\n", iface, name, exists); + struct opc_part_set *part_set = impl_from_IOpcPartSet(iface); - return E_NOTIMPL; + TRACE("iface %p, name %p, exists %p.\n", iface, name, exists); + + if (!name || !exists) + return E_POINTER; + + *exists = opc_part_set_get_part(part_set, name) != NULL; + + return S_OK; } static HRESULT WINAPI opc_part_set_GetEnumerator(IOpcPartSet *iface, IOpcPartEnumerator **enumerator) diff --git a/dlls/opcservices/tests/opcservices.c b/dlls/opcservices/tests/opcservices.c index 2bcf46fb9b7..8bcd9140df7 100644 --- a/dlls/opcservices/tests/opcservices.c +++ b/dlls/opcservices/tests/opcservices.c @@ -187,12 +187,19 @@ static void test_package(void) IOpcRelationshipSet_Release(relset); IOpcRelationshipSet_Release(relset2); + ret = 123; + hr = IOpcPartSet_PartExists(partset, NULL, &ret); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + ok(ret == 123, "Unexpected return value.\n"); + + hr = IOpcPartSet_PartExists(partset, part_uri, NULL); + ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr); + ret = FALSE; hr = IOpcPartSet_PartExists(partset, part_uri, &ret); -todo_wine { ok(SUCCEEDED(hr), "Unexpected hr %#x.\n", hr); ok(ret, "Expected part to exist.\n"); -} + IOpcPartUri_Release(part_uri); IOpcPart_Release(part);