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
db43005c
Commit
db43005c
authored
May 15, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move NtUserGetRawInputData from user32.
parent
12e3c494
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
114 additions
and
62 deletions
+114
-62
rawinput.c
dlls/user32/rawinput.c
+1
-53
user32.spec
dlls/user32/user32.spec
+1
-1
user_main.c
dlls/user32/user_main.c
+1
-0
user_private.h
dlls/user32/user_private.h
+1
-7
Makefile.in
dlls/win32u/Makefile.in
+1
-0
gdiobj.c
dlls/win32u/gdiobj.c
+1
-0
ntuser_private.h
dlls/win32u/ntuser_private.h
+7
-0
rawinput.c
dlls/win32u/rawinput.c
+91
-0
win32u.spec
dlls/win32u/win32u.spec
+1
-1
win32u_private.h
dlls/win32u/win32u_private.h
+2
-0
wrappers.c
dlls/win32u/wrappers.c
+6
-0
ntuser.h
include/ntuser.h
+1
-0
No files found.
dlls/user32/rawinput.c
View file @
db43005c
...
...
@@ -351,7 +351,7 @@ BOOL rawinput_device_get_usages(HANDLE handle, USAGE *usage_page, USAGE *usage)
}
struct
rawinput_thread_data
*
rawinput_thread_data
(
void
)
struct
rawinput_thread_data
*
WINAPI
rawinput_thread_data
(
void
)
{
struct
user_thread_info
*
thread_info
=
get_user_thread_info
();
struct
rawinput_thread_data
*
data
=
thread_info
->
rawinput
;
...
...
@@ -593,58 +593,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH RegisterRawInputDevices(const RAWINPUTDEVICE *devi
return
ret
;
}
/***********************************************************************
* GetRawInputData (USER32.@)
*/
UINT
WINAPI
GetRawInputData
(
HRAWINPUT
rawinput
,
UINT
command
,
void
*
data
,
UINT
*
data_size
,
UINT
header_size
)
{
struct
rawinput_thread_data
*
thread_data
=
rawinput_thread_data
();
UINT
size
;
TRACE
(
"rawinput %p, command %#x, data %p, data_size %p, header_size %u.
\n
"
,
rawinput
,
command
,
data
,
data_size
,
header_size
);
if
(
!
rawinput
||
thread_data
->
hw_id
!=
(
UINT_PTR
)
rawinput
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
~
0U
;
}
if
(
header_size
!=
sizeof
(
RAWINPUTHEADER
))
{
WARN
(
"Invalid structure size %u.
\n
"
,
header_size
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
~
0U
;
}
switch
(
command
)
{
case
RID_INPUT
:
size
=
thread_data
->
buffer
->
header
.
dwSize
;
break
;
case
RID_HEADER
:
size
=
sizeof
(
RAWINPUTHEADER
);
break
;
default:
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
~
0U
;
}
if
(
!
data
)
{
*
data_size
=
size
;
return
0
;
}
if
(
*
data_size
<
size
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
~
0U
;
}
memcpy
(
data
,
thread_data
->
buffer
,
size
);
return
size
;
}
#ifdef _WIN64
typedef
RAWINPUTHEADER
RAWINPUTHEADER64
;
typedef
RAWINPUT
RAWINPUT64
;
...
...
dlls/user32/user32.spec
View file @
db43005c
...
...
@@ -367,7 +367,7 @@
@ stdcall GetPropW(long wstr)
@ stdcall GetQueueStatus(long) NtUserGetQueueStatus
@ stdcall GetRawInputBuffer(ptr ptr long)
@ stdcall GetRawInputData(ptr long ptr ptr long)
@ stdcall GetRawInputData(ptr long ptr ptr long)
NtUserGetRawInputData
@ stdcall GetRawInputDeviceInfoA(ptr long ptr ptr)
@ stdcall GetRawInputDeviceInfoW(ptr long ptr ptr)
@ stdcall GetRawInputDeviceList(ptr ptr long)
...
...
dlls/user32/user_main.c
View file @
db43005c
...
...
@@ -169,6 +169,7 @@ static const struct user_callbacks user_funcs =
register_imm
,
unregister_imm
,
try_finally
,
rawinput_thread_data
,
};
static
NTSTATUS
WINAPI
User32CopyImage
(
const
struct
copy_image_params
*
params
,
ULONG
size
)
...
...
dlls/user32/user_private.h
View file @
db43005c
...
...
@@ -51,12 +51,6 @@ struct wm_char_mapping_data
/* hold up to 10s of 1kHz mouse rawinput events */
#define RAWINPUT_BUFFER_SIZE (512*1024)
struct
rawinput_thread_data
{
UINT
hw_id
;
/* current rawinput message id */
RAWINPUT
buffer
[
1
];
/* rawinput message data buffer */
};
extern
BOOL
(
WINAPI
*
imm_register_window
)(
HWND
)
DECLSPEC_HIDDEN
;
extern
void
(
WINAPI
*
imm_unregister_window
)(
HWND
)
DECLSPEC_HIDDEN
;
...
...
@@ -73,7 +67,7 @@ struct tagWND;
struct
hardware_msg_data
;
extern
BOOL
rawinput_from_hardware_message
(
RAWINPUT
*
rawinput
,
const
struct
hardware_msg_data
*
msg_data
);
extern
BOOL
rawinput_device_get_usages
(
HANDLE
handle
,
USAGE
*
usage_page
,
USAGE
*
usage
);
extern
struct
rawinput_thread_data
*
rawinput_thread_data
(
void
);
extern
struct
rawinput_thread_data
*
WINAPI
rawinput_thread_data
(
void
);
extern
void
rawinput_update_device_list
(
void
);
extern
BOOL
post_dde_message
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
,
DWORD
dest_tid
,
...
...
dlls/win32u/Makefile.in
View file @
db43005c
...
...
@@ -43,6 +43,7 @@ C_SRCS = \
path.c
\
pen.c
\
printdrv.c
\
rawinput.c
\
region.c
\
spy.c
\
syscall.c
\
...
...
dlls/win32u/gdiobj.c
View file @
db43005c
...
...
@@ -1184,6 +1184,7 @@ static struct unix_funcs unix_funcs =
NtUserGetMessage
,
NtUserGetPriorityClipboardFormat
,
NtUserGetQueueStatus
,
NtUserGetRawInputData
,
NtUserGetSystemMenu
,
NtUserGetUpdateRect
,
NtUserGetUpdateRgn
,
...
...
dlls/win32u/ntuser_private.h
View file @
db43005c
...
...
@@ -50,6 +50,7 @@ struct user_callbacks
void
(
WINAPI
*
unregister_imm
)(
HWND
hwnd
);
NTSTATUS
(
CDECL
*
try_finally
)(
NTSTATUS
(
CDECL
*
func
)(
void
*
),
void
*
arg
,
void
(
CALLBACK
*
finally_func
)(
BOOL
));
struct
rawinput_thread_data
*
(
WINAPI
*
get_rawinput_thread_data
)(
void
);
};
#define WM_SYSTIMER 0x0118
...
...
@@ -61,6 +62,12 @@ enum system_timer_id
SYSTEM_TIMER_CARET
=
0xffff
,
};
struct
rawinput_thread_data
{
UINT
hw_id
;
/* current rawinput message id */
RAWINPUT
buffer
[
1
];
/* rawinput message data buffer */
};
struct
user_object
{
HANDLE
handle
;
...
...
dlls/win32u/rawinput.c
0 → 100644
View file @
db43005c
/*
* Raw Input
*
* Copyright 2012 Henri Verbeet
* Copyright 2018 Zebediah Figura for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "win32u_private.h"
#include "ntuser_private.h"
#include "wine/server.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
rawinput
);
/**********************************************************************
* NtUserGetRawInputData (win32u.@)
*/
UINT
WINAPI
NtUserGetRawInputData
(
HRAWINPUT
rawinput
,
UINT
command
,
void
*
data
,
UINT
*
data_size
,
UINT
header_size
)
{
struct
rawinput_thread_data
*
thread_data
;
UINT
size
;
TRACE
(
"rawinput %p, command %#x, data %p, data_size %p, header_size %u.
\n
"
,
rawinput
,
command
,
data
,
data_size
,
header_size
);
if
(
!
user_callbacks
||
!
(
thread_data
=
user_callbacks
->
get_rawinput_thread_data
()))
{
SetLastError
(
ERROR_OUTOFMEMORY
);
return
~
0u
;
}
if
(
!
rawinput
||
thread_data
->
hw_id
!=
(
UINT_PTR
)
rawinput
)
{
SetLastError
(
ERROR_INVALID_HANDLE
);
return
~
0u
;
}
if
(
header_size
!=
sizeof
(
RAWINPUTHEADER
))
{
WARN
(
"Invalid structure size %u.
\n
"
,
header_size
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
~
0u
;
}
switch
(
command
)
{
case
RID_INPUT
:
size
=
thread_data
->
buffer
->
header
.
dwSize
;
break
;
case
RID_HEADER
:
size
=
sizeof
(
RAWINPUTHEADER
);
break
;
default:
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
~
0u
;
}
if
(
!
data
)
{
*
data_size
=
size
;
return
0
;
}
if
(
*
data_size
<
size
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
return
~
0u
;
}
memcpy
(
data
,
thread_data
->
buffer
,
size
);
return
size
;
}
dlls/win32u/win32u.spec
View file @
db43005c
...
...
@@ -984,7 +984,7 @@
@ stdcall NtUserGetQueueStatus(long)
@ stub NtUserGetQueueStatusReadonly
@ stub NtUserGetRawInputBuffer
@ st
ub NtUserGetRawInputData
@ st
dcall NtUserGetRawInputData(ptr long ptr ptr long)
@ stub NtUserGetRawInputDeviceInfo
@ stub NtUserGetRawInputDeviceList
@ stub NtUserGetRawPointerDeviceData
...
...
dlls/win32u/win32u_private.h
View file @
db43005c
...
...
@@ -247,6 +247,8 @@ struct unix_funcs
BOOL
(
WINAPI
*
pNtUserGetMessage
)(
MSG
*
msg
,
HWND
hwnd
,
UINT
first
,
UINT
last
);
INT
(
WINAPI
*
pNtUserGetPriorityClipboardFormat
)(
UINT
*
list
,
INT
count
);
DWORD
(
WINAPI
*
pNtUserGetQueueStatus
)(
UINT
flags
);
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 @
db43005c
...
...
@@ -1048,6 +1048,12 @@ DWORD WINAPI NtUserGetQueueStatus( UINT flags )
return
unix_funcs
->
pNtUserGetQueueStatus
(
flags
);
}
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
;
...
...
include/ntuser.h
View file @
db43005c
...
...
@@ -606,6 +606,7 @@ HWINSTA WINAPI NtUserGetProcessWindowStation(void);
HANDLE
WINAPI
NtUserGetProp
(
HWND
hwnd
,
const
WCHAR
*
str
);
ULONG
WINAPI
NtUserGetProcessDpiAwarenessContext
(
HANDLE
process
);
DWORD
WINAPI
NtUserGetQueueStatus
(
UINT
flags
);
UINT
WINAPI
NtUserGetRawInputData
(
HRAWINPUT
rawinput
,
UINT
command
,
void
*
data
,
UINT
*
data_size
,
UINT
header_size
);
ULONG
WINAPI
NtUserGetSystemDpiForProcess
(
HANDLE
process
);
HMENU
WINAPI
NtUserGetSystemMenu
(
HWND
hwnd
,
BOOL
revert
);
HDESK
WINAPI
NtUserGetThreadDesktop
(
DWORD
thread
);
...
...
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