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
439d126a
Commit
439d126a
authored
Jan 28, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Jan 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sechost: Support device interface notifications filtering.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
30af95f4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
hotplug.c
dlls/dinput/tests/hotplug.c
+2
-5
service.c
dlls/sechost/service.c
+18
-2
No files found.
dlls/dinput/tests/hotplug.c
View file @
439d126a
...
...
@@ -197,7 +197,6 @@ static LRESULT CALLBACK devnotify_wndproc( HWND hwnd, UINT msg, WPARAM wparam, L
winetest_push_context
(
"%u"
,
device_change_count
);
todo_wine_if
(
IsEqualGUID
(
&
iface
->
dbcc_classguid
,
&
control_class
)
&&
!
device_change_all
)
ok
(
IsEqualGUID
(
&
iface
->
dbcc_classguid
,
&
expect_guid
),
"got dbch_classguid %s
\n
"
,
debugstr_guid
(
&
iface
->
dbcc_classguid
)
);
ok
(
iface
->
dbcc_size
>=
offsetof
(
DEV_BROADCAST_DEVICEINTERFACE_W
,
dbcc_name
[
wcslen
(
iface
->
dbcc_name
)
+
1
]
),
...
...
@@ -315,8 +314,7 @@ static void test_RegisterDeviceNotification(void)
while
(
PeekMessageW
(
&
msg
,
hwnd
,
0
,
0
,
PM_REMOVE
))
DispatchMessageW
(
&
msg
);
device_change_count
=
0
;
if
(
!
strcmp
(
winetest_platform
,
"wine"
))
device_change_expect
=
4
;
else
device_change_expect
=
2
;
device_change_expect
=
2
;
device_change_hwnd
=
hwnd
;
device_change_all
=
FALSE
;
stop_event
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
...
...
@@ -349,8 +347,7 @@ static void test_RegisterDeviceNotification(void)
while
(
PeekMessageW
(
&
msg
,
hwnd
,
0
,
0
,
PM_REMOVE
))
DispatchMessageW
(
&
msg
);
device_change_count
=
0
;
if
(
!
strcmp
(
winetest_platform
,
"wine"
))
device_change_expect
=
4
;
else
device_change_expect
=
2
;
device_change_expect
=
2
;
device_change_hwnd
=
hwnd
;
device_change_all
=
FALSE
;
stop_event
=
CreateEventW
(
NULL
,
FALSE
,
FALSE
,
NULL
);
...
...
dlls/sechost/service.c
View file @
439d126a
...
...
@@ -1990,6 +1990,23 @@ struct device_notify_registration
struct
device_notification_details
details
;
};
static
BOOL
notification_filter_matches
(
DEV_BROADCAST_HDR
*
filter
,
DEV_BROADCAST_HDR
*
event
)
{
if
(
!
filter
->
dbch_devicetype
)
return
TRUE
;
if
(
filter
->
dbch_devicetype
!=
event
->
dbch_devicetype
)
return
FALSE
;
if
(
filter
->
dbch_devicetype
==
DBT_DEVTYP_DEVICEINTERFACE
)
{
DEV_BROADCAST_DEVICEINTERFACE_W
*
filter_iface
=
(
DEV_BROADCAST_DEVICEINTERFACE_W
*
)
filter
;
DEV_BROADCAST_DEVICEINTERFACE_W
*
event_iface
=
(
DEV_BROADCAST_DEVICEINTERFACE_W
*
)
event
;
if
(
filter_iface
->
dbcc_size
==
offsetof
(
DEV_BROADCAST_DEVICEINTERFACE_W
,
dbcc_classguid
))
return
TRUE
;
return
IsEqualGUID
(
&
filter_iface
->
dbcc_classguid
,
&
event_iface
->
dbcc_classguid
);
}
FIXME
(
"Filter dbch_devicetype %u not implemented
\n
"
,
filter
->
dbch_devicetype
);
return
TRUE
;
}
static
DWORD
WINAPI
device_notify_proc
(
void
*
arg
)
{
WCHAR
endpoint
[]
=
L"
\\
pipe
\\
wine_plugplay"
;
...
...
@@ -2074,6 +2091,7 @@ static DWORD WINAPI device_notify_proc( void *arg )
for
(
i
=
0
;
i
<
details_copy_nelems
;
i
++
)
{
if
(
!
notification_filter_matches
(
&
details_copy
[
i
].
filter
.
header
,
(
DEV_BROADCAST_HDR
*
)
buf
))
continue
;
details_copy
[
i
].
cb
(
details_copy
[
i
].
handle
,
code
,
(
DEV_BROADCAST_HDR
*
)
buf
);
}
MIDL_user_free
(
buf
);
...
...
@@ -2104,8 +2122,6 @@ HDEVNOTIFY WINAPI I_ScRegisterDeviceNotification( struct device_notification_det
TRACE
(
"callback %p, handle %p, filter %p, flags %#x
\n
"
,
details
->
cb
,
details
->
handle
,
filter
,
flags
);
if
(
filter
)
FIXME
(
"Notification filters are not yet implemented.
\n
"
);
if
(
!
(
registration
=
heap_alloc
(
sizeof
(
struct
device_notify_registration
))))
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
...
...
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