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
ee5cde83
Commit
ee5cde83
authored
Aug 18, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Aug 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebus.sys: Merge begin_report_processing with start_device.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8f065f97
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
94 deletions
+51
-94
bus.h
dlls/winebus.sys/bus.h
+0
-1
bus_iohid.c
dlls/winebus.sys/bus_iohid.c
+9
-18
bus_sdl.c
dlls/winebus.sys/bus_sdl.c
+0
-6
bus_udev.c
dlls/winebus.sys/bus_udev.c
+42
-52
main.c
dlls/winebus.sys/main.c
+0
-17
No files found.
dlls/winebus.sys/bus.h
View file @
ee5cde83
...
@@ -42,7 +42,6 @@ typedef struct
...
@@ -42,7 +42,6 @@ typedef struct
NTSTATUS
(
*
start_device
)(
DEVICE_OBJECT
*
device
);
NTSTATUS
(
*
start_device
)(
DEVICE_OBJECT
*
device
);
NTSTATUS
(
*
get_reportdescriptor
)(
DEVICE_OBJECT
*
device
,
BYTE
*
buffer
,
DWORD
length
,
DWORD
*
out_length
);
NTSTATUS
(
*
get_reportdescriptor
)(
DEVICE_OBJECT
*
device
,
BYTE
*
buffer
,
DWORD
length
,
DWORD
*
out_length
);
NTSTATUS
(
*
get_string
)(
DEVICE_OBJECT
*
device
,
DWORD
index
,
WCHAR
*
buffer
,
DWORD
length
);
NTSTATUS
(
*
get_string
)(
DEVICE_OBJECT
*
device
,
DWORD
index
,
WCHAR
*
buffer
,
DWORD
length
);
NTSTATUS
(
*
begin_report_processing
)(
DEVICE_OBJECT
*
device
);
NTSTATUS
(
*
set_output_report
)(
DEVICE_OBJECT
*
device
,
UCHAR
id
,
BYTE
*
report
,
DWORD
length
,
ULONG_PTR
*
written
);
NTSTATUS
(
*
set_output_report
)(
DEVICE_OBJECT
*
device
,
UCHAR
id
,
BYTE
*
report
,
DWORD
length
,
ULONG_PTR
*
written
);
NTSTATUS
(
*
get_feature_report
)(
DEVICE_OBJECT
*
device
,
UCHAR
id
,
BYTE
*
report
,
DWORD
length
,
ULONG_PTR
*
read
);
NTSTATUS
(
*
get_feature_report
)(
DEVICE_OBJECT
*
device
,
UCHAR
id
,
BYTE
*
report
,
DWORD
length
,
ULONG_PTR
*
read
);
NTSTATUS
(
*
set_feature_report
)(
DEVICE_OBJECT
*
device
,
UCHAR
id
,
BYTE
*
report
,
DWORD
length
,
ULONG_PTR
*
written
);
NTSTATUS
(
*
set_feature_report
)(
DEVICE_OBJECT
*
device
,
UCHAR
id
,
BYTE
*
report
,
DWORD
length
,
ULONG_PTR
*
written
);
...
...
dlls/winebus.sys/bus_iohid.c
View file @
ee5cde83
...
@@ -150,6 +150,15 @@ static int compare_platform_device(DEVICE_OBJECT *device, void *platform_dev)
...
@@ -150,6 +150,15 @@ static int compare_platform_device(DEVICE_OBJECT *device, void *platform_dev)
static
NTSTATUS
start_device
(
DEVICE_OBJECT
*
device
)
static
NTSTATUS
start_device
(
DEVICE_OBJECT
*
device
)
{
{
DWORD
length
;
struct
platform_private
*
private
=
impl_from_DEVICE_OBJECT
(
device
);
CFNumberRef
num
;
num
=
IOHIDDeviceGetProperty
(
private
->
device
,
CFSTR
(
kIOHIDMaxInputReportSizeKey
));
length
=
CFNumberToDWORD
(
num
);
private
->
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
length
);
IOHIDDeviceRegisterInputReportCallback
(
private
->
device
,
private
->
buffer
,
length
,
handle_IOHIDDeviceIOHIDReportCallback
,
device
);
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
}
}
...
@@ -204,23 +213,6 @@ static NTSTATUS get_string(DEVICE_OBJECT *device, DWORD index, WCHAR *buffer, DW
...
@@ -204,23 +213,6 @@ static NTSTATUS get_string(DEVICE_OBJECT *device, DWORD index, WCHAR *buffer, DW
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
}
}
static
NTSTATUS
begin_report_processing
(
DEVICE_OBJECT
*
device
)
{
DWORD
length
;
struct
platform_private
*
private
=
impl_from_DEVICE_OBJECT
(
device
);
CFNumberRef
num
;
if
(
private
->
buffer
)
return
STATUS_SUCCESS
;
num
=
IOHIDDeviceGetProperty
(
private
->
device
,
CFSTR
(
kIOHIDMaxInputReportSizeKey
));
length
=
CFNumberToDWORD
(
num
);
private
->
buffer
=
HeapAlloc
(
GetProcessHeap
(),
0
,
length
);
IOHIDDeviceRegisterInputReportCallback
(
private
->
device
,
private
->
buffer
,
length
,
handle_IOHIDDeviceIOHIDReportCallback
,
device
);
return
STATUS_SUCCESS
;
}
static
NTSTATUS
set_output_report
(
DEVICE_OBJECT
*
device
,
UCHAR
id
,
BYTE
*
report
,
DWORD
length
,
ULONG_PTR
*
written
)
static
NTSTATUS
set_output_report
(
DEVICE_OBJECT
*
device
,
UCHAR
id
,
BYTE
*
report
,
DWORD
length
,
ULONG_PTR
*
written
)
{
{
IOReturn
result
;
IOReturn
result
;
...
@@ -282,7 +274,6 @@ static const platform_vtbl iohid_vtbl =
...
@@ -282,7 +274,6 @@ static const platform_vtbl iohid_vtbl =
start_device
,
start_device
,
get_reportdescriptor
,
get_reportdescriptor
,
get_string
,
get_string
,
begin_report_processing
,
set_output_report
,
set_output_report
,
get_feature_report
,
get_feature_report
,
set_feature_report
,
set_feature_report
,
...
...
dlls/winebus.sys/bus_sdl.c
View file @
ee5cde83
...
@@ -536,11 +536,6 @@ static NTSTATUS get_string(DEVICE_OBJECT *device, DWORD index, WCHAR *buffer, DW
...
@@ -536,11 +536,6 @@ static NTSTATUS get_string(DEVICE_OBJECT *device, DWORD index, WCHAR *buffer, DW
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
}
}
static
NTSTATUS
begin_report_processing
(
DEVICE_OBJECT
*
device
)
{
return
STATUS_SUCCESS
;
}
static
NTSTATUS
set_output_report
(
DEVICE_OBJECT
*
device
,
UCHAR
id
,
BYTE
*
report
,
DWORD
length
,
ULONG_PTR
*
written
)
static
NTSTATUS
set_output_report
(
DEVICE_OBJECT
*
device
,
UCHAR
id
,
BYTE
*
report
,
DWORD
length
,
ULONG_PTR
*
written
)
{
{
struct
platform_private
*
ext
=
impl_from_DEVICE_OBJECT
(
device
);
struct
platform_private
*
ext
=
impl_from_DEVICE_OBJECT
(
device
);
...
@@ -606,7 +601,6 @@ static const platform_vtbl sdl_vtbl =
...
@@ -606,7 +601,6 @@ static const platform_vtbl sdl_vtbl =
start_device
,
start_device
,
get_reportdescriptor
,
get_reportdescriptor
,
get_string
,
get_string
,
begin_report_processing
,
set_output_report
,
set_output_report
,
get_feature_report
,
get_feature_report
,
set_feature_report
,
set_feature_report
,
...
...
dlls/winebus.sys/bus_udev.c
View file @
ee5cde83
...
@@ -558,8 +558,27 @@ static int compare_platform_device(DEVICE_OBJECT *device, void *platform_dev)
...
@@ -558,8 +558,27 @@ static int compare_platform_device(DEVICE_OBJECT *device, void *platform_dev)
return
strcmp
(
udev_device_get_syspath
(
dev1
),
udev_device_get_syspath
(
dev2
));
return
strcmp
(
udev_device_get_syspath
(
dev1
),
udev_device_get_syspath
(
dev2
));
}
}
static
DWORD
CALLBACK
device_report_thread
(
void
*
args
);
static
NTSTATUS
hidraw_start_device
(
DEVICE_OBJECT
*
device
)
static
NTSTATUS
hidraw_start_device
(
DEVICE_OBJECT
*
device
)
{
{
struct
platform_private
*
private
=
impl_from_DEVICE_OBJECT
(
device
);
if
(
pipe
(
private
->
control_pipe
)
!=
0
)
{
ERR
(
"Control pipe creation failed
\n
"
);
return
STATUS_UNSUCCESSFUL
;
}
private
->
report_thread
=
CreateThread
(
NULL
,
0
,
device_report_thread
,
device
,
0
,
NULL
);
if
(
!
private
->
report_thread
)
{
ERR
(
"Unable to create device report thread
\n
"
);
close
(
private
->
control_pipe
[
0
]);
close
(
private
->
control_pipe
[
1
]);
return
STATUS_UNSUCCESSFUL
;
}
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
}
}
...
@@ -697,31 +716,6 @@ static DWORD CALLBACK device_report_thread(void *args)
...
@@ -697,31 +716,6 @@ static DWORD CALLBACK device_report_thread(void *args)
return
0
;
return
0
;
}
}
static
NTSTATUS
begin_report_processing
(
DEVICE_OBJECT
*
device
)
{
struct
platform_private
*
private
=
impl_from_DEVICE_OBJECT
(
device
);
if
(
private
->
report_thread
)
return
STATUS_SUCCESS
;
if
(
pipe
(
private
->
control_pipe
)
!=
0
)
{
ERR
(
"Control pipe creation failed
\n
"
);
return
STATUS_UNSUCCESSFUL
;
}
private
->
report_thread
=
CreateThread
(
NULL
,
0
,
device_report_thread
,
device
,
0
,
NULL
);
if
(
!
private
->
report_thread
)
{
ERR
(
"Unable to create device report thread
\n
"
);
close
(
private
->
control_pipe
[
0
]);
close
(
private
->
control_pipe
[
1
]);
return
STATUS_UNSUCCESSFUL
;
}
else
return
STATUS_SUCCESS
;
}
static
NTSTATUS
hidraw_set_output_report
(
DEVICE_OBJECT
*
device
,
UCHAR
id
,
BYTE
*
report
,
DWORD
length
,
ULONG_PTR
*
written
)
static
NTSTATUS
hidraw_set_output_report
(
DEVICE_OBJECT
*
device
,
UCHAR
id
,
BYTE
*
report
,
DWORD
length
,
ULONG_PTR
*
written
)
{
{
struct
platform_private
*
ext
=
impl_from_DEVICE_OBJECT
(
device
);
struct
platform_private
*
ext
=
impl_from_DEVICE_OBJECT
(
device
);
...
@@ -826,7 +820,6 @@ static const platform_vtbl hidraw_vtbl =
...
@@ -826,7 +820,6 @@ static const platform_vtbl hidraw_vtbl =
hidraw_start_device
,
hidraw_start_device
,
hidraw_get_reportdescriptor
,
hidraw_get_reportdescriptor
,
hidraw_get_string
,
hidraw_get_string
,
begin_report_processing
,
hidraw_set_output_report
,
hidraw_set_output_report
,
hidraw_get_feature_report
,
hidraw_get_feature_report
,
hidraw_set_feature_report
,
hidraw_set_feature_report
,
...
@@ -860,10 +853,32 @@ static void lnxev_free_device(DEVICE_OBJECT *device)
...
@@ -860,10 +853,32 @@ static void lnxev_free_device(DEVICE_OBJECT *device)
udev_device_unref
(
ext
->
base
.
udev_device
);
udev_device_unref
(
ext
->
base
.
udev_device
);
}
}
static
DWORD
CALLBACK
lnxev_device_report_thread
(
void
*
args
);
static
NTSTATUS
lnxev_start_device
(
DEVICE_OBJECT
*
device
)
static
NTSTATUS
lnxev_start_device
(
DEVICE_OBJECT
*
device
)
{
{
struct
wine_input_private
*
ext
=
input_impl_from_DEVICE_OBJECT
(
device
);
struct
wine_input_private
*
ext
=
input_impl_from_DEVICE_OBJECT
(
device
);
return
build_report_descriptor
(
ext
,
ext
->
base
.
udev_device
);
NTSTATUS
status
;
if
((
status
=
build_report_descriptor
(
ext
,
ext
->
base
.
udev_device
)))
return
status
;
if
(
pipe
(
ext
->
base
.
control_pipe
)
!=
0
)
{
ERR
(
"Control pipe creation failed
\n
"
);
return
STATUS_UNSUCCESSFUL
;
}
ext
->
base
.
report_thread
=
CreateThread
(
NULL
,
0
,
lnxev_device_report_thread
,
device
,
0
,
NULL
);
if
(
!
ext
->
base
.
report_thread
)
{
ERR
(
"Unable to create device report thread
\n
"
);
close
(
ext
->
base
.
control_pipe
[
0
]);
close
(
ext
->
base
.
control_pipe
[
1
]);
return
STATUS_UNSUCCESSFUL
;
}
return
STATUS_SUCCESS
;
}
}
static
NTSTATUS
lnxev_get_reportdescriptor
(
DEVICE_OBJECT
*
device
,
BYTE
*
buffer
,
DWORD
length
,
DWORD
*
out_length
)
static
NTSTATUS
lnxev_get_reportdescriptor
(
DEVICE_OBJECT
*
device
,
BYTE
*
buffer
,
DWORD
length
,
DWORD
*
out_length
)
...
@@ -934,30 +949,6 @@ static DWORD CALLBACK lnxev_device_report_thread(void *args)
...
@@ -934,30 +949,6 @@ static DWORD CALLBACK lnxev_device_report_thread(void *args)
return
0
;
return
0
;
}
}
static
NTSTATUS
lnxev_begin_report_processing
(
DEVICE_OBJECT
*
device
)
{
struct
wine_input_private
*
private
=
input_impl_from_DEVICE_OBJECT
(
device
);
if
(
private
->
base
.
report_thread
)
return
STATUS_SUCCESS
;
if
(
pipe
(
private
->
base
.
control_pipe
)
!=
0
)
{
ERR
(
"Control pipe creation failed
\n
"
);
return
STATUS_UNSUCCESSFUL
;
}
private
->
base
.
report_thread
=
CreateThread
(
NULL
,
0
,
lnxev_device_report_thread
,
device
,
0
,
NULL
);
if
(
!
private
->
base
.
report_thread
)
{
ERR
(
"Unable to create device report thread
\n
"
);
close
(
private
->
base
.
control_pipe
[
0
]);
close
(
private
->
base
.
control_pipe
[
1
]);
return
STATUS_UNSUCCESSFUL
;
}
return
STATUS_SUCCESS
;
}
static
NTSTATUS
lnxev_set_output_report
(
DEVICE_OBJECT
*
device
,
UCHAR
id
,
BYTE
*
report
,
DWORD
length
,
ULONG_PTR
*
written
)
static
NTSTATUS
lnxev_set_output_report
(
DEVICE_OBJECT
*
device
,
UCHAR
id
,
BYTE
*
report
,
DWORD
length
,
ULONG_PTR
*
written
)
{
{
*
written
=
0
;
*
written
=
0
;
...
@@ -982,7 +973,6 @@ static const platform_vtbl lnxev_vtbl = {
...
@@ -982,7 +973,6 @@ static const platform_vtbl lnxev_vtbl = {
lnxev_start_device
,
lnxev_start_device
,
lnxev_get_reportdescriptor
,
lnxev_get_reportdescriptor
,
lnxev_get_string
,
lnxev_get_string
,
lnxev_begin_report_processing
,
lnxev_set_output_report
,
lnxev_set_output_report
,
lnxev_get_feature_report
,
lnxev_get_feature_report
,
lnxev_set_feature_report
,
lnxev_set_feature_report
,
...
...
dlls/winebus.sys/main.c
View file @
ee5cde83
...
@@ -502,11 +502,6 @@ static NTSTATUS mouse_get_string(DEVICE_OBJECT *device, DWORD index, WCHAR *buff
...
@@ -502,11 +502,6 @@ static NTSTATUS mouse_get_string(DEVICE_OBJECT *device, DWORD index, WCHAR *buff
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
}
}
static
NTSTATUS
mouse_begin_report_processing
(
DEVICE_OBJECT
*
device
)
{
return
STATUS_SUCCESS
;
}
static
NTSTATUS
mouse_set_output_report
(
DEVICE_OBJECT
*
device
,
UCHAR
id
,
BYTE
*
report
,
DWORD
length
,
ULONG_PTR
*
ret_length
)
static
NTSTATUS
mouse_set_output_report
(
DEVICE_OBJECT
*
device
,
UCHAR
id
,
BYTE
*
report
,
DWORD
length
,
ULONG_PTR
*
ret_length
)
{
{
FIXME
(
"id %u, stub!
\n
"
,
id
);
FIXME
(
"id %u, stub!
\n
"
,
id
);
...
@@ -531,7 +526,6 @@ static const platform_vtbl mouse_vtbl =
...
@@ -531,7 +526,6 @@ static const platform_vtbl mouse_vtbl =
.
start_device
=
mouse_start_device
,
.
start_device
=
mouse_start_device
,
.
get_reportdescriptor
=
mouse_get_reportdescriptor
,
.
get_reportdescriptor
=
mouse_get_reportdescriptor
,
.
get_string
=
mouse_get_string
,
.
get_string
=
mouse_get_string
,
.
begin_report_processing
=
mouse_begin_report_processing
,
.
set_output_report
=
mouse_set_output_report
,
.
set_output_report
=
mouse_set_output_report
,
.
get_feature_report
=
mouse_get_feature_report
,
.
get_feature_report
=
mouse_get_feature_report
,
.
set_feature_report
=
mouse_set_feature_report
,
.
set_feature_report
=
mouse_set_feature_report
,
...
@@ -582,11 +576,6 @@ static NTSTATUS keyboard_get_string(DEVICE_OBJECT *device, DWORD index, WCHAR *b
...
@@ -582,11 +576,6 @@ static NTSTATUS keyboard_get_string(DEVICE_OBJECT *device, DWORD index, WCHAR *b
return
STATUS_SUCCESS
;
return
STATUS_SUCCESS
;
}
}
static
NTSTATUS
keyboard_begin_report_processing
(
DEVICE_OBJECT
*
device
)
{
return
STATUS_SUCCESS
;
}
static
NTSTATUS
keyboard_set_output_report
(
DEVICE_OBJECT
*
device
,
UCHAR
id
,
BYTE
*
report
,
DWORD
length
,
ULONG_PTR
*
ret_length
)
static
NTSTATUS
keyboard_set_output_report
(
DEVICE_OBJECT
*
device
,
UCHAR
id
,
BYTE
*
report
,
DWORD
length
,
ULONG_PTR
*
ret_length
)
{
{
FIXME
(
"id %u, stub!
\n
"
,
id
);
FIXME
(
"id %u, stub!
\n
"
,
id
);
...
@@ -611,7 +600,6 @@ static const platform_vtbl keyboard_vtbl =
...
@@ -611,7 +600,6 @@ static const platform_vtbl keyboard_vtbl =
.
start_device
=
keyboard_start_device
,
.
start_device
=
keyboard_start_device
,
.
get_reportdescriptor
=
keyboard_get_reportdescriptor
,
.
get_reportdescriptor
=
keyboard_get_reportdescriptor
,
.
get_string
=
keyboard_get_string
,
.
get_string
=
keyboard_get_string
,
.
begin_report_processing
=
keyboard_begin_report_processing
,
.
set_output_report
=
keyboard_set_output_report
,
.
set_output_report
=
keyboard_set_output_report
,
.
get_feature_report
=
keyboard_get_feature_report
,
.
get_feature_report
=
keyboard_get_feature_report
,
.
set_feature_report
=
keyboard_set_feature_report
,
.
set_feature_report
=
keyboard_set_feature_report
,
...
@@ -922,9 +910,6 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
...
@@ -922,9 +910,6 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
{
{
HID_XFER_PACKET
*
packet
=
(
HID_XFER_PACKET
*
)(
irp
->
UserBuffer
);
HID_XFER_PACKET
*
packet
=
(
HID_XFER_PACKET
*
)(
irp
->
UserBuffer
);
TRACE_
(
hid_report
)(
"IOCTL_HID_GET_INPUT_REPORT
\n
"
);
TRACE_
(
hid_report
)(
"IOCTL_HID_GET_INPUT_REPORT
\n
"
);
irp
->
IoStatus
.
Status
=
ext
->
vtbl
->
begin_report_processing
(
device
);
if
(
irp
->
IoStatus
.
Status
!=
STATUS_SUCCESS
)
break
;
irp
->
IoStatus
.
Status
=
deliver_last_report
(
ext
,
irp
->
IoStatus
.
Status
=
deliver_last_report
(
ext
,
packet
->
reportBufferLen
,
packet
->
reportBuffer
,
packet
->
reportBufferLen
,
packet
->
reportBuffer
,
&
irp
->
IoStatus
.
Information
);
&
irp
->
IoStatus
.
Information
);
...
@@ -936,8 +921,6 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
...
@@ -936,8 +921,6 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
case
IOCTL_HID_READ_REPORT
:
case
IOCTL_HID_READ_REPORT
:
{
{
TRACE_
(
hid_report
)(
"IOCTL_HID_READ_REPORT
\n
"
);
TRACE_
(
hid_report
)(
"IOCTL_HID_READ_REPORT
\n
"
);
irp
->
IoStatus
.
Status
=
ext
->
vtbl
->
begin_report_processing
(
device
);
if
(
irp
->
IoStatus
.
Status
!=
STATUS_SUCCESS
)
break
;
if
(
!
ext
->
last_report_read
)
if
(
!
ext
->
last_report_read
)
{
{
irp
->
IoStatus
.
Status
=
deliver_last_report
(
ext
,
irp
->
IoStatus
.
Status
=
deliver_last_report
(
ext
,
...
...
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