Commit 336503f3 authored by Connor McAdams's avatar Connor McAdams Committed by Alexandre Julliard

uiautomationcore: Check providers for an IProxyProviderWinEventHandler interface…

uiautomationcore: Check providers for an IProxyProviderWinEventHandler interface when attaching events. Signed-off-by: 's avatarConnor McAdams <cmcadams@codeweavers.com>
parent 87af89cb
......@@ -16812,8 +16812,8 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para
set_uia_hwnd_expects(1, 1, 1, 2, 0);
hr = UiaEventAddWindow(event, hwnd[0]);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
test_provider_event_advise_added(&Provider_hwnd2, 0, TRUE);
test_provider_event_advise_added(&Provider_nc2, 0, TRUE);
test_provider_event_advise_added(&Provider_hwnd2, 0, FALSE);
test_provider_event_advise_added(&Provider_nc2, 0, FALSE);
check_uia_hwnd_expects_at_least(1, TRUE, 1, FALSE, 1, FALSE, 1, FALSE, 0, FALSE);
/*
......@@ -16982,9 +16982,9 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para
hr = UiaAddEvent(node, UIA_AutomationFocusChangedEventId, uia_event_callback, TreeScope_Element, NULL, 0, &cache_req,
&event);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
test_provider_event_advise_added(&Provider_proxy, 0, TRUE);
test_provider_event_advise_added(&Provider_hwnd, 0, TRUE);
test_provider_event_advise_added(&Provider_nc, 0, TRUE);
test_provider_event_advise_added(&Provider_proxy, 0, FALSE);
test_provider_event_advise_added(&Provider_hwnd, 0, FALSE);
test_provider_event_advise_added(&Provider_nc, 0, FALSE);
/* Raise WinEvent on the desktop HWND. */
set_provider_runtime_id(&Provider_child, UIA_RUNTIME_ID_PREFIX, HandleToUlong(GetDesktopWindow()));
......@@ -17026,9 +17026,9 @@ static DWORD WINAPI uia_proxy_provider_win_event_handler_test_thread(LPVOID para
hr = UiaAddEvent(node, UIA_AutomationFocusChangedEventId, uia_event_callback, TreeScope_Element, NULL, 0, &cache_req,
&event);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
test_provider_event_advise_added(&Provider_hwnd, 0, TRUE);
test_provider_event_advise_added(&Provider_nc, 0, TRUE);
test_provider_event_advise_added(&Provider_proxy, 0, TRUE);
test_provider_event_advise_added(&Provider_hwnd, 0, FALSE);
test_provider_event_advise_added(&Provider_nc, 0, FALSE);
test_provider_event_advise_added(&Provider_proxy, 0, FALSE);
/* WinEvent handled. */
set_uia_hwnd_expects(1, 1, 1, 2, 1);
......
......@@ -1835,7 +1835,7 @@ static HRESULT WINAPI uia_provider_attach_event(IWineUiaProvider *iface, LONG_PT
{
struct uia_provider *prov = impl_from_IWineUiaProvider(iface);
struct uia_event *event = (struct uia_event *)huiaevent;
IRawElementProviderFragmentRoot *elroot;
IRawElementProviderFragmentRoot *elroot = NULL;
IRawElementProviderFragment *elfrag;
SAFEARRAY *embedded_roots = NULL;
HRESULT hr;
......@@ -1863,12 +1863,17 @@ static HRESULT WINAPI uia_provider_attach_event(IWineUiaProvider *iface, LONG_PT
if (elroot)
{
IProxyProviderWinEventHandler *winevent_handler;
IRawElementProviderAdviseEvents *advise_events;
hr = IRawElementProviderFragmentRoot_QueryInterface(elroot, &IID_IRawElementProviderAdviseEvents,
(void **)&advise_events);
IRawElementProviderFragmentRoot_Release(elroot);
if (SUCCEEDED(hr))
if (!prov->return_nested_node && SUCCEEDED(IRawElementProviderFragmentRoot_QueryInterface(elroot,
&IID_IProxyProviderWinEventHandler, (void **)&winevent_handler)))
{
FIXME("MSAA to UIA event bridge currently unimplemented\n");
IProxyProviderWinEventHandler_Release(winevent_handler);
}
else if (SUCCEEDED(IRawElementProviderFragmentRoot_QueryInterface(elroot, &IID_IRawElementProviderAdviseEvents,
(void **)&advise_events)))
{
hr = uia_event_add_provider_event_adviser(advise_events, event);
IRawElementProviderAdviseEvents_Release(advise_events);
......@@ -1918,6 +1923,8 @@ static HRESULT WINAPI uia_provider_attach_event(IWineUiaProvider *iface, LONG_PT
}
exit:
if (elroot)
IRawElementProviderFragmentRoot_Release(elroot);
IRawElementProviderFragment_Release(elfrag);
SafeArrayDestroy(embedded_roots);
......
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