Commit 68d0c88b authored by Connor McAdams's avatar Connor McAdams Committed by Alexandre Julliard

uiautomationcore: Allow for refusal of HWND providers on node creation by…

uiautomationcore: Allow for refusal of HWND providers on node creation by non-nested node providers. Signed-off-by: 's avatarConnor McAdams <cmcadams@codeweavers.com>
parent aaf304f2
...@@ -1334,13 +1334,14 @@ static ULONG WINAPI uia_provider_Release(IWineUiaProvider *iface) ...@@ -1334,13 +1334,14 @@ static ULONG WINAPI uia_provider_Release(IWineUiaProvider *iface)
} }
static HRESULT get_variant_for_elprov_node(IRawElementProviderSimple *elprov, BOOL out_nested, static HRESULT get_variant_for_elprov_node(IRawElementProviderSimple *elprov, BOOL out_nested,
VARIANT *v) BOOL refuse_hwnd_providers, VARIANT *v)
{ {
HUIANODE node; HUIANODE node;
HRESULT hr; HRESULT hr;
VariantInit(v); VariantInit(v);
hr = create_uia_node_from_elprov(elprov, &node, !out_nested);
hr = create_uia_node_from_elprov(elprov, &node, !refuse_hwnd_providers);
IRawElementProviderSimple_Release(elprov); IRawElementProviderSimple_Release(elprov);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
...@@ -1444,7 +1445,7 @@ static HRESULT uia_provider_get_elem_prop_val(struct uia_provider *prov, ...@@ -1444,7 +1445,7 @@ static HRESULT uia_provider_get_elem_prop_val(struct uia_provider *prov,
if (FAILED(hr)) if (FAILED(hr))
goto exit; goto exit;
hr = get_variant_for_elprov_node(elprov, prov->return_nested_node, ret_val); hr = get_variant_for_elprov_node(elprov, prov->return_nested_node, prov->refuse_hwnd_node_providers, ret_val);
if (FAILED(hr)) if (FAILED(hr))
return hr; return hr;
...@@ -1770,7 +1771,7 @@ static HRESULT WINAPI uia_provider_navigate(IWineUiaProvider *iface, int nav_dir ...@@ -1770,7 +1771,7 @@ static HRESULT WINAPI uia_provider_navigate(IWineUiaProvider *iface, int nav_dir
if (FAILED(hr) || !elprov) if (FAILED(hr) || !elprov)
return hr; return hr;
hr = get_variant_for_elprov_node(elprov, prov->return_nested_node, out_val); hr = get_variant_for_elprov_node(elprov, prov->return_nested_node, prov->refuse_hwnd_node_providers, out_val);
if (FAILED(hr)) if (FAILED(hr))
return hr; return hr;
} }
...@@ -1802,7 +1803,7 @@ static HRESULT WINAPI uia_provider_get_focus(IWineUiaProvider *iface, VARIANT *o ...@@ -1802,7 +1803,7 @@ static HRESULT WINAPI uia_provider_get_focus(IWineUiaProvider *iface, VARIANT *o
IRawElementProviderFragment_Release(elfrag); IRawElementProviderFragment_Release(elfrag);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
hr = get_variant_for_elprov_node(elprov, prov->return_nested_node, out_val); hr = get_variant_for_elprov_node(elprov, prov->return_nested_node, prov->refuse_hwnd_node_providers, out_val);
if (FAILED(hr)) if (FAILED(hr))
VariantClear(out_val); VariantClear(out_val);
} }
...@@ -1881,7 +1882,7 @@ static HRESULT WINAPI uia_provider_attach_event(IWineUiaProvider *iface, LONG_PT ...@@ -1881,7 +1882,7 @@ static HRESULT WINAPI uia_provider_attach_event(IWineUiaProvider *iface, LONG_PT
if (FAILED(hr)) if (FAILED(hr))
goto exit; goto exit;
hr = create_uia_node_from_elprov(elprov, &node, !prov->return_nested_node); hr = create_uia_node_from_elprov(elprov, &node, !prov->refuse_hwnd_node_providers);
IRawElementProviderSimple_Release(elprov); IRawElementProviderSimple_Release(elprov);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
...@@ -2437,6 +2438,7 @@ static HRESULT create_wine_uia_nested_node_provider(struct uia_node *node, LRESU ...@@ -2437,6 +2438,7 @@ static HRESULT create_wine_uia_nested_node_provider(struct uia_node *node, LRESU
IWineUiaProvider_AddRef(provider_iface); IWineUiaProvider_AddRef(provider_iface);
prov_data = impl_from_IWineUiaProvider(provider_iface); prov_data = impl_from_IWineUiaProvider(provider_iface);
prov_data->refuse_hwnd_node_providers = FALSE;
prov_data->return_nested_node = FALSE; prov_data->return_nested_node = FALSE;
prov_data->parent_check_ran = FALSE; prov_data->parent_check_ran = FALSE;
......
...@@ -84,6 +84,7 @@ struct uia_provider { ...@@ -84,6 +84,7 @@ struct uia_provider {
LONG ref; LONG ref;
IRawElementProviderSimple *elprov; IRawElementProviderSimple *elprov;
BOOL refuse_hwnd_node_providers;
BOOL return_nested_node; BOOL return_nested_node;
BOOL parent_check_ran; BOOL parent_check_ran;
BOOL has_parent; BOOL has_parent;
......
...@@ -1751,7 +1751,7 @@ static HRESULT uia_provider_thread_add_node(HUIANODE node, SAFEARRAY *rt_id) ...@@ -1751,7 +1751,7 @@ static HRESULT uia_provider_thread_add_node(HUIANODE node, SAFEARRAY *rt_id)
HRESULT hr = S_OK; HRESULT hr = S_OK;
prov_data = impl_from_IWineUiaProvider(node_data->prov[prov_type]); prov_data = impl_from_IWineUiaProvider(node_data->prov[prov_type]);
node_data->nested_node = prov_data->return_nested_node = TRUE; node_data->nested_node = prov_data->return_nested_node = prov_data->refuse_hwnd_node_providers = TRUE;
TRACE("Adding node %p\n", node); TRACE("Adding node %p\n", node);
......
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