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
5b7a862c
Commit
5b7a862c
authored
May 15, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Use syscall interface for NtUserGetRawInputData.
parent
7c418f14
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
102 additions
and
10 deletions
+102
-10
gdiobj.c
dlls/win32u/gdiobj.c
+0
-1
syscall.c
dlls/win32u/syscall.c
+1
-0
win32u.spec
dlls/win32u/win32u.spec
+1
-1
win32u_private.h
dlls/win32u/win32u_private.h
+0
-2
wrappers.c
dlls/win32u/wrappers.c
+0
-6
syscall.h
dlls/wow64win/syscall.h
+1
-0
user.c
dlls/wow64win/user.c
+99
-0
No files found.
dlls/win32u/gdiobj.c
View file @
5b7a862c
...
...
@@ -1185,7 +1185,6 @@ static struct unix_funcs unix_funcs =
NtUserGetPriorityClipboardFormat
,
NtUserGetQueueStatus
,
NtUserGetRawInputBuffer
,
NtUserGetRawInputData
,
NtUserGetSystemMenu
,
NtUserGetUpdateRect
,
NtUserGetUpdateRgn
,
...
...
dlls/win32u/syscall.c
View file @
5b7a862c
...
...
@@ -145,6 +145,7 @@ static void * const syscalls[] =
NtUserGetProcessDpiAwarenessContext
,
NtUserGetProcessWindowStation
,
NtUserGetProp
,
NtUserGetRawInputData
,
NtUserGetSystemDpiForProcess
,
NtUserGetThreadDesktop
,
NtUserGetTitleBarInfo
,
...
...
dlls/win32u/win32u.spec
View file @
5b7a862c
...
...
@@ -984,7 +984,7 @@
@ stdcall NtUserGetQueueStatus(long)
@ stub NtUserGetQueueStatusReadonly
@ stdcall NtUserGetRawInputBuffer(ptr ptr long)
@ stdcall NtUserGetRawInputData(ptr long ptr ptr long)
@ stdcall
-syscall
NtUserGetRawInputData(ptr long ptr ptr long)
@ stub NtUserGetRawInputDeviceInfo
@ stub NtUserGetRawInputDeviceList
@ stub NtUserGetRawPointerDeviceData
...
...
dlls/win32u/win32u_private.h
View file @
5b7a862c
...
...
@@ -249,8 +249,6 @@ struct unix_funcs
INT
(
WINAPI
*
pNtUserGetPriorityClipboardFormat
)(
UINT
*
list
,
INT
count
);
DWORD
(
WINAPI
*
pNtUserGetQueueStatus
)(
UINT
flags
);
UINT
(
WINAPI
*
pNtUserGetRawInputBuffer
)(
RAWINPUT
*
data
,
UINT
*
data_size
,
UINT
header_size
);
UINT
(
WINAPI
*
pNtUserGetRawInputData
)(
HRAWINPUT
rawinput
,
UINT
command
,
void
*
data
,
UINT
*
data_size
,
UINT
header_size
);
HMENU
(
WINAPI
*
pNtUserGetSystemMenu
)(
HWND
hwnd
,
BOOL
revert
);
BOOL
(
WINAPI
*
pNtUserGetUpdateRect
)(
HWND
hwnd
,
RECT
*
rect
,
BOOL
erase
);
INT
(
WINAPI
*
pNtUserGetUpdateRgn
)(
HWND
hwnd
,
HRGN
hrgn
,
BOOL
erase
);
...
...
dlls/win32u/wrappers.c
View file @
5b7a862c
...
...
@@ -1054,12 +1054,6 @@ UINT WINAPI DECLSPEC_HOTPATCH NtUserGetRawInputBuffer( RAWINPUT *data, UINT *dat
return
unix_funcs
->
pNtUserGetRawInputBuffer
(
data
,
data_size
,
header_size
);
}
UINT
WINAPI
NtUserGetRawInputData
(
HRAWINPUT
rawinput
,
UINT
command
,
void
*
data
,
UINT
*
data_size
,
UINT
header_size
)
{
if
(
!
unix_funcs
)
return
~
0u
;
return
unix_funcs
->
pNtUserGetRawInputData
(
rawinput
,
command
,
data
,
data_size
,
header_size
);
}
BOOL
WINAPI
NtUserGetUpdatedClipboardFormats
(
UINT
*
formats
,
UINT
size
,
UINT
*
out_size
)
{
if
(
!
unix_funcs
)
return
FALSE
;
...
...
dlls/wow64win/syscall.h
View file @
5b7a862c
...
...
@@ -132,6 +132,7 @@
SYSCALL_ENTRY( NtUserGetProcessDpiAwarenessContext ) \
SYSCALL_ENTRY( NtUserGetProcessWindowStation ) \
SYSCALL_ENTRY( NtUserGetProp ) \
SYSCALL_ENTRY( NtUserGetRawInputData ) \
SYSCALL_ENTRY( NtUserGetSystemDpiForProcess ) \
SYSCALL_ENTRY( NtUserGetThreadDesktop ) \
SYSCALL_ENTRY( NtUserGetTitleBarInfo ) \
...
...
dlls/wow64win/user.c
View file @
5b7a862c
...
...
@@ -56,6 +56,14 @@ typedef struct
POINT
pt
;
}
MSG32
;
typedef
struct
{
DWORD
dwType
;
DWORD
dwSize
;
UINT32
hDevice
;
UINT32
wParam
;
}
RAWINPUTHEADER32
;
static
MSG
*
msg_32to64
(
MSG
*
msg
,
MSG32
*
msg32
)
{
if
(
!
msg32
)
return
NULL
;
...
...
@@ -858,3 +866,94 @@ NTSTATUS WINAPI wow64_NtUserGetTitleBarInfo( UINT *args )
return
NtUserGetTitleBarInfo
(
hwnd
,
info
);
}
NTSTATUS
WINAPI
wow64_NtUserGetRawInputData
(
UINT
*
args
)
{
HRAWINPUT
handle
=
get_handle
(
&
args
);
UINT
command
=
get_ulong
(
&
args
);
void
*
data
=
get_ptr
(
&
args
);
UINT
*
data_size
=
get_ptr
(
&
args
);
UINT
header_size
=
get_ulong
(
&
args
);
if
(
header_size
!=
sizeof
(
RAWINPUTHEADER32
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
~
0u
;
}
switch
(
command
)
{
case
RID_INPUT
:
if
(
data
)
{
UINT
data_size64
,
body_size
,
ret
;
RAWINPUTHEADER32
*
data32
=
data
;
RAWINPUTHEADER
*
data64
=
NULL
;
data_size64
=
*
data_size
+
sizeof
(
RAWINPUTHEADER
);
if
(
!
(
data64
=
Wow64AllocateTemp
(
data_size64
)))
{
SetLastError
(
STATUS_NO_MEMORY
);
return
~
0u
;
}
ret
=
NtUserGetRawInputData
(
handle
,
command
,
data64
,
&
data_size64
,
sizeof
(
RAWINPUTHEADER
)
);
if
(
ret
==
~
0u
)
return
ret
;
body_size
=
ret
-
sizeof
(
RAWINPUTHEADER
);
if
(
*
data_size
<
sizeof
(
RAWINPUTHEADER32
)
+
body_size
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
~
0u
;
}
data32
->
dwType
=
data64
->
dwType
;
data32
->
dwSize
=
sizeof
(
RAWINPUTHEADER32
)
+
body_size
;
data32
->
hDevice
=
(
UINT_PTR
)
data64
->
hDevice
;
data32
->
wParam
=
data64
->
wParam
;
memcpy
(
data32
+
1
,
data64
+
1
,
body_size
);
return
sizeof
(
RAWINPUTHEADER32
)
+
body_size
;
}
else
{
UINT
data_size64
,
ret
;
ret
=
NtUserGetRawInputData
(
handle
,
command
,
NULL
,
&
data_size64
,
sizeof
(
RAWINPUTHEADER
)
);
if
(
ret
==
~
0u
)
return
ret
;
*
data_size
=
data_size64
-
sizeof
(
RAWINPUTHEADER
)
+
sizeof
(
RAWINPUTHEADER32
);
return
0
;
}
case
RID_HEADER
:
{
UINT
data_size64
=
sizeof
(
RAWINPUTHEADER
);
RAWINPUTHEADER32
*
data32
=
data
;
RAWINPUTHEADER
data64
;
UINT
ret
;
if
(
!
data
)
{
*
data_size
=
sizeof
(
RAWINPUTHEADER32
);
return
0
;
}
if
(
*
data_size
<
sizeof
(
RAWINPUTHEADER32
))
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
~
0u
;
}
ret
=
NtUserGetRawInputData
(
handle
,
command
,
&
data64
,
&
data_size64
,
sizeof
(
RAWINPUTHEADER
)
);
if
(
ret
==
~
0u
)
return
ret
;
data32
->
dwType
=
data64
.
dwType
;
data32
->
dwSize
=
data64
.
dwSize
-
sizeof
(
RAWINPUTHEADER
)
+
sizeof
(
RAWINPUTHEADER32
);
data32
->
hDevice
=
(
UINT_PTR
)
data64
.
hDevice
;
data32
->
wParam
=
data64
.
wParam
;
return
sizeof
(
RAWINPUTHEADER32
);
}
default:
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
~
0u
;
}
}
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