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
82212294
Commit
82212294
authored
Sep 21, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Sep 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebus.sys: Always add padding after button blocks.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
593c4d51
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
25 deletions
+11
-25
bus_sdl.c
dlls/winebus.sys/bus_sdl.c
+0
-7
bus_udev.c
dlls/winebus.sys/bus_udev.c
+0
-7
hid.c
dlls/winebus.sys/hid.c
+11
-10
unix_private.h
dlls/winebus.sys/unix_private.h
+0
-1
No files found.
dlls/winebus.sys/bus_sdl.c
View file @
82212294
...
...
@@ -422,13 +422,6 @@ static NTSTATUS build_mapped_report_descriptor(struct platform_private *ext)
if
(
!
hid_descriptor_add_buttons
(
&
ext
->
desc
,
HID_USAGE_PAGE_BUTTON
,
1
,
CONTROLLER_NUM_BUTTONS
))
return
STATUS_NO_MEMORY
;
if
(
BUTTON_BIT_COUNT
%
8
!=
0
)
{
/* unused bits between hatswitch and following constant */
if
(
!
hid_descriptor_add_padding
(
&
ext
->
desc
,
8
-
(
BUTTON_BIT_COUNT
%
8
)))
return
STATUS_NO_MEMORY
;
}
if
(
!
descriptor_add_haptic
(
ext
))
return
STATUS_NO_MEMORY
;
...
...
dlls/winebus.sys/bus_udev.c
View file @
82212294
...
...
@@ -521,13 +521,6 @@ static NTSTATUS build_report_descriptor(struct wine_input_private *ext, struct u
if
(
!
hid_descriptor_add_buttons
(
&
ext
->
desc
,
HID_USAGE_PAGE_BUTTON
,
1
,
button_count
))
return
STATUS_NO_MEMORY
;
if
(
button_count
%
8
)
{
BYTE
padding
=
8
-
(
button_count
%
8
);
if
(
!
hid_descriptor_add_padding
(
&
ext
->
desc
,
padding
))
return
STATUS_NO_MEMORY
;
}
report_size
+=
(
button_count
+
7
)
/
8
;
}
...
...
dlls/winebus.sys/hid.c
View file @
82212294
...
...
@@ -99,6 +99,7 @@ void hid_descriptor_free(struct hid_descriptor *desc)
BOOL
hid_descriptor_add_buttons
(
struct
hid_descriptor
*
desc
,
USAGE
usage_page
,
USAGE
usage_min
,
USAGE
usage_max
)
{
const
USHORT
count
=
usage_max
-
usage_min
+
1
;
const
BYTE
template
[]
=
{
USAGE_PAGE
(
2
,
usage_page
),
...
...
@@ -108,24 +109,24 @@ BOOL hid_descriptor_add_buttons(struct hid_descriptor *desc, USAGE usage_page,
LOGICAL_MAXIMUM
(
1
,
1
),
PHYSICAL_MINIMUM
(
1
,
0
),
PHYSICAL_MAXIMUM
(
1
,
1
),
REPORT_COUNT
(
2
,
usage_max
-
usage_min
+
1
),
REPORT_COUNT
(
2
,
count
),
REPORT_SIZE
(
1
,
1
),
INPUT
(
1
,
Data
|
Var
|
Abs
),
};
return
hid_descriptor_append
(
desc
,
template
,
sizeof
(
template
));
}
BOOL
hid_descriptor_add_padding
(
struct
hid_descriptor
*
desc
,
BYTE
bitcount
)
{
const
BYTE
template
[]
=
const
BYTE
template_pad
[]
=
{
REPORT_COUNT
(
1
,
bitcount
),
REPORT_COUNT
(
1
,
8
-
(
count
%
8
)
),
REPORT_SIZE
(
1
,
1
),
INPUT
(
1
,
Cnst
|
Var
|
Abs
),
};
return
hid_descriptor_append
(
desc
,
template
,
sizeof
(
template
));
if
(
!
hid_descriptor_append
(
desc
,
template
,
sizeof
(
template
)))
return
FALSE
;
if
((
count
%
8
)
&&
!
hid_descriptor_append
(
desc
,
template_pad
,
sizeof
(
template_pad
)))
return
FALSE
;
return
TRUE
;
}
BOOL
hid_descriptor_add_hatswitch
(
struct
hid_descriptor
*
desc
,
INT
count
)
...
...
dlls/winebus.sys/unix_private.h
View file @
82212294
...
...
@@ -82,7 +82,6 @@ extern void hid_descriptor_free(struct hid_descriptor *desc) DECLSPEC_HIDDEN;
extern
BOOL
hid_descriptor_add_buttons
(
struct
hid_descriptor
*
desc
,
USAGE
usage_page
,
USAGE
usage_min
,
USAGE
usage_max
)
DECLSPEC_HIDDEN
;
extern
BOOL
hid_descriptor_add_padding
(
struct
hid_descriptor
*
desc
,
BYTE
bitcount
)
DECLSPEC_HIDDEN
;
extern
BOOL
hid_descriptor_add_hatswitch
(
struct
hid_descriptor
*
desc
,
INT
count
)
DECLSPEC_HIDDEN
;
extern
BOOL
hid_descriptor_add_axes
(
struct
hid_descriptor
*
desc
,
BYTE
count
,
USAGE
usage_page
,
const
USAGE
*
usages
,
BOOL
rel
,
LONG
min
,
LONG
max
)
DECLSPEC_HIDDEN
;
...
...
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