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
0ce4ed67
Commit
0ce4ed67
authored
May 15, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move NtUserRegisterRawInputDevices from user32.
parent
e06a6204
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
106 additions
and
65 deletions
+106
-65
rawinput.c
dlls/user32/rawinput.c
+0
-63
user32.spec
dlls/user32/user32.spec
+1
-1
rawinput.c
dlls/win32u/rawinput.c
+61
-0
syscall.c
dlls/win32u/syscall.c
+1
-0
win32u.spec
dlls/win32u/win32u.spec
+1
-1
syscall.h
dlls/wow64win/syscall.h
+1
-0
user.c
dlls/wow64win/user.c
+40
-0
ntuser.h
include/ntuser.h
+1
-0
No files found.
dlls/user32/rawinput.c
View file @
0ce4ed67
...
...
@@ -402,69 +402,6 @@ UINT WINAPI GetRawInputDeviceList(RAWINPUTDEVICELIST *devices, UINT *device_coun
}
/***********************************************************************
* RegisterRawInputDevices (USER32.@)
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
RegisterRawInputDevices
(
const
RAWINPUTDEVICE
*
devices
,
UINT
device_count
,
UINT
size
)
{
struct
rawinput_device
*
d
;
BOOL
ret
;
UINT
i
;
TRACE
(
"devices %p, device_count %u, size %u.
\n
"
,
devices
,
device_count
,
size
);
if
(
size
!=
sizeof
(
*
devices
))
{
WARN
(
"Invalid structure size %u.
\n
"
,
size
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
for
(
i
=
0
;
i
<
device_count
;
++
i
)
{
if
((
devices
[
i
].
dwFlags
&
RIDEV_INPUTSINK
)
&&
(
devices
[
i
].
hwndTarget
==
NULL
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
((
devices
[
i
].
dwFlags
&
RIDEV_REMOVE
)
&&
(
devices
[
i
].
hwndTarget
!=
NULL
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
}
if
(
!
(
d
=
HeapAlloc
(
GetProcessHeap
(),
0
,
device_count
*
sizeof
(
*
d
)
)))
return
FALSE
;
for
(
i
=
0
;
i
<
device_count
;
++
i
)
{
TRACE
(
"device %u: page %#x, usage %#x, flags %#lx, target %p.
\n
"
,
i
,
devices
[
i
].
usUsagePage
,
devices
[
i
].
usUsage
,
devices
[
i
].
dwFlags
,
devices
[
i
].
hwndTarget
);
if
(
devices
[
i
].
dwFlags
&
~
(
RIDEV_REMOVE
|
RIDEV_NOLEGACY
|
RIDEV_INPUTSINK
|
RIDEV_DEVNOTIFY
))
FIXME
(
"Unhandled flags %#lx for device %u.
\n
"
,
devices
[
i
].
dwFlags
,
i
);
d
[
i
].
usage_page
=
devices
[
i
].
usUsagePage
;
d
[
i
].
usage
=
devices
[
i
].
usUsage
;
d
[
i
].
flags
=
devices
[
i
].
dwFlags
;
d
[
i
].
target
=
wine_server_user_handle
(
devices
[
i
].
hwndTarget
);
}
SERVER_START_REQ
(
update_rawinput_devices
)
{
wine_server_add_data
(
req
,
d
,
device_count
*
sizeof
(
*
d
)
);
ret
=
!
wine_server_call
(
req
);
}
SERVER_END_REQ
;
HeapFree
(
GetProcessHeap
(),
0
,
d
);
return
ret
;
}
/***********************************************************************
* GetRawInputDeviceInfoA (USER32.@)
*/
UINT
WINAPI
GetRawInputDeviceInfoA
(
HANDLE
device
,
UINT
command
,
void
*
data
,
UINT
*
data_size
)
...
...
dlls/user32/user32.spec
View file @
0ce4ed67
...
...
@@ -605,7 +605,7 @@
@ stub RegisterNetworkCapabilities
@ stdcall RegisterPointerDeviceNotifications(long long)
@ stdcall RegisterPowerSettingNotification(long ptr long)
@ stdcall RegisterRawInputDevices(ptr long long)
@ stdcall RegisterRawInputDevices(ptr long long)
NtUserRegisterRawInputDevices
@ stdcall RegisterServicesProcess(long)
@ stdcall RegisterShellHookWindow (long)
@ stdcall RegisterSuspendResumeNotification(long long)
...
...
dlls/win32u/rawinput.c
View file @
0ce4ed67
...
...
@@ -366,3 +366,64 @@ BOOL process_rawinput_message( MSG *msg, UINT hw_id, const struct hardware_msg_d
msg
->
pt
=
point_phys_to_win_dpi
(
msg
->
hwnd
,
msg
->
pt
);
return
TRUE
;
}
/**********************************************************************
* NtUserRegisterRawInputDevices (win32u.@)
*/
BOOL
WINAPI
NtUserRegisterRawInputDevices
(
const
RAWINPUTDEVICE
*
devices
,
UINT
device_count
,
UINT
size
)
{
struct
rawinput_device
*
server_devices
;
BOOL
ret
;
UINT
i
;
TRACE
(
"devices %p, device_count %u, size %u.
\n
"
,
devices
,
device_count
,
size
);
if
(
size
!=
sizeof
(
*
devices
))
{
WARN
(
"Invalid structure size %u.
\n
"
,
size
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
for
(
i
=
0
;
i
<
device_count
;
++
i
)
{
if
((
devices
[
i
].
dwFlags
&
RIDEV_INPUTSINK
)
&&
!
devices
[
i
].
hwndTarget
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
((
devices
[
i
].
dwFlags
&
RIDEV_REMOVE
)
&&
devices
[
i
].
hwndTarget
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
}
if
(
!
(
server_devices
=
malloc
(
device_count
*
sizeof
(
*
server_devices
)
)))
return
FALSE
;
for
(
i
=
0
;
i
<
device_count
;
++
i
)
{
TRACE
(
"device %u: page %#x, usage %#x, flags %#x, target %p.
\n
"
,
i
,
devices
[
i
].
usUsagePage
,
devices
[
i
].
usUsage
,
devices
[
i
].
dwFlags
,
devices
[
i
].
hwndTarget
);
if
(
devices
[
i
].
dwFlags
&
~
(
RIDEV_REMOVE
|
RIDEV_NOLEGACY
|
RIDEV_INPUTSINK
|
RIDEV_DEVNOTIFY
))
FIXME
(
"Unhandled flags %#x for device %u.
\n
"
,
devices
[
i
].
dwFlags
,
i
);
server_devices
[
i
].
usage_page
=
devices
[
i
].
usUsagePage
;
server_devices
[
i
].
usage
=
devices
[
i
].
usUsage
;
server_devices
[
i
].
flags
=
devices
[
i
].
dwFlags
;
server_devices
[
i
].
target
=
wine_server_user_handle
(
devices
[
i
].
hwndTarget
);
}
SERVER_START_REQ
(
update_rawinput_devices
)
{
wine_server_add_data
(
req
,
server_devices
,
device_count
*
sizeof
(
*
server_devices
)
);
ret
=
!
wine_server_call
(
req
);
}
SERVER_END_REQ
;
free
(
server_devices
);
return
ret
;
}
dlls/win32u/syscall.c
View file @
0ce4ed67
...
...
@@ -160,6 +160,7 @@ static void * const syscalls[] =
NtUserOpenDesktop
,
NtUserOpenInputDesktop
,
NtUserOpenWindowStation
,
NtUserRegisterRawInputDevices
,
NtUserRemoveClipboardFormatListener
,
NtUserRemoveMenu
,
NtUserRemoveProp
,
...
...
dlls/win32u/win32u.spec
View file @
0ce4ed67
...
...
@@ -1130,7 +1130,7 @@
@ stub NtUserRegisterManipulationThread
@ stub NtUserRegisterPointerDeviceNotifications
@ stub NtUserRegisterPointerInputTarget
@ st
ub NtUserRegisterRawInputDevices
@ st
dcall -syscall NtUserRegisterRawInputDevices(ptr long long)
@ stub NtUserRegisterServicesProcess
@ stub NtUserRegisterSessionPort
@ stub NtUserRegisterShellPTPListener
...
...
dlls/wow64win/syscall.h
View file @
0ce4ed67
...
...
@@ -147,6 +147,7 @@
SYSCALL_ENTRY( NtUserOpenDesktop ) \
SYSCALL_ENTRY( NtUserOpenInputDesktop ) \
SYSCALL_ENTRY( NtUserOpenWindowStation ) \
SYSCALL_ENTRY( NtUserRegisterRawInputDevices ) \
SYSCALL_ENTRY( NtUserRemoveClipboardFormatListener ) \
SYSCALL_ENTRY( NtUserRemoveMenu ) \
SYSCALL_ENTRY( NtUserRemoveProp ) \
...
...
dlls/wow64win/user.c
View file @
0ce4ed67
...
...
@@ -64,6 +64,14 @@ typedef struct
UINT32
wParam
;
}
RAWINPUTHEADER32
;
typedef
struct
{
USHORT
usUsagePage
;
USHORT
usUsage
;
DWORD
dwFlags
;
UINT32
hwndTarget
;
}
RAWINPUTDEVICE32
;
static
MSG
*
msg_32to64
(
MSG
*
msg
,
MSG32
*
msg32
)
{
if
(
!
msg32
)
return
NULL
;
...
...
@@ -975,3 +983,35 @@ NTSTATUS WINAPI wow64_NtUserGetRawInputBuffer( UINT *args )
* whether it's operating under WoW64 or not. */
return
NtUserGetRawInputBuffer
(
data
,
data_size
,
sizeof
(
RAWINPUTHEADER
)
);
}
NTSTATUS
WINAPI
wow64_NtUserRegisterRawInputDevices
(
UINT
*
args
)
{
const
RAWINPUTDEVICE32
*
devices32
=
get_ptr
(
&
args
);
UINT
count
=
get_ulong
(
&
args
);
UINT
size
=
get_ulong
(
&
args
);
RAWINPUTDEVICE
*
devices64
;
unsigned
int
i
;
if
(
size
!=
sizeof
(
RAWINPUTDEVICE32
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
!
(
devices64
=
Wow64AllocateTemp
(
count
*
sizeof
(
*
devices64
)
)))
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
return
FALSE
;
}
for
(
i
=
0
;
i
<
count
;
++
i
)
{
devices64
[
i
].
usUsagePage
=
devices32
[
i
].
usUsagePage
;
devices64
[
i
].
usUsage
=
devices32
[
i
].
usUsage
;
devices64
[
i
].
dwFlags
=
devices32
[
i
].
dwFlags
;
devices64
[
i
].
hwndTarget
=
UlongToPtr
(
devices32
[
i
].
hwndTarget
);
}
return
NtUserRegisterRawInputDevices
(
devices64
,
count
,
sizeof
(
*
devices64
)
);
}
include/ntuser.h
View file @
0ce4ed67
...
...
@@ -663,6 +663,7 @@ ATOM WINAPI NtUserRegisterClassExWOW( const WNDCLASSEXW *wc, UNICODE_STRING *
struct
client_menu_name
*
client_menu_name
,
DWORD
fnid
,
DWORD
flags
,
DWORD
*
wow
);
BOOL
WINAPI
NtUserRegisterHotKey
(
HWND
hwnd
,
INT
id
,
UINT
modifiers
,
UINT
vk
);
BOOL
WINAPI
NtUserRegisterRawInputDevices
(
const
RAWINPUTDEVICE
*
devices
,
UINT
device_count
,
UINT
size
);
INT
WINAPI
NtUserReleaseDC
(
HWND
hwnd
,
HDC
hdc
);
BOOL
WINAPI
NtUserRemoveClipboardFormatListener
(
HWND
hwnd
);
BOOL
WINAPI
NtUserRemoveMenu
(
HMENU
menu
,
UINT
id
,
UINT
flags
);
...
...
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