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
92623ccd
Commit
92623ccd
authored
Apr 21, 2023
by
Connor McAdams
Committed by
Alexandre Julliard
Jun 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uiautomationcore: Add support for advising providers of events on serverside events.
Signed-off-by:
Connor McAdams
<
cmcadams@codeweavers.com
>
parent
2da4d47b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
5 deletions
+67
-5
uiautomation.c
dlls/uiautomationcore/tests/uiautomation.c
+2
-2
uia_classes.idl
dlls/uiautomationcore/uia_classes.idl
+2
-0
uia_event.c
dlls/uiautomationcore/uia_event.c
+62
-3
uia_private.h
dlls/uiautomationcore/uia_private.h
+1
-0
No files found.
dlls/uiautomationcore/tests/uiautomation.c
View file @
92623ccd
...
...
@@ -14047,7 +14047,7 @@ static void test_UiaAddEvent_client_proc(void)
CHECK_CALLED_MULTI
(
prov_callback_proxy
,
3
);
}
post_event_message
(
hwnd
,
WM_UIA_TEST_CHECK_EVENT_ADVISE_ADDED
,
UIA_AutomationFocusChangedEventId
,
PROVIDER_ID
,
TRU
E
);
post_event_message
(
hwnd
,
WM_UIA_TEST_CHECK_EVENT_ADVISE_ADDED
,
UIA_AutomationFocusChangedEventId
,
PROVIDER_ID
,
FALS
E
);
/*
* Starts navigation in server process, then completes navigation in the
...
...
@@ -14071,7 +14071,7 @@ static void test_UiaAddEvent_client_proc(void)
hr
=
UiaRemoveEvent
(
event
);
ok
(
hr
==
S_OK
,
"Unexpected hr %#lx.
\n
"
,
hr
);
post_event_message
(
hwnd
,
WM_UIA_TEST_CHECK_EVENT_ADVISE_REMOVED
,
UIA_AutomationFocusChangedEventId
,
PROVIDER_ID
,
TRU
E
);
post_event_message
(
hwnd
,
WM_UIA_TEST_CHECK_EVENT_ADVISE_REMOVED
,
UIA_AutomationFocusChangedEventId
,
PROVIDER_ID
,
FALS
E
);
/*
* Register an event on a node that won't require any navigation to reach.
...
...
dlls/uiautomationcore/uia_classes.idl
View file @
92623ccd
...
...
@@ -73,6 +73,8 @@ library UIA_wine_private
interface
IWineUiaEvent
:
IUnknown
{
HRESULT
advise_events
(
[
in
]
BOOL
advise_added
)
;
HRESULT
set_event_data
(
[
in
]
const
GUID
*
event_guid
,
[
in
]
long
scope
,
[
in
]
VARIANT
runtime_id
,
[
in
]
IWineUiaEvent
*
event_iface
)
;
}
[
...
...
dlls/uiautomationcore/uia_event.c
View file @
92623ccd
...
...
@@ -257,6 +257,8 @@ static ULONG WINAPI uia_event_Release(IWineUiaEvent *iface)
rb_remove
(
&
uia_event_map
.
serverside_event_map
,
&
event
->
u
.
serverside
.
serverside_event_entry
);
uia_event_map
.
serverside_event_count
--
;
LeaveCriticalSection
(
&
event_map_cs
);
if
(
event
->
u
.
serverside
.
event_iface
)
IWineUiaEvent_Release
(
event
->
u
.
serverside
.
event_iface
);
if
(
event
->
u
.
serverside
.
node
)
IWineUiaNode_Release
(
event
->
u
.
serverside
.
node
);
}
...
...
@@ -292,7 +294,9 @@ static HRESULT WINAPI uia_event_advise_events(IWineUiaEvent *iface, BOOL advise_
if
(
!
advise_added
)
{
InterlockedIncrement
(
&
event
->
event_defunct
);
uia_event_map_entry_release
(
event
->
event_map_entry
);
/* FIXME: Remove this check once we can raise serverside events. */
if
(
event
->
event_type
==
EVENT_TYPE_CLIENTSIDE
)
uia_event_map_entry_release
(
event
->
event_map_entry
);
event
->
event_map_entry
=
NULL
;
for
(
i
=
0
;
i
<
event
->
event_advisers_count
;
i
++
)
...
...
@@ -304,11 +308,40 @@ static HRESULT WINAPI uia_event_advise_events(IWineUiaEvent *iface, BOOL advise_
return
S_OK
;
}
static
HRESULT
WINAPI
uia_event_set_event_data
(
IWineUiaEvent
*
iface
,
const
GUID
*
event_guid
,
long
scope
,
VARIANT
runtime_id
,
IWineUiaEvent
*
event_iface
)
{
struct
uia_event
*
event
=
impl_from_IWineUiaEvent
(
iface
);
TRACE
(
"%p, %s, %ld, %s, %p
\n
"
,
event
,
debugstr_guid
(
event_guid
),
scope
,
debugstr_variant
(
&
runtime_id
),
event_iface
);
assert
(
event
->
event_type
==
EVENT_TYPE_SERVERSIDE
);
event
->
event_id
=
UiaLookupId
(
AutomationIdentifierType_Event
,
event_guid
);
event
->
scope
=
scope
;
if
(
V_VT
(
&
runtime_id
)
==
(
VT_I4
|
VT_ARRAY
))
{
HRESULT
hr
;
hr
=
SafeArrayCopy
(
V_ARRAY
(
&
runtime_id
),
&
event
->
runtime_id
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to copy runtime id, hr %#lx
\n
"
,
hr
);
return
hr
;
}
}
event
->
u
.
serverside
.
event_iface
=
event_iface
;
IWineUiaEvent_AddRef
(
event_iface
);
return
S_OK
;
}
static
const
IWineUiaEventVtbl
uia_event_vtbl
=
{
uia_event_QueryInterface
,
uia_event_AddRef
,
uia_event_Release
,
uia_event_advise_events
,
uia_event_set_event_data
,
};
static
struct
uia_event
*
unsafe_impl_from_IWineUiaEvent
(
IWineUiaEvent
*
iface
)
...
...
@@ -598,8 +631,34 @@ static ULONG WINAPI uia_serverside_event_adviser_Release(IWineUiaEventAdviser *i
static
HRESULT
WINAPI
uia_serverside_event_adviser_advise
(
IWineUiaEventAdviser
*
iface
,
BOOL
advise_added
,
LONG_PTR
huiaevent
)
{
FIXME
(
"%p, %d, %#Ix: stub
\n
"
,
iface
,
advise_added
,
huiaevent
);
return
S_OK
;
struct
uia_serverside_event_adviser
*
adv_events
=
impl_from_serverside_IWineUiaEventAdviser
(
iface
);
struct
uia_event
*
event_data
=
(
struct
uia_event
*
)
huiaevent
;
HRESULT
hr
;
TRACE
(
"%p, %d, %#Ix
\n
"
,
adv_events
,
advise_added
,
huiaevent
);
if
(
advise_added
)
{
const
struct
uia_event_info
*
event_info
=
uia_event_info_from_id
(
event_data
->
event_id
);
VARIANT
v
;
VariantInit
(
&
v
);
if
(
event_data
->
runtime_id
)
{
V_VT
(
&
v
)
=
VT_I4
|
VT_ARRAY
;
V_ARRAY
(
&
v
)
=
event_data
->
runtime_id
;
}
hr
=
IWineUiaEvent_set_event_data
(
adv_events
->
event_iface
,
event_info
->
guid
,
event_data
->
scope
,
v
,
&
event_data
->
IWineUiaEvent_iface
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to set event data on serverside event, hr %#lx
\n
"
,
hr
);
return
hr
;
}
}
return
IWineUiaEvent_advise_events
(
adv_events
->
event_iface
,
advise_added
);
}
static
const
IWineUiaEventAdviserVtbl
uia_serverside_event_adviser_vtbl
=
{
...
...
dlls/uiautomationcore/uia_private.h
View file @
92623ccd
...
...
@@ -140,6 +140,7 @@ struct uia_event
*/
IWineUiaNode
*
node
;
IWineUiaEvent
*
event_iface
;
struct
rb_entry
serverside_event_entry
;
LONG
proc_id
;
}
serverside
;
...
...
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