Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
2cfcddb2
Commit
2cfcddb2
authored
Oct 26, 2022
by
Connor McAdams
Committed by
Alexandre Julliard
Oct 26, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uiautomationcore: Add support for UIAutomationType_IntArray property comparisons.
Signed-off-by:
Connor McAdams
<
cmcadams@codeweavers.com
>
parent
c183afbf
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
24 deletions
+43
-24
uiautomation.c
dlls/uiautomationcore/tests/uiautomation.c
+11
-16
uia_client.c
dlls/uiautomationcore/uia_client.c
+30
-6
uia_private.h
dlls/uiautomationcore/uia_private.h
+1
-1
uia_provider.c
dlls/uiautomationcore/uia_provider.c
+1
-1
No files found.
dlls/uiautomationcore/tests/uiautomation.c
View file @
2cfcddb2
...
...
@@ -7257,17 +7257,15 @@ static void test_UiaGetUpdatedCache(void)
tree_struct
=
NULL
;
out_req
=
NULL
;
hr
=
UiaGetUpdatedCache
(
node
,
&
cache_req
,
NormalizeState_View
,
NULL
,
&
out_req
,
&
tree_struct
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
!!
out_req
,
"out_req == NULL
\n
"
);
todo_wine
ok
(
!!
tree_struct
,
"tree_struct == NULL
\n
"
);
if
(
out_req
)
{
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!!
out_req
,
"out_req == NULL
\n
"
);
ok
(
!!
tree_struct
,
"tree_struct == NULL
\n
"
);
exp_lbound
[
0
]
=
exp_lbound
[
1
]
=
0
;
exp_elems
[
0
]
=
exp_elems
[
1
]
=
1
;
test_cache_req_sa
(
out_req
,
exp_lbound
,
exp_elems
,
exp_node_desc
);
ok
(
!
wcscmp
(
tree_struct
,
L"P)"
),
"tree structure %s
\n
"
,
debugstr_w
(
tree_struct
));
ok_method_sequence
(
cache_req_seq4
,
NULL
);
}
SafeArrayDestroy
(
out_req
);
SysFreeString
(
tree_struct
);
...
...
@@ -7286,13 +7284,12 @@ static void test_UiaGetUpdatedCache(void)
tree_struct
=
NULL
;
out_req
=
NULL
;
hr
=
UiaGetUpdatedCache
(
node
,
&
cache_req
,
NormalizeState_View
,
NULL
,
&
out_req
,
&
tree_struct
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok_method_sequence
(
cache_req_seq5
,
NULL
);
ok
(
!
out_req
,
"out_req != NULL
\n
"
);
todo_wine
ok
(
!!
tree_struct
,
"tree_struct == NULL
\n
"
);
if
(
tree_struct
)
ok
(
!!
tree_struct
,
"tree_struct == NULL
\n
"
);
ok
(
!
wcscmp
(
tree_struct
,
L""
),
"tree structure %s
\n
"
,
debugstr_w
(
tree_struct
));
SysFreeString
(
tree_struct
);
VariantClear
(
&
v
);
}
...
...
@@ -7312,17 +7309,15 @@ static void test_UiaGetUpdatedCache(void)
tree_struct
=
NULL
;
out_req
=
NULL
;
hr
=
UiaGetUpdatedCache
(
node
,
&
cache_req
,
NormalizeState_View
,
NULL
,
&
out_req
,
&
tree_struct
);
todo_wine
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
!!
out_req
,
"out_req == NULL
\n
"
);
todo_wine
ok
(
!!
tree_struct
,
"tree_struct == NULL
\n
"
);
if
(
out_req
)
{
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
ok
(
!!
out_req
,
"out_req == NULL
\n
"
);
ok
(
!!
tree_struct
,
"tree_struct == NULL
\n
"
);
exp_lbound
[
0
]
=
exp_lbound
[
1
]
=
0
;
exp_elems
[
0
]
=
exp_elems
[
1
]
=
1
;
test_cache_req_sa
(
out_req
,
exp_lbound
,
exp_elems
,
exp_node_desc
);
ok
(
!
wcscmp
(
tree_struct
,
L"P)"
),
"tree structure %s
\n
"
,
debugstr_w
(
tree_struct
));
ok_method_sequence
(
cache_req_seq6
,
NULL
);
}
SafeArrayDestroy
(
out_req
);
SysFreeString
(
tree_struct
);
...
...
dlls/uiautomationcore/uia_client.c
View file @
2cfcddb2
...
...
@@ -49,7 +49,7 @@ static HRESULT get_safearray_bounds(SAFEARRAY *sa, LONG *lbound, LONG *elems)
return
S_OK
;
}
int
uia_compare_
runtime_ids
(
SAFEARRAY
*
sa1
,
SAFEARRAY
*
sa2
)
int
uia_compare_
safearrays
(
SAFEARRAY
*
sa1
,
SAFEARRAY
*
sa2
,
int
prop_type
)
{
LONG
i
,
idx
,
lbound
[
2
],
elems
[
2
];
int
val
[
2
];
...
...
@@ -72,6 +72,12 @@ int uia_compare_runtime_ids(SAFEARRAY *sa1, SAFEARRAY *sa2)
if
(
elems
[
0
]
!=
elems
[
1
])
return
(
elems
[
0
]
>
elems
[
1
])
-
(
elems
[
0
]
<
elems
[
1
]);
if
(
prop_type
!=
UIAutomationType_IntArray
)
{
FIXME
(
"Array type %#x value comparsion currently unimplemented.
\n
"
,
prop_type
);
return
-
1
;
}
for
(
i
=
0
;
i
<
elems
[
0
];
i
++
)
{
idx
=
lbound
[
0
]
+
i
;
...
...
@@ -1932,24 +1938,42 @@ static HRESULT uia_property_condition_check(HUIANODE node, struct UiaPropertyCon
switch
(
prop_info
->
type
)
{
case
UIAutomationType_Bool
:
case
UIAutomationType_IntArray
:
break
;
default:
FIXME
(
"PropertyCondition comparison unimplemented for type %#x
\n
"
,
prop_info
->
type
);
return
E_NOTIMPL
;
}
hr
=
UiaGetPropertyValue
(
node
,
prop_info
->
prop_id
,
&
v
);
if
(
FAILED
(
hr
)
||
V_VT
(
&
v
)
==
VT_UNKNOWN
)
return
S_FALSE
;
if
(
V_VT
(
&
v
)
==
V_VT
(
&
prop_cond
->
Value
))
{
switch
(
prop_info
->
type
)
{
case
UIAutomationType_Bool
:
if
(
V_BOOL
(
&
v
)
==
V_BOOL
(
&
prop_cond
->
Value
))
hr
=
S_OK
;
else
hr
=
S_FALSE
;
break
;
}
if
((
V_VT
(
&
v
)
==
V_VT
(
&
prop_cond
->
Value
))
&&
(
V_BOOL
(
&
v
)
==
V_BOOL
(
&
prop_cond
->
Value
)))
case
UIAutomationType_IntArray
:
if
(
!
uia_compare_safearrays
(
V_ARRAY
(
&
v
),
V_ARRAY
(
&
prop_cond
->
Value
),
prop_info
->
type
))
hr
=
S_OK
;
else
hr
=
S_FALSE
;
break
;
default:
FIXME
(
"PropertyCondition comparison unimplemented for type %#x
\n
"
,
prop_info
->
type
);
return
E_NOTIMPL
;
break
;
}
}
else
hr
=
S_FALSE
;
VariantClear
(
&
v
);
return
hr
;
...
...
dlls/uiautomationcore/uia_private.h
View file @
2cfcddb2
...
...
@@ -87,7 +87,7 @@ static inline struct uia_provider *impl_from_IWineUiaProvider(IWineUiaProvider *
}
/* uia_client.c */
int
uia_compare_
runtime_ids
(
SAFEARRAY
*
sa1
,
SAFEARRAY
*
sa2
)
DECLSPEC_HIDDEN
;
int
uia_compare_
safearrays
(
SAFEARRAY
*
sa1
,
SAFEARRAY
*
sa2
,
int
prop_type
)
DECLSPEC_HIDDEN
;
int
get_node_provider_type_at_idx
(
struct
uia_node
*
node
,
int
idx
)
DECLSPEC_HIDDEN
;
HRESULT
create_uia_node_from_elprov
(
IRawElementProviderSimple
*
elprov
,
HUIANODE
*
out_node
,
BOOL
get_hwnd_providers
)
DECLSPEC_HIDDEN
;
...
...
dlls/uiautomationcore/uia_provider.c
View file @
2cfcddb2
...
...
@@ -1159,7 +1159,7 @@ struct uia_provider_thread_map_entry
static
int
uia_runtime_id_compare
(
const
void
*
key
,
const
struct
rb_entry
*
entry
)
{
struct
uia_provider_thread_map_entry
*
prov_entry
=
RB_ENTRY_VALUE
(
entry
,
struct
uia_provider_thread_map_entry
,
entry
);
return
uia_compare_
runtime_ids
(
prov_entry
->
runtime_id
,
(
SAFEARRAY
*
)
ke
y
);
return
uia_compare_
safearrays
(
prov_entry
->
runtime_id
,
(
SAFEARRAY
*
)
key
,
UIAutomationType_IntArra
y
);
}
void
uia_provider_thread_remove_node
(
HUIANODE
node
)
...
...
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