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
55c1acd9
Commit
55c1acd9
authored
Mar 22, 2023
by
Connor McAdams
Committed by
Alexandre Julliard
Mar 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uiautomationcore: Add support for UIA_ProviderDescriptionPropertyId.
Signed-off-by:
Connor McAdams
<
cmcadams@codeweavers.com
>
parent
2d852543
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
124 additions
and
1 deletion
+124
-1
uiautomation.c
dlls/uiautomationcore/tests/uiautomation.c
+0
-0
uia_client.c
dlls/uiautomationcore/uia_client.c
+122
-0
uia_ids.c
dlls/uiautomationcore/uia_ids.c
+2
-1
No files found.
dlls/uiautomationcore/tests/uiautomation.c
View file @
55c1acd9
This diff is collapsed.
Click to expand it.
dlls/uiautomationcore/uia_client.c
View file @
55c1acd9
...
...
@@ -1121,6 +1121,94 @@ static HRESULT traverse_uia_node_tree(HUIANODE huianode, struct UiaCondition *vi
return
hr
;
}
static
HRESULT
bstrcat_realloc
(
BSTR
*
bstr
,
const
WCHAR
*
cat_str
)
{
if
(
!
SysReAllocStringLen
(
bstr
,
NULL
,
SysStringLen
(
*
bstr
)
+
lstrlenW
(
cat_str
)))
{
SysFreeString
(
*
bstr
);
*
bstr
=
NULL
;
return
E_OUTOFMEMORY
;
}
lstrcatW
(
*
bstr
,
cat_str
);
return
S_OK
;
}
static
const
WCHAR
*
prov_desc_type_str
[]
=
{
L"Override"
,
L"Main"
,
L"Nonclient"
,
L"Hwnd"
,
};
static
HRESULT
get_node_provider_description_string
(
struct
uia_node
*
node
,
VARIANT
*
out_desc
)
{
const
struct
uia_prop_info
*
prop_info
=
uia_prop_info_from_id
(
UIA_ProviderDescriptionPropertyId
);
WCHAR
buf
[
256
]
=
{
0
};
HRESULT
hr
=
S_OK
;
BSTR
node_desc
;
int
i
;
VariantInit
(
out_desc
);
/*
* If we have a single provider, and it's a nested node provider, we just
* return the string directly from the nested node.
*/
if
((
node
->
prov_count
==
1
)
&&
is_nested_node_provider
(
node
->
prov
[
get_node_provider_type_at_idx
(
node
,
0
)]))
return
get_prop_val_from_node_provider
(
&
node
->
IWineUiaNode_iface
,
prop_info
,
0
,
out_desc
);
wsprintfW
(
buf
,
L"[pid:%d,providerId:%#x "
,
GetCurrentProcessId
(),
node
->
hwnd
);
if
(
!
(
node_desc
=
SysAllocString
(
buf
)))
return
E_OUTOFMEMORY
;
for
(
i
=
0
;
i
<
node
->
prov_count
;
i
++
)
{
int
prov_type
=
get_node_provider_type_at_idx
(
node
,
i
);
VARIANT
v
;
buf
[
0
]
=
0
;
/* There's a provider preceding this one, add a "; " separator. */
if
(
i
)
lstrcatW
(
buf
,
L"; "
);
/* Generate the provider type prefix string. */
lstrcatW
(
buf
,
prov_desc_type_str
[
prov_type
]);
if
(
node
->
parent_link_idx
==
i
)
lstrcatW
(
buf
,
L"(parent link)"
);
lstrcatW
(
buf
,
L":"
);
if
(
is_nested_node_provider
(
node
->
prov
[
prov_type
]))
lstrcatW
(
buf
,
L"Nested "
);
hr
=
bstrcat_realloc
(
&
node_desc
,
buf
);
if
(
FAILED
(
hr
))
goto
exit
;
VariantInit
(
&
v
);
hr
=
get_prop_val_from_node_provider
(
&
node
->
IWineUiaNode_iface
,
prop_info
,
i
,
&
v
);
if
(
FAILED
(
hr
))
goto
exit
;
hr
=
bstrcat_realloc
(
&
node_desc
,
V_BSTR
(
&
v
));
VariantClear
(
&
v
);
if
(
FAILED
(
hr
))
goto
exit
;
}
hr
=
bstrcat_realloc
(
&
node_desc
,
L"]"
);
if
(
SUCCEEDED
(
hr
))
{
V_VT
(
out_desc
)
=
VT_BSTR
;
V_BSTR
(
out_desc
)
=
node_desc
;
}
exit:
if
(
FAILED
(
hr
))
SysFreeString
(
node_desc
);
return
hr
;
}
/*
* IWineUiaProvider interface.
*/
...
...
@@ -1416,6 +1504,34 @@ static HRESULT uia_provider_get_special_prop_val(struct uia_provider *prov,
break
;
}
case
UIA_ProviderDescriptionPropertyId
:
{
/* FIXME: Get actual name of the executable our provider comes from. */
static
const
WCHAR
*
provider_origin
=
L" (unmanaged:uiautomationcore.dll)"
;
static
const
WCHAR
*
default_desc
=
L"Unidentified provider"
;
BSTR
prov_desc_str
;
VARIANT
v
;
hr
=
uia_provider_get_elem_prop_val
(
prov
,
prop_info
,
&
v
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
V_VT
(
&
v
)
==
VT_BSTR
)
prov_desc_str
=
SysAllocStringLen
(
V_BSTR
(
&
v
),
lstrlenW
(
V_BSTR
(
&
v
))
+
lstrlenW
(
provider_origin
));
else
prov_desc_str
=
SysAllocStringLen
(
default_desc
,
lstrlenW
(
default_desc
)
+
lstrlenW
(
provider_origin
));
VariantClear
(
&
v
);
if
(
!
prov_desc_str
)
return
E_OUTOFMEMORY
;
/* Append the name of the executable our provider comes from. */
wsprintfW
(
&
prov_desc_str
[
lstrlenW
(
prov_desc_str
)],
L"%s"
,
provider_origin
);
V_VT
(
ret_val
)
=
VT_BSTR
;
V_BSTR
(
ret_val
)
=
prov_desc_str
;
break
;
}
default:
break
;
}
...
...
@@ -2308,6 +2424,12 @@ HRESULT WINAPI UiaGetPropertyValue(HUIANODE huianode, PROPERTYID prop_id, VARIAN
return
S_OK
;
}
case
UIA_ProviderDescriptionPropertyId
:
hr
=
get_node_provider_description_string
(
node
,
&
v
);
if
(
SUCCEEDED
(
hr
)
&&
(
V_VT
(
&
v
)
==
VT_BSTR
))
*
out_val
=
v
;
return
hr
;
default:
break
;
}
...
...
dlls/uiautomationcore/uia_ids.c
View file @
55c1acd9
...
...
@@ -196,7 +196,8 @@ static const struct uia_prop_info default_uia_properties[] = {
{
&
Table_RowHeaders_Property_GUID
,
UIA_TableRowHeadersPropertyId
,
},
{
&
ControllerFor_Property_GUID
,
UIA_ControllerForPropertyId
,
PROP_TYPE_ELEM_PROP
,
UIAutomationType_ElementArray
,
},
{
&
ProviderDescription_Property_GUID
,
UIA_ProviderDescriptionPropertyId
,
},
{
&
ProviderDescription_Property_GUID
,
UIA_ProviderDescriptionPropertyId
,
PROP_TYPE_SPECIAL
,
UIAutomationType_String
,
},
{
&
AriaProperties_Property_GUID
,
UIA_AriaPropertiesPropertyId
,
PROP_TYPE_ELEM_PROP
,
UIAutomationType_String
,
},
{
&
LiveSetting_Property_GUID
,
UIA_LiveSettingPropertyId
,
...
...
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