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
2f3673ca
Commit
2f3673ca
authored
Feb 23, 2023
by
Connor McAdams
Committed by
Alexandre Julliard
Apr 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uiautomationcore: Implement UIA_NamePropertyId for default HWND provider.
Signed-off-by:
Connor McAdams
<
cmcadams@codeweavers.com
>
parent
9bf99d37
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
5 deletions
+42
-5
uiautomation.c
dlls/uiautomationcore/tests/uiautomation.c
+2
-3
uia_provider.c
dlls/uiautomationcore/uia_provider.c
+40
-2
No files found.
dlls/uiautomationcore/tests/uiautomation.c
View file @
2f3673ca
...
...
@@ -12336,9 +12336,8 @@ static void test_node_hwnd_provider_(HUIANODE node, HWND hwnd, const char *file,
SendMessageW
(
hwnd
,
WM_GETTEXT
,
ARRAY_SIZE
(
buf
),
(
LPARAM
)
buf
);
hr
=
UiaGetPropertyValue
(
node
,
UIA_NamePropertyId
,
&
v
);
ok_
(
file
,
line
)(
hr
==
S_OK
,
"Unexpected hr %#lx
\n
"
,
hr
);
todo_wine
ok_
(
file
,
line
)(
V_VT
(
&
v
)
==
VT_BSTR
,
"Unexpected VT %d
\n
"
,
V_VT
(
&
v
));
if
(
V_VT
(
&
v
)
==
VT_BSTR
)
ok
(
!
lstrcmpW
(
V_BSTR
(
&
v
),
buf
),
"Unexpected BSTR %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
v
)));
ok_
(
file
,
line
)(
V_VT
(
&
v
)
==
VT_BSTR
,
"Unexpected VT %d
\n
"
,
V_VT
(
&
v
));
ok
(
!
lstrcmpW
(
V_BSTR
(
&
v
),
buf
),
"Unexpected BSTR %s
\n
"
,
wine_dbgstr_w
(
V_BSTR
(
&
v
)));
VariantClear
(
&
v
);
winetest_pop_context
();
...
...
dlls/uiautomationcore/uia_provider.c
View file @
2f3673ca
...
...
@@ -1206,10 +1206,27 @@ static HRESULT uia_get_hr_for_last_error(void)
{
DWORD
last_err
=
GetLastError
();
if
(
last_err
==
ERROR_INVALID_WINDOW_HANDLE
)
switch
(
last_err
)
{
case
ERROR_INVALID_WINDOW_HANDLE
:
return
UIA_E_ELEMENTNOTAVAILABLE
;
return
E_FAIL
;
case
ERROR_TIMEOUT
:
return
UIA_E_TIMEOUT
;
default:
return
E_FAIL
;
}
}
#define UIA_DEFAULT_MSG_TIMEOUT 10000
static
HRESULT
uia_send_message_timeout
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
,
UINT
timeout
,
LRESULT
*
lres
)
{
*
lres
=
0
;
if
(
!
SendMessageTimeoutW
(
hwnd
,
msg
,
wparam
,
lparam
,
SMTO_NORMAL
,
timeout
,
(
PDWORD_PTR
)
lres
))
return
uia_get_hr_for_last_error
();
return
S_OK
;
}
/*
...
...
@@ -1328,6 +1345,27 @@ static HRESULT WINAPI base_hwnd_provider_GetPropertyValue(IRawElementProviderSim
break
;
}
case
UIA_NamePropertyId
:
{
LRESULT
lres
;
V_VT
(
ret_val
)
=
VT_BSTR
;
V_BSTR
(
ret_val
)
=
SysAllocString
(
L""
);
hr
=
uia_send_message_timeout
(
base_hwnd_prov
->
hwnd
,
WM_GETTEXTLENGTH
,
0
,
0
,
UIA_DEFAULT_MSG_TIMEOUT
,
&
lres
);
if
(
FAILED
(
hr
)
||
!
lres
)
break
;
if
(
!
SysReAllocStringLen
(
&
V_BSTR
(
ret_val
),
NULL
,
lres
))
{
hr
=
E_OUTOFMEMORY
;
break
;
}
hr
=
uia_send_message_timeout
(
base_hwnd_prov
->
hwnd
,
WM_GETTEXT
,
SysStringLen
(
V_BSTR
(
ret_val
))
+
1
,
(
LPARAM
)
V_BSTR
(
ret_val
),
UIA_DEFAULT_MSG_TIMEOUT
,
&
lres
);
break
;
}
default:
break
;
}
...
...
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