Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
b532f695
Commit
b532f695
authored
Mar 23, 2023
by
Connor McAdams
Committed by
Alexandre Julliard
Apr 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uiautomationcore: Implement IUIAutomation::GetRootElement.
Signed-off-by:
Connor McAdams
<
cmcadams@codeweavers.com
>
parent
a97cdeaf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
75 additions
and
2 deletions
+75
-2
uiautomation.c
dlls/uiautomationcore/tests/uiautomation.c
+60
-0
uia_com_client.c
dlls/uiautomationcore/uia_com_client.c
+15
-2
No files found.
dlls/uiautomationcore/tests/uiautomation.c
View file @
b532f695
...
...
@@ -12199,6 +12199,65 @@ static void test_CUIAutomation_TreeWalker_ifaces(IUIAutomation *uia_iface)
UnregisterClassA
(
"test_CUIAutomation_TreeWalker_ifaces class"
,
NULL
);
}
static
void
test_GetRootElement
(
IUIAutomation
*
uia_iface
)
{
IUIAutomationElement
*
element
;
HRESULT
hr
;
VARIANT
v
;
hr
=
IUIAutomation_GetRootElement
(
uia_iface
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Unexpected hr %#lx.
\n
"
,
hr
);
UiaRegisterProviderCallback
(
test_uia_provider_callback
);
initialize_provider
(
&
Provider_hwnd
,
ProviderOptions_ClientSideProvider
,
GetDesktopWindow
(),
TRUE
);
initialize_provider
(
&
Provider_nc
,
ProviderOptions_ClientSideProvider
|
ProviderOptions_NonClientAreaProvider
,
GetDesktopWindow
(),
TRUE
);
initialize_provider
(
&
Provider_proxy
,
ProviderOptions_ClientSideProvider
,
GetDesktopWindow
(),
TRUE
);
Provider_proxy
.
ignore_hwnd_prop
=
TRUE
;
base_hwnd_prov
=
&
Provider_hwnd
.
IRawElementProviderSimple_iface
;
proxy_prov
=
&
Provider_proxy
.
IRawElementProviderSimple_iface
;
nc_prov
=
&
Provider_nc
.
IRawElementProviderSimple_iface
;
/* Retrieve an element representing the desktop HWND. */
method_sequences_enabled
=
FALSE
;
SET_EXPECT
(
prov_callback_base_hwnd
);
SET_EXPECT
(
prov_callback_nonclient
);
SET_EXPECT
(
prov_callback_proxy
);
hr
=
IUIAutomation_GetRootElement
(
uia_iface
,
&
element
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!!
element
,
"Node == NULL.
\n
"
);
ok
(
Provider_proxy
.
ref
==
2
,
"Unexpected refcnt %ld
\n
"
,
Provider_proxy
.
ref
);
ok
(
Provider_hwnd
.
ref
==
2
,
"Unexpected refcnt %ld
\n
"
,
Provider_hwnd
.
ref
);
ok
(
Provider_nc
.
ref
==
2
,
"Unexpected refcnt %ld
\n
"
,
Provider_nc
.
ref
);
CHECK_CALLED
(
prov_callback_base_hwnd
);
CHECK_CALLED
(
prov_callback_nonclient
);
CHECK_CALLED
(
prov_callback_proxy
);
hr
=
IUIAutomationElement_GetCurrentPropertyValueEx
(
element
,
UIA_ProviderDescriptionPropertyId
,
TRUE
,
&
v
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx
\n
"
,
hr
);
check_node_provider_desc_prefix
(
V_BSTR
(
&
v
),
GetCurrentProcessId
(),
GetDesktopWindow
());
check_node_provider_desc
(
V_BSTR
(
&
v
),
L"Main"
,
L"Provider_proxy"
,
TRUE
);
check_node_provider_desc
(
V_BSTR
(
&
v
),
L"Hwnd"
,
L"Provider_hwnd"
,
FALSE
);
check_node_provider_desc
(
V_BSTR
(
&
v
),
L"Nonclient"
,
L"Provider_nc"
,
FALSE
);
VariantClear
(
&
v
);
IUIAutomationElement_Release
(
element
);
ok
(
Provider_proxy
.
ref
==
1
,
"Unexpected refcnt %ld
\n
"
,
Provider_proxy
.
ref
);
ok
(
Provider_hwnd
.
ref
==
1
,
"Unexpected refcnt %ld
\n
"
,
Provider_hwnd
.
ref
);
ok
(
Provider_nc
.
ref
==
1
,
"Unexpected refcnt %ld
\n
"
,
Provider_nc
.
ref
);
initialize_provider
(
&
Provider_hwnd
,
ProviderOptions_ClientSideProvider
,
NULL
,
TRUE
);
initialize_provider
(
&
Provider_nc
,
ProviderOptions_ClientSideProvider
|
ProviderOptions_NonClientAreaProvider
,
NULL
,
TRUE
);
initialize_provider
(
&
Provider_proxy
,
ProviderOptions_ClientSideProvider
,
NULL
,
TRUE
);
base_hwnd_prov
=
proxy_prov
=
nc_prov
=
NULL
;
method_sequences_enabled
=
TRUE
;
UiaRegisterProviderCallback
(
NULL
);
}
struct
uia_com_classes
{
const
GUID
*
clsid
;
const
GUID
*
iid
;
...
...
@@ -12305,6 +12364,7 @@ static void test_CUIAutomation(void)
test_Element_GetPropertyValue
(
uia_iface
);
test_Element_cache_methods
(
uia_iface
);
test_Element_Find
(
uia_iface
);
test_GetRootElement
(
uia_iface
);
IUIAutomation_Release
(
uia_iface
);
CoUninitialize
();
...
...
dlls/uiautomationcore/uia_com_client.c
View file @
b532f695
...
...
@@ -2776,8 +2776,21 @@ static HRESULT WINAPI uia_iface_CompareRuntimeIds(IUIAutomation6 *iface, SAFEARR
static
HRESULT
WINAPI
uia_iface_GetRootElement
(
IUIAutomation6
*
iface
,
IUIAutomationElement
**
root
)
{
FIXME
(
"%p, %p: stub
\n
"
,
iface
,
root
);
return
E_NOTIMPL
;
struct
uia_iface
*
uia_iface
=
impl_from_IUIAutomation6
(
iface
);
HUIANODE
node
;
HRESULT
hr
;
TRACE
(
"%p, %p
\n
"
,
iface
,
root
);
if
(
!
root
)
return
E_POINTER
;
*
root
=
NULL
;
hr
=
UiaGetRootNode
(
&
node
);
if
(
FAILED
(
hr
))
return
hr
;
return
create_uia_element
(
root
,
uia_iface
->
is_cui8
,
node
);
}
static
HRESULT
WINAPI
uia_iface_ElementFromHandle
(
IUIAutomation6
*
iface
,
UIA_HWND
hwnd
,
IUIAutomationElement
**
out_elem
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment