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

uiautomationcore: Add support for ignoring ProviderOptions_UseComThreading when…

uiautomationcore: Add support for ignoring ProviderOptions_UseComThreading when creating an HUIANODE. Signed-off-by: 's avatarConnor McAdams <cmcadams@codeweavers.com>
parent 01d9a5ea
......@@ -16717,12 +16717,6 @@ static const struct prov_method_sequence win_event_handler_seq[] = {
{ &Provider_hwnd2, PROV_GET_HOST_RAW_ELEMENT_PROVIDER, METHOD_OPTIONAL }, /* Only done on Win10v1809+. */
{ &Provider_nc2, FRAG_NAVIGATE }, /* NavigateDirection_Parent */
{ &Provider_hwnd2, FRAG_NAVIGATE }, /* NavigateDirection_Parent */
/*
* The following two are currently only done on Wine. Windows doesn't do
* this because the node created is never passed out of the event thread.
*/
{ &Provider_nc2, PROV_GET_PROVIDER_OPTIONS, METHOD_OPTIONAL },
{ &Provider_hwnd2, PROV_GET_PROVIDER_OPTIONS, METHOD_OPTIONAL },
{ &Provider_nc2, WINEVENT_HANDLER_RESPOND_TO_WINEVENT, METHOD_TODO },
{ &Provider_hwnd2, WINEVENT_HANDLER_RESPOND_TO_WINEVENT, METHOD_TODO },
NODE_CREATE_SEQ_TODO(&Provider_child),
......
......@@ -613,6 +613,8 @@ static HRESULT create_uia_node(struct uia_node **out_node, int node_flags)
node->ignore_clientside_hwnd_provs = TRUE;
if (node_flags & NODE_FLAG_NO_PREPARE)
node->no_prepare = TRUE;
if (node_flags & NODE_FLAG_IGNORE_COM_THREADING)
node->ignore_com_threading = TRUE;
*out_node = node;
return S_OK;
......@@ -664,6 +666,9 @@ static HRESULT prepare_uia_node(struct uia_node *node)
prov_idx++;
}
if (node->ignore_com_threading)
return S_OK;
for (i = 0; i < PROV_TYPE_COUNT; i++)
{
enum ProviderOptions prov_opts;
......@@ -1361,7 +1366,7 @@ static HRESULT get_variant_for_elprov_node(IRawElementProviderSimple *elprov, BO
VariantInit(v);
hr = create_uia_node_from_elprov(elprov, &node, !refuse_hwnd_providers);
hr = create_uia_node_from_elprov(elprov, &node, !refuse_hwnd_providers, 0);
IRawElementProviderSimple_Release(elprov);
if (SUCCEEDED(hr))
{
......@@ -1910,7 +1915,7 @@ static HRESULT WINAPI uia_provider_attach_event(IWineUiaProvider *iface, LONG_PT
if (FAILED(hr))
goto exit;
hr = create_uia_node_from_elprov(elprov, &node, !prov->refuse_hwnd_node_providers);
hr = create_uia_node_from_elprov(elprov, &node, !prov->refuse_hwnd_node_providers, 0);
IRawElementProviderSimple_Release(elprov);
if (SUCCEEDED(hr))
{
......@@ -1969,7 +1974,7 @@ static HRESULT create_wine_uia_provider(struct uia_node *node, IRawElementProvid
static HRESULT uia_get_providers_for_hwnd(struct uia_node *node);
HRESULT create_uia_node_from_elprov(IRawElementProviderSimple *elprov, HUIANODE *out_node,
BOOL get_hwnd_providers)
BOOL get_hwnd_providers, int node_flags)
{
static const int unsupported_prov_opts = ProviderOptions_ProviderOwnsSetFocus | ProviderOptions_HasNativeIAccessible |
ProviderOptions_UseClientCoordinates;
......@@ -1998,7 +2003,7 @@ HRESULT create_uia_node_from_elprov(IRawElementProviderSimple *elprov, HUIANODE
else
prov_type = PROV_TYPE_MAIN;
hr = create_uia_node(&node, 0);
hr = create_uia_node(&node, node_flags);
if (FAILED(hr))
return hr;
......@@ -2040,7 +2045,7 @@ HRESULT WINAPI UiaNodeFromProvider(IRawElementProviderSimple *elprov, HUIANODE *
if (!elprov || !huianode)
return E_INVALIDARG;
return create_uia_node_from_elprov(elprov, huianode, TRUE);
return create_uia_node_from_elprov(elprov, huianode, TRUE, 0);
}
/*
......
......@@ -600,7 +600,7 @@ static HRESULT uia_win_event_for_each_callback(struct uia_event *event, void *da
if (FAILED(hr))
return hr;
hr = create_uia_node_from_elprov(elprov, &node, TRUE);
hr = create_uia_node_from_elprov(elprov, &node, TRUE, NODE_FLAG_IGNORE_COM_THREADING);
IRawElementProviderSimple_Release(elprov);
if (FAILED(hr))
return hr;
......@@ -1700,7 +1700,7 @@ static HRESULT uia_raise_elprov_event_callback(struct uia_event *event, void *da
* For events raised on server-side providers, we don't want to add any
* clientside HWND providers.
*/
hr = create_uia_node_from_elprov(event_data->elprov, &event_data->node, event_data->clientside_only);
hr = create_uia_node_from_elprov(event_data->elprov, &event_data->node, event_data->clientside_only, 0);
if (FAILED(hr))
return hr;
......
......@@ -57,6 +57,7 @@ enum uia_node_prov_type {
enum uia_node_flags {
NODE_FLAG_IGNORE_CLIENTSIDE_HWND_PROVS = 0x01,
NODE_FLAG_NO_PREPARE = 0x02,
NODE_FLAG_IGNORE_COM_THREADING = 0x04,
};
struct uia_node {
......@@ -74,6 +75,7 @@ struct uia_node {
BOOL nested_node;
BOOL disconnected;
int creator_prov_type;
BOOL ignore_com_threading;
BOOL ignore_clientside_hwnd_provs;
struct list prov_thread_list_entry;
......@@ -212,7 +214,7 @@ HRESULT attach_event_to_uia_node(HUIANODE node, struct uia_event *event) DECLSPE
HRESULT clone_uia_node(HUIANODE in_node, HUIANODE *out_node) DECLSPEC_HIDDEN;
HRESULT navigate_uia_node(struct uia_node *node, int nav_dir, HUIANODE *out_node) DECLSPEC_HIDDEN;
HRESULT create_uia_node_from_elprov(IRawElementProviderSimple *elprov, HUIANODE *out_node,
BOOL get_hwnd_providers) DECLSPEC_HIDDEN;
BOOL get_hwnd_providers, int node_flags) DECLSPEC_HIDDEN;
HRESULT uia_node_from_lresult(LRESULT lr, HUIANODE *huianode) DECLSPEC_HIDDEN;
HRESULT uia_condition_check(HUIANODE node, struct UiaCondition *condition) DECLSPEC_HIDDEN;
BOOL uia_condition_matched(HRESULT hr) DECLSPEC_HIDDEN;
......
......@@ -2275,7 +2275,7 @@ LRESULT WINAPI UiaReturnRawElementProvider(HWND hwnd, WPARAM wparam,
return 0;
}
hr = create_uia_node_from_elprov(elprov, &node, FALSE);
hr = create_uia_node_from_elprov(elprov, &node, FALSE, 0);
if (FAILED(hr))
{
WARN("Failed to create HUIANODE with hr %#lx\n", hr);
......@@ -2296,7 +2296,7 @@ HRESULT WINAPI UiaDisconnectProvider(IRawElementProviderSimple *elprov)
TRACE("(%p)\n", elprov);
hr = create_uia_node_from_elprov(elprov, &node, FALSE);
hr = create_uia_node_from_elprov(elprov, &node, FALSE, 0);
if (FAILED(hr))
return hr;
......
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