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
c62ca2e1
Commit
c62ca2e1
authored
Feb 06, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Feb 08, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Combine HID usage page and usage together.
parent
3c644480
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
23 deletions
+18
-23
message.c
dlls/win32u/message.c
+1
-2
rawinput.c
dlls/win32u/rawinput.c
+1
-2
server_protocol.h
include/wine/server_protocol.h
+3
-5
protocol.def
server/protocol.def
+2
-4
queue.c
server/queue.c
+6
-5
trace.c
server/trace.c
+5
-5
No files found.
dlls/win32u/message.c
View file @
c62ca2e1
...
...
@@ -3555,8 +3555,7 @@ NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, const RAWINPUT *r
case
RIM_TYPEHID
:
req
->
input
.
hw
.
rawinput
.
hid
.
device
=
HandleToUlong
(
rawinput
->
header
.
hDevice
);
req
->
input
.
hw
.
rawinput
.
hid
.
param
=
rawinput
->
header
.
wParam
;
req
->
input
.
hw
.
rawinput
.
hid
.
usage_page
=
hid_usage_page
;
req
->
input
.
hw
.
rawinput
.
hid
.
usage
=
hid_usage
;
req
->
input
.
hw
.
rawinput
.
hid
.
usage
=
MAKELONG
(
hid_usage
,
hid_usage_page
);
req
->
input
.
hw
.
rawinput
.
hid
.
count
=
rawinput
->
data
.
hid
.
dwCount
;
req
->
input
.
hw
.
rawinput
.
hid
.
length
=
rawinput
->
data
.
hid
.
dwSizeHid
;
wine_server_add_data
(
req
,
rawinput
->
data
.
hid
.
bRawData
,
...
...
dlls/win32u/rawinput.c
View file @
c62ca2e1
...
...
@@ -899,8 +899,7 @@ BOOL WINAPI NtUserRegisterRawInputDevices( const RAWINPUTDEVICE *devices, UINT d
for
(
i
=
0
;
i
<
device_count
;
++
i
)
{
server_devices
[
i
].
usage_page
=
registered_devices
[
i
].
usUsagePage
;
server_devices
[
i
].
usage
=
registered_devices
[
i
].
usUsage
;
server_devices
[
i
].
usage
=
MAKELONG
(
registered_devices
[
i
].
usUsage
,
registered_devices
[
i
].
usUsagePage
);
server_devices
[
i
].
flags
=
registered_devices
[
i
].
dwFlags
;
server_devices
[
i
].
target
=
wine_server_user_handle
(
registered_devices
[
i
].
hwndTarget
);
}
...
...
include/wine/server_protocol.h
View file @
c62ca2e1
...
...
@@ -285,8 +285,7 @@ union rawinput
int
type
;
unsigned
int
device
;
unsigned
int
param
;
unsigned
short
usage_page
;
unsigned
short
usage
;
unsigned
int
usage
;
unsigned
int
count
;
unsigned
int
length
;
}
hid
;
...
...
@@ -863,8 +862,7 @@ typedef struct
struct
rawinput_device
{
unsigned
short
usage_page
;
unsigned
short
usage
;
unsigned
int
usage
;
unsigned
int
flags
;
user_handle_t
target
;
};
...
...
@@ -6507,7 +6505,7 @@ union generic_reply
/* ### protocol_version begin ### */
#define SERVER_PROTOCOL_VERSION 78
8
#define SERVER_PROTOCOL_VERSION 78
9
/* ### protocol_version end ### */
...
...
server/protocol.def
View file @
c62ca2e1
...
...
@@ -301,8 +301,7 @@ union rawinput
int type; /* RIM_TYPEHID */
unsigned int device; /* rawinput device index */
unsigned int param; /* rawinput message param */
unsigned short usage_page;/* HID usage page */
unsigned short usage; /* HID usage */
unsigned int usage; /* HID device usage */
unsigned int count; /* HID report count */
unsigned int length; /* HID report length */
} hid;
...
...
@@ -879,8 +878,7 @@ typedef struct
struct rawinput_device
{
unsigned short usage_page;
unsigned short usage;
unsigned int usage;
unsigned int flags;
user_handle_t target;
};
...
...
server/queue.c
View file @
c62ca2e1
...
...
@@ -35,6 +35,7 @@
#include "winuser.h"
#include "winternl.h"
#include "ntuser.h"
#include "hidusage.h"
#include "handle.h"
#include "file.h"
...
...
@@ -1637,13 +1638,13 @@ static user_handle_t find_hardware_message_window( struct desktop *desktop, stru
return
win
;
}
static
struct
rawinput_device
*
find_rawinput_device
(
struct
process
*
process
,
unsigned
short
usage_page
,
unsigned
shor
t
usage
)
static
struct
rawinput_device
*
find_rawinput_device
(
struct
process
*
process
,
unsigned
in
t
usage
)
{
struct
rawinput_device
*
device
,
*
end
;
for
(
device
=
process
->
rawinput_devices
,
end
=
device
+
process
->
rawinput_device_count
;
device
!=
end
;
device
++
)
{
if
(
device
->
usage
_page
!=
usage_page
||
device
->
usage
!=
usage
)
continue
;
if
(
device
->
usage
!=
usage
)
continue
;
return
device
;
}
...
...
@@ -1808,7 +1809,7 @@ static int queue_rawinput_message( struct process* process, void *arg )
else
if
(
raw_msg
->
data
.
rawinput
.
type
==
RIM_TYPEKEYBOARD
)
device
=
process
->
rawinput_kbd
;
else
device
=
find_rawinput_device
(
process
,
raw_msg
->
data
.
rawinput
.
hid
.
usage
_page
,
raw_msg
->
data
.
rawinput
.
hid
.
usage
);
device
=
find_rawinput_device
(
process
,
raw_msg
->
data
.
rawinput
.
hid
.
usage
);
if
(
!
device
)
return
0
;
if
(
raw_msg
->
message
==
WM_INPUT_DEVICE_CHANGE
&&
!
(
device
->
flags
&
RIDEV_DEVNOTIFY
))
return
0
;
...
...
@@ -3505,6 +3506,6 @@ DECL_HANDLER(update_rawinput_devices)
process
->
rawinput_device_count
=
device_count
;
memcpy
(
process
->
rawinput_devices
,
devices
,
size
);
process
->
rawinput_mouse
=
find_rawinput_device
(
process
,
1
,
2
);
process
->
rawinput_kbd
=
find_rawinput_device
(
process
,
1
,
6
);
process
->
rawinput_mouse
=
find_rawinput_device
(
process
,
MAKELONG
(
HID_USAGE_GENERIC_MOUSE
,
HID_USAGE_PAGE_GENERIC
)
);
process
->
rawinput_kbd
=
find_rawinput_device
(
process
,
MAKELONG
(
HID_USAGE_GENERIC_KEYBOARD
,
HID_USAGE_PAGE_GENERIC
)
);
}
server/trace.c
View file @
c62ca2e1
...
...
@@ -434,9 +434,9 @@ static void dump_rawinput( const char *prefix, const union rawinput *rawinput )
rawinput
->
kbd
.
message
,
rawinput
->
kbd
.
vkey
,
rawinput
->
kbd
.
scan
);
break
;
case
RIM_TYPEHID
:
fprintf
(
stderr
,
"%s{type=HID,device=%04x,param=%04x,
page=%04hx,usage=%04h
x,count=%u,length=%u}"
,
prefix
,
rawinput
->
hid
.
device
,
rawinput
->
hid
.
param
,
rawinput
->
hid
.
usage_page
,
rawinput
->
hid
.
usage
,
rawinput
->
hid
.
count
,
rawinput
->
hid
.
length
);
fprintf
(
stderr
,
"%s{type=HID,device=%04x,param=%04x,
usage=%04x:%04
x,count=%u,length=%u}"
,
prefix
,
rawinput
->
hid
.
device
,
rawinput
->
hid
.
param
,
HIWORD
(
rawinput
->
hid
.
usage
)
,
LOWORD
(
rawinput
->
hid
.
usage
)
,
rawinput
->
hid
.
count
,
rawinput
->
hid
.
length
);
break
;
default:
fprintf
(
stderr
,
"%s{type=%04x}"
,
prefix
,
rawinput
->
type
);
...
...
@@ -1357,8 +1357,8 @@ static void dump_varargs_rawinput_devices(const char *prefix, data_size_t size )
while
(
size
>=
sizeof
(
*
device
))
{
device
=
cur_data
;
fprintf
(
stderr
,
"{usage
_page=%04x,usage=%04
x,flags=%08x,target=%08x}"
,
device
->
usage
_page
,
device
->
usage
,
device
->
flags
,
device
->
target
);
fprintf
(
stderr
,
"{usage
=%08
x,flags=%08x,target=%08x}"
,
device
->
usage
,
device
->
flags
,
device
->
target
);
size
-=
sizeof
(
*
device
);
remove_data
(
sizeof
(
*
device
)
);
if
(
size
)
fputc
(
','
,
stderr
);
...
...
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