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
cd30bf64
Commit
cd30bf64
authored
Jan 28, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Jan 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winexinput.sys: Fix warnings from long integer types.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ad060ae8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
22 deletions
+21
-22
Makefile.in
dlls/winexinput.sys/Makefile.in
+0
-1
main.c
dlls/winexinput.sys/main.c
+21
-21
No files found.
dlls/winexinput.sys/Makefile.in
View file @
cd30bf64
EXTRADEFS
=
-DWINE_NO_LONG_TYPES
MODULE
=
winexinput.sys
IMPORTS
=
ntoskrnl hidparse
EXTRADLLFLAGS
=
-Wl
,--subsystem,native
...
...
dlls/winexinput.sys/main.c
View file @
cd30bf64
...
...
@@ -124,7 +124,7 @@ struct device
{
BOOL
is_fdo
;
BOOL
is_gamepad
;
BOOL
removed
;
LONG
removed
;
WCHAR
device_id
[
MAX_DEVICE_ID_LEN
];
};
...
...
@@ -204,28 +204,28 @@ static void translate_report_to_xinput_state(struct func_device *fdo)
count
=
ARRAY_SIZE
(
usages
);
status
=
HidP_GetUsages
(
HidP_Input
,
HID_USAGE_PAGE_BUTTON
,
0
,
usages
,
&
count
,
preparsed
,
fdo
->
report_buf
,
fdo
->
report_len
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetUsages returned %#x
\n
"
,
status
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetUsages returned %#
l
x
\n
"
,
status
);
status
=
HidP_GetUsageValue
(
HidP_Input
,
HID_USAGE_PAGE_GENERIC
,
0
,
HID_USAGE_GENERIC_HATSWITCH
,
&
hat
,
preparsed
,
fdo
->
report_buf
,
fdo
->
report_len
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetUsageValue hat returned %#x
\n
"
,
status
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetUsageValue hat returned %#
l
x
\n
"
,
status
);
status
=
HidP_GetUsageValue
(
HidP_Input
,
HID_USAGE_PAGE_GENERIC
,
0
,
HID_USAGE_GENERIC_X
,
&
lx
,
preparsed
,
fdo
->
report_buf
,
fdo
->
report_len
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetUsageValue x returned %#x
\n
"
,
status
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetUsageValue x returned %#
l
x
\n
"
,
status
);
status
=
HidP_GetUsageValue
(
HidP_Input
,
HID_USAGE_PAGE_GENERIC
,
0
,
HID_USAGE_GENERIC_Y
,
&
ly
,
preparsed
,
fdo
->
report_buf
,
fdo
->
report_len
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetUsageValue y returned %#x
\n
"
,
status
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetUsageValue y returned %#
l
x
\n
"
,
status
);
status
=
HidP_GetUsageValue
(
HidP_Input
,
HID_USAGE_PAGE_GENERIC
,
0
,
HID_USAGE_GENERIC_Z
,
&
lt
,
preparsed
,
fdo
->
report_buf
,
fdo
->
report_len
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetUsageValue z returned %#x
\n
"
,
status
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetUsageValue z returned %#
l
x
\n
"
,
status
);
status
=
HidP_GetUsageValue
(
HidP_Input
,
HID_USAGE_PAGE_GENERIC
,
0
,
HID_USAGE_GENERIC_RX
,
&
rx
,
preparsed
,
fdo
->
report_buf
,
fdo
->
report_len
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetUsageValue rx returned %#x
\n
"
,
status
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetUsageValue rx returned %#
l
x
\n
"
,
status
);
status
=
HidP_GetUsageValue
(
HidP_Input
,
HID_USAGE_PAGE_GENERIC
,
0
,
HID_USAGE_GENERIC_RY
,
&
ry
,
preparsed
,
fdo
->
report_buf
,
fdo
->
report_len
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetUsageValue ry returned %#x
\n
"
,
status
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetUsageValue ry returned %#
l
x
\n
"
,
status
);
status
=
HidP_GetUsageValue
(
HidP_Input
,
HID_USAGE_PAGE_GENERIC
,
0
,
HID_USAGE_GENERIC_RZ
,
&
rt
,
preparsed
,
fdo
->
report_buf
,
fdo
->
report_len
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetUsageValue rz returned %#x
\n
"
,
status
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetUsageValue rz returned %#
l
x
\n
"
,
status
);
if
(
hat
<
1
||
hat
>
8
)
fdo
->
xinput_state
.
buttons
=
0
;
else
fdo
->
xinput_state
.
buttons
=
hat
<<
10
;
...
...
@@ -322,7 +322,7 @@ static NTSTATUS WINAPI gamepad_internal_ioctl(DEVICE_OBJECT *device, IRP *irp)
ULONG
code
=
stack
->
Parameters
.
DeviceIoControl
.
IoControlCode
;
struct
func_device
*
fdo
=
fdo_from_DEVICE_OBJECT
(
device
);
TRACE
(
"device %p, irp %p, code %#x, bus_device %p.
\n
"
,
device
,
irp
,
code
,
fdo
->
bus_device
);
TRACE
(
"device %p, irp %p, code %#
l
x, bus_device %p.
\n
"
,
device
,
irp
,
code
,
fdo
->
bus_device
);
switch
(
code
)
{
...
...
@@ -397,7 +397,7 @@ static NTSTATUS WINAPI internal_ioctl(DEVICE_OBJECT *device, IRP *irp)
return
STATUS_DELETE_PENDING
;
}
TRACE
(
"device %p, irp %p, code %#x, bus_device %p.
\n
"
,
device
,
irp
,
code
,
fdo
->
bus_device
);
TRACE
(
"device %p, irp %p, code %#
l
x, bus_device %p.
\n
"
,
device
,
irp
,
code
,
fdo
->
bus_device
);
if
(
code
==
IOCTL_HID_READ_REPORT
)
return
try_complete_pending_read
(
device
,
irp
);
if
(
impl
->
is_gamepad
)
return
gamepad_internal_ioctl
(
device
,
irp
);
...
...
@@ -465,7 +465,7 @@ static NTSTATUS WINAPI pdo_pnp(DEVICE_OBJECT *device, IRP *irp)
IO_STACK_LOCATION
*
stack
=
IoGetCurrentIrpStackLocation
(
irp
);
struct
func_device
*
fdo
=
fdo_from_DEVICE_OBJECT
(
device
);
struct
device
*
impl
=
impl_from_DEVICE_OBJECT
(
device
);
U
LONG
code
=
stack
->
MinorFunction
;
U
CHAR
code
=
stack
->
MinorFunction
;
NTSTATUS
status
;
IRP
*
pending
;
...
...
@@ -568,7 +568,7 @@ static NTSTATUS create_child_pdos(DEVICE_OBJECT *device)
if
((
status
=
IoCreateDevice
(
device
->
DriverObject
,
sizeof
(
struct
phys_device
),
&
name_str
,
0
,
0
,
FALSE
,
&
gamepad_device
)))
{
ERR
(
"failed to create gamepad device, status %#x.
\n
"
,
status
);
ERR
(
"failed to create gamepad device, status %#
l
x.
\n
"
,
status
);
return
status
;
}
...
...
@@ -579,7 +579,7 @@ static NTSTATUS create_child_pdos(DEVICE_OBJECT *device)
if
((
status
=
IoCreateDevice
(
device
->
DriverObject
,
sizeof
(
struct
phys_device
),
&
name_str
,
0
,
0
,
FALSE
,
&
xinput_device
)))
{
ERR
(
"failed to create xinput device, status %#x.
\n
"
,
status
);
ERR
(
"failed to create xinput device, status %#
l
x.
\n
"
,
status
);
IoDeleteDevice
(
gamepad_device
);
return
status
;
}
...
...
@@ -641,7 +641,7 @@ static void check_value_caps(struct func_device *fdo, USHORT usage, HIDP_VALUE_C
static
NTSTATUS
initialize_device
(
DEVICE_OBJECT
*
device
)
{
struct
func_device
*
fdo
=
fdo_from_DEVICE_OBJECT
(
device
);
U
LONG
i
,
u
,
button_count
,
report_desc_len
,
report_count
;
U
INT
i
,
u
,
button_count
,
report_desc_len
,
report_count
;
PHIDP_REPORT_DESCRIPTOR
report_desc
;
PHIDP_PREPARSED_DATA
preparsed
;
HIDP_BUTTON_CAPS
*
button_caps
;
...
...
@@ -669,7 +669,7 @@ static NTSTATUS initialize_device(DEVICE_OBJECT *device)
button_count
=
0
;
if
(
!
(
button_caps
=
malloc
(
sizeof
(
*
button_caps
)
*
caps
.
NumberInputButtonCaps
)))
return
STATUS_NO_MEMORY
;
status
=
HidP_GetButtonCaps
(
HidP_Input
,
button_caps
,
&
caps
.
NumberInputButtonCaps
,
preparsed
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetButtonCaps returned %#x
\n
"
,
status
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetButtonCaps returned %#
l
x
\n
"
,
status
);
else
for
(
i
=
0
;
i
<
caps
.
NumberInputButtonCaps
;
i
++
)
{
if
(
button_caps
[
i
].
UsagePage
!=
HID_USAGE_PAGE_BUTTON
)
continue
;
...
...
@@ -682,7 +682,7 @@ static NTSTATUS initialize_device(DEVICE_OBJECT *device)
if
(
!
(
value_caps
=
malloc
(
sizeof
(
*
value_caps
)
*
caps
.
NumberInputValueCaps
)))
return
STATUS_NO_MEMORY
;
status
=
HidP_GetValueCaps
(
HidP_Input
,
value_caps
,
&
caps
.
NumberInputValueCaps
,
preparsed
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetValueCaps returned %#x
\n
"
,
status
);
if
(
status
!=
HIDP_STATUS_SUCCESS
)
WARN
(
"HidP_GetValueCaps returned %#
l
x
\n
"
,
status
);
else
for
(
i
=
0
;
i
<
caps
.
NumberInputValueCaps
;
i
++
)
{
HIDP_VALUE_CAPS
*
caps
=
value_caps
+
i
;
...
...
@@ -721,7 +721,7 @@ static NTSTATUS WINAPI fdo_pnp(DEVICE_OBJECT *device, IRP *irp)
{
IO_STACK_LOCATION
*
stack
=
IoGetCurrentIrpStackLocation
(
irp
);
struct
func_device
*
fdo
=
fdo_from_DEVICE_OBJECT
(
device
);
U
LONG
code
=
stack
->
MinorFunction
;
U
CHAR
code
=
stack
->
MinorFunction
;
DEVICE_RELATIONS
*
devices
;
DEVICE_OBJECT
*
child
;
NTSTATUS
status
;
...
...
@@ -839,7 +839,7 @@ static NTSTATUS WINAPI add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *bus_devi
if
((
status
=
get_device_id
(
bus_device
,
BusQueryDeviceID
,
bus_id
)))
{
ERR
(
"failed to get bus device id, status %#x.
\n
"
,
status
);
ERR
(
"failed to get bus device id, status %#
l
x.
\n
"
,
status
);
return
status
;
}
...
...
@@ -852,14 +852,14 @@ static NTSTATUS WINAPI add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *bus_devi
if
((
status
=
get_device_id
(
bus_device
,
BusQueryInstanceID
,
instance_id
)))
{
ERR
(
"failed to get bus device instance id, status %#x.
\n
"
,
status
);
ERR
(
"failed to get bus device instance id, status %#
l
x.
\n
"
,
status
);
return
status
;
}
if
((
status
=
IoCreateDevice
(
driver
,
sizeof
(
struct
func_device
),
NULL
,
FILE_DEVICE_BUS_EXTENDER
,
0
,
FALSE
,
&
device
)))
{
ERR
(
"failed to create bus FDO, status %#x.
\n
"
,
status
);
ERR
(
"failed to create bus FDO, status %#
l
x.
\n
"
,
status
);
return
status
;
}
...
...
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