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
d05b88dd
Commit
d05b88dd
authored
Feb 07, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Map DEV_BROADCAST_DEVICEINTERFACE to ANSI for registered device notifications.
parent
98336958
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
4 deletions
+46
-4
ntoskrnl.c
dlls/ntoskrnl.exe/tests/ntoskrnl.c
+2
-2
input.c
dlls/user32/input.c
+44
-2
No files found.
dlls/ntoskrnl.exe/tests/ntoskrnl.c
View file @
d05b88dd
...
@@ -1400,7 +1400,7 @@ static LRESULT WINAPI device_notify_proc(HWND window, UINT message, WPARAM wpara
...
@@ -1400,7 +1400,7 @@ static LRESULT WINAPI device_notify_proc(HWND window, UINT message, WPARAM wpara
if
(
IsEqualGUID
(
&
iface
->
dbcc_classguid
,
&
bus_class
))
if
(
IsEqualGUID
(
&
iface
->
dbcc_classguid
,
&
bus_class
))
{
{
++
got_bus_arrival
;
++
got_bus_arrival
;
todo_wine
ok
(
!
strcmp
(
iface
->
dbcc_name
,
"
\\\\
?
\\
ROOT#WINETEST#0#{deadbeef-29ef-4538-a5fd-b69573a362c1}"
),
ok
(
!
strcmp
(
iface
->
dbcc_name
,
"
\\\\
?
\\
ROOT#WINETEST#0#{deadbeef-29ef-4538-a5fd-b69573a362c1}"
),
"got name %s
\n
"
,
debugstr_a
(
iface
->
dbcc_name
));
"got name %s
\n
"
,
debugstr_a
(
iface
->
dbcc_name
));
}
}
else
if
(
IsEqualGUID
(
&
iface
->
dbcc_classguid
,
&
child_class
))
else
if
(
IsEqualGUID
(
&
iface
->
dbcc_classguid
,
&
child_class
))
...
@@ -1428,7 +1428,7 @@ static LRESULT WINAPI device_notify_proc(HWND window, UINT message, WPARAM wpara
...
@@ -1428,7 +1428,7 @@ static LRESULT WINAPI device_notify_proc(HWND window, UINT message, WPARAM wpara
if
(
IsEqualGUID
(
&
iface
->
dbcc_classguid
,
&
bus_class
))
if
(
IsEqualGUID
(
&
iface
->
dbcc_classguid
,
&
bus_class
))
{
{
++
got_bus_removal
;
++
got_bus_removal
;
todo_wine
ok
(
!
strcmp
(
iface
->
dbcc_name
,
"
\\\\
?
\\
ROOT#WINETEST#0#{deadbeef-29ef-4538-a5fd-b69573a362c1}"
),
ok
(
!
strcmp
(
iface
->
dbcc_name
,
"
\\\\
?
\\
ROOT#WINETEST#0#{deadbeef-29ef-4538-a5fd-b69573a362c1}"
),
"got name %s
\n
"
,
debugstr_a
(
iface
->
dbcc_name
));
"got name %s
\n
"
,
debugstr_a
(
iface
->
dbcc_name
));
}
}
else
if
(
IsEqualGUID
(
&
iface
->
dbcc_classguid
,
&
child_class
))
else
if
(
IsEqualGUID
(
&
iface
->
dbcc_classguid
,
&
child_class
))
...
...
dlls/user32/input.c
View file @
d05b88dd
...
@@ -495,12 +495,52 @@ BOOL WINAPI UnloadKeyboardLayout( HKL layout )
...
@@ -495,12 +495,52 @@ BOOL WINAPI UnloadKeyboardLayout( HKL layout )
}
}
static
DWORD
CALLBACK
devnotify_window_callback
(
HANDLE
handle
,
DWORD
flags
,
DEV_BROADCAST_HDR
*
header
)
static
DWORD
CALLBACK
devnotify_window_callback
W
(
HANDLE
handle
,
DWORD
flags
,
DEV_BROADCAST_HDR
*
header
)
{
{
SendMessageTimeoutW
(
handle
,
WM_DEVICECHANGE
,
flags
,
(
LPARAM
)
header
,
SMTO_ABORTIFHUNG
,
2000
,
NULL
);
SendMessageTimeoutW
(
handle
,
WM_DEVICECHANGE
,
flags
,
(
LPARAM
)
header
,
SMTO_ABORTIFHUNG
,
2000
,
NULL
);
return
0
;
return
0
;
}
}
static
DWORD
CALLBACK
devnotify_window_callbackA
(
HANDLE
handle
,
DWORD
flags
,
DEV_BROADCAST_HDR
*
header
)
{
if
(
flags
&
0x8000
)
{
switch
(
header
->
dbch_devicetype
)
{
case
DBT_DEVTYP_DEVICEINTERFACE
:
{
const
DEV_BROADCAST_DEVICEINTERFACE_W
*
ifaceW
=
(
const
DEV_BROADCAST_DEVICEINTERFACE_W
*
)
header
;
size_t
lenW
=
wcslen
(
ifaceW
->
dbcc_name
);
DEV_BROADCAST_DEVICEINTERFACE_A
*
ifaceA
;
DWORD
lenA
;
if
(
!
(
ifaceA
=
malloc
(
offsetof
(
DEV_BROADCAST_DEVICEINTERFACE_A
,
dbcc_name
[
lenW
*
3
+
1
])
)))
return
0
;
lenA
=
WideCharToMultiByte
(
CP_ACP
,
0
,
ifaceW
->
dbcc_name
,
lenW
+
1
,
ifaceA
->
dbcc_name
,
lenW
*
3
+
1
,
NULL
,
NULL
);
ifaceA
->
dbcc_size
=
offsetof
(
DEV_BROADCAST_DEVICEINTERFACE_A
,
dbcc_name
[
lenA
+
1
]);
ifaceA
->
dbcc_devicetype
=
ifaceW
->
dbcc_devicetype
;
ifaceA
->
dbcc_reserved
=
ifaceW
->
dbcc_reserved
;
ifaceA
->
dbcc_classguid
=
ifaceW
->
dbcc_classguid
;
SendMessageTimeoutA
(
handle
,
WM_DEVICECHANGE
,
flags
,
(
LPARAM
)
ifaceA
,
SMTO_ABORTIFHUNG
,
2000
,
NULL
);
free
(
ifaceA
);
return
0
;
}
default:
FIXME
(
"unimplemented W to A mapping for %#lx
\n
"
,
header
->
dbch_devicetype
);
/* fall through */
case
DBT_DEVTYP_HANDLE
:
case
DBT_DEVTYP_OEM
:
break
;
}
}
SendMessageTimeoutA
(
handle
,
WM_DEVICECHANGE
,
flags
,
(
LPARAM
)
header
,
SMTO_ABORTIFHUNG
,
2000
,
NULL
);
return
0
;
}
static
DWORD
CALLBACK
devnotify_service_callback
(
HANDLE
handle
,
DWORD
flags
,
DEV_BROADCAST_HDR
*
header
)
static
DWORD
CALLBACK
devnotify_service_callback
(
HANDLE
handle
,
DWORD
flags
,
DEV_BROADCAST_HDR
*
header
)
{
{
FIXME
(
"Support for service handles is not yet implemented!
\n
"
);
FIXME
(
"Support for service handles is not yet implemented!
\n
"
);
...
@@ -580,8 +620,10 @@ HDEVNOTIFY WINAPI RegisterDeviceNotificationW( HANDLE handle, void *filter, DWOR
...
@@ -580,8 +620,10 @@ HDEVNOTIFY WINAPI RegisterDeviceNotificationW( HANDLE handle, void *filter, DWOR
if
(
flags
&
DEVICE_NOTIFY_SERVICE_HANDLE
)
if
(
flags
&
DEVICE_NOTIFY_SERVICE_HANDLE
)
details
.
cb
=
devnotify_service_callback
;
details
.
cb
=
devnotify_service_callback
;
else
if
(
IsWindowUnicode
(
handle
))
details
.
cb
=
devnotify_window_callbackW
;
else
else
details
.
cb
=
devnotify_window_callback
;
details
.
cb
=
devnotify_window_callback
A
;
return
I_ScRegisterDeviceNotification
(
&
details
,
filter
,
0
);
return
I_ScRegisterDeviceNotification
(
&
details
,
filter
,
0
);
}
}
...
...
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