[PATCH v3 0/4] MR4200: uiautomationcore: Miscellaneous fixes.
-- v3: uiautomationcore: Return TRUE from UiaClientsAreListening(). uiautomationcore: Don't set HRESULT when attempting to advise currently focused HUIANODE. uiautomationcore: Don't return failure from ::GetEmbeddedFragmentRoots stub on the default BaseHwnd provider. uiautomationcore: Implement IRawElementProviderFragment::GetEmbeddedFragmentRoots for MSAA providers. https://gitlab.winehq.org/wine/wine/-/merge_requests/4200
From: Connor McAdams <cmcadams(a)codeweavers.com> Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 19 +++++++++++++++++++ dlls/uiautomationcore/uia_provider.c | 4 ++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c index 9210583062f..6cb6e56d99b 100644 --- a/dlls/uiautomationcore/tests/uiautomation.c +++ b/dlls/uiautomationcore/tests/uiautomation.c @@ -3836,6 +3836,7 @@ static void test_uia_prov_from_acc_fragment_root(HWND hwnd) IRawElementProviderFragmentRoot *elroot, *elroot2; IRawElementProviderFragment *elfrag, *elfrag2; IRawElementProviderSimple *elprov; + SAFEARRAY *ret_arr; ULONG old_ref; HRESULT hr; @@ -3852,6 +3853,12 @@ static void test_uia_prov_from_acc_fragment_root(HWND hwnd) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!!elfrag, "elfrag == NULL\n"); + /* GetEmbeddedFragmentRoots test. */ + ret_arr = (void *)0xdeadbeef; + hr = IRawElementProviderFragment_GetEmbeddedFragmentRoots(elfrag, &ret_arr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(!ret_arr, "ret_arr != NULL\n"); + /* * get_FragmentRoot does the equivalent of calling * AccessibleObjectFromWindow with OBJID_CLIENT on the HWND associated @@ -4161,6 +4168,12 @@ static void test_uia_prov_from_acc_fragment_root(HWND hwnd) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!!elfrag, "elfrag == NULL\n"); + /* GetEmbeddedFragmentRoots test. */ + ret_arr = (void *)0xdeadbeef; + hr = IRawElementProviderFragment_GetEmbeddedFragmentRoots(elfrag, &ret_arr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(!ret_arr, "ret_arr != NULL\n"); + /* * Simple child element queries HWND as well, does not just return its * parent. @@ -4212,6 +4225,12 @@ static void test_uia_prov_from_acc_fragment_root(HWND hwnd) ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); ok(!!elfrag, "elfrag == NULL\n"); + /* GetEmbeddedFragmentRoots test. */ + ret_arr = (void *)0xdeadbeef; + hr = IRawElementProviderFragment_GetEmbeddedFragmentRoots(elfrag, &ret_arr); + ok(hr == S_OK, "Unexpected hr %#lx.\n", hr); + ok(!ret_arr, "ret_arr != NULL\n"); + /* * Again, same behavior as simple children. It doesn't just retrieve the * parent IAccessible, it queries the HWND. diff --git a/dlls/uiautomationcore/uia_provider.c b/dlls/uiautomationcore/uia_provider.c index 4ecef2a4752..33bed429ec6 100644 --- a/dlls/uiautomationcore/uia_provider.c +++ b/dlls/uiautomationcore/uia_provider.c @@ -1005,9 +1005,9 @@ static HRESULT WINAPI msaa_fragment_get_BoundingRectangle(IRawElementProviderFra static HRESULT WINAPI msaa_fragment_GetEmbeddedFragmentRoots(IRawElementProviderFragment *iface, SAFEARRAY **ret_val) { - FIXME("%p, %p: stub!\n", iface, ret_val); + TRACE("%p, %p\n", iface, ret_val); *ret_val = NULL; - return E_NOTIMPL; + return S_OK; } static HRESULT WINAPI msaa_fragment_SetFocus(IRawElementProviderFragment *iface) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4200
From: Connor McAdams <cmcadams(a)codeweavers.com> Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/uia_provider.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/uiautomationcore/uia_provider.c b/dlls/uiautomationcore/uia_provider.c index 33bed429ec6..2e5f0e6c6ea 100644 --- a/dlls/uiautomationcore/uia_provider.c +++ b/dlls/uiautomationcore/uia_provider.c @@ -1883,7 +1883,7 @@ static HRESULT WINAPI base_hwnd_fragment_GetEmbeddedFragmentRoots(IRawElementPro { FIXME("%p, %p: stub!\n", iface, ret_val); *ret_val = NULL; - return E_NOTIMPL; + return S_OK; } static HRESULT WINAPI base_hwnd_fragment_SetFocus(IRawElementProviderFragment *iface) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4200
From: Connor McAdams <cmcadams(a)codeweavers.com> create_uia_node_from_hwnd() is expected to fail if the HWND doesn't have a native serverside provider. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/uia_com_client.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/uiautomationcore/uia_com_client.c b/dlls/uiautomationcore/uia_com_client.c index 5c0d0cd0b9e..43b16db74f8 100644 --- a/dlls/uiautomationcore/uia_com_client.c +++ b/dlls/uiautomationcore/uia_com_client.c @@ -1372,8 +1372,7 @@ static HRESULT uia_event_handlers_add_handler(IUnknown *handler_iface, SAFEARRAY { HUIANODE node = NULL; - hr = create_uia_node_from_hwnd(info.hwndFocus, &node, NODE_FLAG_IGNORE_CLIENTSIDE_HWND_PROVS); - if (SUCCEEDED(hr)) + if (SUCCEEDED(create_uia_node_from_hwnd(info.hwndFocus, &node, NODE_FLAG_IGNORE_CLIENTSIDE_HWND_PROVS))) uia_com_focus_handler_advise_node(event, node, info.hwndFocus); UiaNodeRelease(node); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4200
From: Connor McAdams <cmcadams(a)codeweavers.com> This function always returns TRUE on Windows 7 and above, and now that we have stubs for all the event raising functions there should be no harm in doing the same. Signed-off-by: Connor McAdams <cmcadams(a)codeweavers.com> --- dlls/uiautomationcore/tests/uiautomation.c | 10 ++++++++++ dlls/uiautomationcore/uia_main.c | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/dlls/uiautomationcore/tests/uiautomation.c b/dlls/uiautomationcore/tests/uiautomation.c index 6cb6e56d99b..67dcb04dadc 100644 --- a/dlls/uiautomationcore/tests/uiautomation.c +++ b/dlls/uiautomationcore/tests/uiautomation.c @@ -18607,6 +18607,15 @@ static void test_uia_event_ProxyProviderWinEventHandler(void) UiaRegisterProviderCallback(NULL); } +static void test_UiaClientsAreListening(void) +{ + BOOL ret; + + /* Always returns TRUE on Windows 7 and above. */ + ret = UiaClientsAreListening(); + ok(!!ret, "ret != TRUE\n"); +} + /* * Once a process returns a UI Automation provider with * UiaReturnRawElementProvider it ends up in an implicit MTA until exit. This @@ -18663,6 +18672,7 @@ START_TEST(uiautomation) return; } + test_UiaClientsAreListening(); test_UiaHostProviderFromHwnd(); test_uia_reserved_value_ifaces(); test_UiaLookupId(); diff --git a/dlls/uiautomationcore/uia_main.c b/dlls/uiautomationcore/uia_main.c index 9ca320b1ba0..8c7a72bb35e 100644 --- a/dlls/uiautomationcore/uia_main.c +++ b/dlls/uiautomationcore/uia_main.c @@ -264,8 +264,8 @@ static const IRawElementProviderSimpleVtbl hwnd_host_provider_vtbl = { */ BOOL WINAPI UiaClientsAreListening(void) { - FIXME("()\n"); - return FALSE; + TRACE("()\n"); + return TRUE; } /*********************************************************************** -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/4200
Hi, It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated. The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=139360 Your paranoid android. === build (build log) === /home/winetest/tools/testbot/var/wine-exe32/../wine/dlls/uiautomationcore/tests/uiautomation.c:18615: undefined reference to `UiaClientsAreListening' collect2: error: ld returned 1 exit status Task: The exe32 Wine build failed === debian11 (build log) === /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/uiautomationcore/tests/uiautomation.c:18615: undefined reference to `UiaClientsAreListening' /home/winetest/tools/testbot/var/wine-win32/../wine/dlls/uiautomationcore/tests/uiautomation.c:18615: undefined reference to `UiaClientsAreListening' collect2: error: ld returned 1 exit status collect2: error: ld returned 1 exit status Task: The win32 Wine build failed === debian11b (build log) === /home/winetest/tools/testbot/var/wine-wow32/../wine/dlls/uiautomationcore/tests/uiautomation.c:18615: undefined reference to `UiaClientsAreListening' /home/winetest/tools/testbot/var/wine-wow32/../wine/dlls/uiautomationcore/tests/uiautomation.c:18615: undefined reference to `UiaClientsAreListening' collect2: error: ld returned 1 exit status collect2: error: ld returned 1 exit status Task: The wow32 Wine build failed
participants (3)
-
Connor McAdams -
Connor McAdams (@cmcadams) -
Marvin