Commit bc584afa authored by Connor McAdams's avatar Connor McAdams Committed by Alexandre Julliard

uiautomationcore: Implement UiaNodeRelease.

parent ab4a0017
......@@ -3597,8 +3597,7 @@ static void test_UiaNodeFromProvider(void)
ref = IUnknown_AddRef((IUnknown *)node);
ok(ref == 3, "Unexpected refcnt %ld\n", ref);
ref = IUnknown_Release((IUnknown *)node);
ok(ref == 2, "Unexpected refcnt %ld\n", ref);
ok(UiaNodeRelease(node), "UiaNodeRelease returned FALSE\n");
ref = IUnknown_Release((IUnknown *)node);
ok(ref == 1, "Unexpected refcnt %ld\n", ref);
......@@ -3626,7 +3625,7 @@ static void test_UiaNodeFromProvider(void)
}
ok_method_sequence(node_from_prov3, "node_from_prov3");
IUnknown_Release((IUnknown *)node);
ok(UiaNodeRelease(node), "UiaNodeRelease returned FALSE\n");
ok(Provider_child.ref == 1, "Unexpected refcnt %ld\n", Provider_child.ref);
/* HWND exposed, but Provider2 not returned from WM_GETOBJECT. */
......@@ -3668,7 +3667,7 @@ static void test_UiaNodeFromProvider(void)
ok_method_sequence(node_from_prov4, "node_from_prov4");
ok(!!node, "node == NULL\n");
IUnknown_Release((IUnknown *)node);
ok(UiaNodeRelease(node), "UiaNodeRelease returned FALSE\n");
ok(Provider.ref == 1, "Unexpected refcnt %ld\n", Provider.ref);
/* Return Provider2 in response to WM_GETOBJECT. */
......@@ -3713,7 +3712,7 @@ static void test_UiaNodeFromProvider(void)
ok_method_sequence(node_from_prov5, "node_from_prov5");
IUnknown_Release((IUnknown *)node);
ok(UiaNodeRelease(node), "UiaNodeRelease returned FALSE\n");
ok(Provider.ref == 1, "Unexpected refcnt %ld\n", Provider.ref);
ok(Provider2.ref == 1, "Unexpected refcnt %ld\n", Provider2.ref);
......@@ -3749,7 +3748,7 @@ static void test_UiaNodeFromProvider(void)
ok(Provider.ref == 2, "Unexpected refcnt %ld\n", Provider.ref);
ok(!!node, "node == NULL\n");
IUnknown_Release((IUnknown *)node);
ok(UiaNodeRelease(node), "UiaNodeRelease returned FALSE\n");
ok(Provider.ref == 1, "Unexpected refcnt %ld\n", Provider.ref);
ok(Provider2.ref == 1, "Unexpected refcnt %ld\n", Provider2.ref);
......@@ -3783,7 +3782,7 @@ static void test_UiaNodeFromProvider(void)
ok(Provider_child.ref == 2, "Unexpected refcnt %ld\n", Provider.ref);
ok(!!node, "node == NULL\n");
IUnknown_Release((IUnknown *)node);
ok(UiaNodeRelease(node), "UiaNodeRelease returned FALSE\n");
ok(Provider_child.ref == 1, "Unexpected refcnt %ld\n", Provider.ref);
ok(Provider2.ref == 1, "Unexpected refcnt %ld\n", Provider2.ref);
......
......@@ -84,6 +84,14 @@ static const IWineUiaNodeVtbl uia_node_vtbl = {
uia_node_Release,
};
static struct uia_node *unsafe_impl_from_IWineUiaNode(IWineUiaNode *iface)
{
if (!iface || (iface->lpVtbl != &uia_node_vtbl))
return NULL;
return CONTAINING_RECORD(iface, struct uia_node, IWineUiaNode_iface);
}
/***********************************************************************
* UiaNodeFromProvider (uiautomationcore.@)
*/
......@@ -124,3 +132,19 @@ HRESULT WINAPI UiaNodeFromProvider(IRawElementProviderSimple *elprov, HUIANODE *
return hr;
}
/***********************************************************************
* UiaNodeRelease (uiautomationcore.@)
*/
BOOL WINAPI UiaNodeRelease(HUIANODE huianode)
{
struct uia_node *node = unsafe_impl_from_IWineUiaNode((IWineUiaNode *)huianode);
TRACE("(%p)\n", huianode);
if (!node)
return FALSE;
IWineUiaNode_Release(&node->IWineUiaNode_iface);
return TRUE;
}
......@@ -80,7 +80,7 @@
@ stub UiaNodeFromHandle
@ stub UiaNodeFromPoint
@ stdcall UiaNodeFromProvider(ptr ptr)
@ stub UiaNodeRelease
@ stdcall UiaNodeRelease(ptr)
@ stub UiaPatternRelease
#@ stub UiaProviderForNonClient
@ stdcall UiaProviderFromIAccessible(ptr long long ptr)
......
......@@ -257,6 +257,7 @@ HRESULT WINAPI UiaHostProviderFromHwnd(HWND hwnd, IRawElementProviderSimple **el
HRESULT WINAPI UiaProviderFromIAccessible(IAccessible *acc, long child_id, DWORD flags, IRawElementProviderSimple **elprov);
HRESULT WINAPI UiaGetPropertyValue(HUIANODE huianode, PROPERTYID prop_id, VARIANT *out_val);
HRESULT WINAPI UiaNodeFromProvider(IRawElementProviderSimple *elprov, HUIANODE *huianode);
BOOL WINAPI UiaNodeRelease(HUIANODE huianode);
#ifdef __cplusplus
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment