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
620b514a
Commit
620b514a
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: Build report descriptors in start_device.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
68c6c7d9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
47 deletions
+19
-47
bus_sdl.c
dlls/winebus.sys/bus_sdl.c
+3
-16
bus_udev.c
dlls/winebus.sys/bus_udev.c
+2
-15
main.c
dlls/winebus.sys/main.c
+14
-16
No files found.
dlls/winebus.sys/bus_sdl.c
View file @
620b514a
...
...
@@ -489,7 +489,9 @@ static int compare_platform_device(DEVICE_OBJECT *device, void *context)
static
NTSTATUS
start_device
(
DEVICE_OBJECT
*
device
)
{
return
STATUS_SUCCESS
;
struct
platform_private
*
ext
=
impl_from_DEVICE_OBJECT
(
device
);
if
(
ext
->
sdl_controller
)
return
build_mapped_report_descriptor
(
ext
);
return
build_report_descriptor
(
ext
);
}
static
NTSTATUS
get_reportdescriptor
(
DEVICE_OBJECT
*
device
,
BYTE
*
buffer
,
DWORD
length
,
DWORD
*
out_length
)
...
...
@@ -797,25 +799,10 @@ static void try_add_device(unsigned int index)
if
(
device
)
{
NTSTATUS
status
;
struct
platform_private
*
private
=
impl_from_DEVICE_OBJECT
(
device
);
private
->
sdl_joystick
=
joystick
;
private
->
sdl_controller
=
controller
;
private
->
id
=
id
;
/* FIXME: We should probably move this to IRP_MN_START_DEVICE. */
if
(
controller
)
status
=
build_mapped_report_descriptor
(
private
);
else
status
=
build_report_descriptor
(
private
);
if
(
status
)
{
ERR
(
"Building report descriptor failed, removing device
\n
"
);
bus_unlink_hid_device
(
device
);
bus_remove_hid_device
(
device
);
HeapFree
(
GetProcessHeap
(),
0
,
serial
);
return
;
}
IoInvalidateDeviceRelations
(
bus_pdo
,
BusRelations
);
}
else
...
...
dlls/winebus.sys/bus_udev.c
View file @
620b514a
...
...
@@ -862,7 +862,8 @@ static void lnxev_free_device(DEVICE_OBJECT *device)
static
NTSTATUS
lnxev_start_device
(
DEVICE_OBJECT
*
device
)
{
return
STATUS_SUCCESS
;
struct
wine_input_private
*
ext
=
input_impl_from_DEVICE_OBJECT
(
device
);
return
build_report_descriptor
(
ext
,
ext
->
base
.
udev_device
);
}
static
NTSTATUS
lnxev_get_reportdescriptor
(
DEVICE_OBJECT
*
device
,
BYTE
*
buffer
,
DWORD
length
,
DWORD
*
out_length
)
...
...
@@ -1148,20 +1149,6 @@ static void try_add_device(struct udev_device *dev)
struct
platform_private
*
private
=
impl_from_DEVICE_OBJECT
(
device
);
private
->
udev_device
=
udev_device_ref
(
dev
);
private
->
device_fd
=
fd
;
#ifdef HAS_PROPER_INPUT_HEADER
if
(
strcmp
(
subsystem
,
"input"
)
==
0
)
/* FIXME: We should probably move this to IRP_MN_START_DEVICE. */
if
(
build_report_descriptor
((
struct
wine_input_private
*
)
private
,
dev
))
{
ERR
(
"Building report descriptor failed, removing device
\n
"
);
close
(
fd
);
udev_device_unref
(
dev
);
bus_unlink_hid_device
(
device
);
bus_remove_hid_device
(
device
);
HeapFree
(
GetProcessHeap
(),
0
,
serial
);
return
;
}
#endif
IoInvalidateDeviceRelations
(
bus_pdo
,
BusRelations
);
}
else
...
...
dlls/winebus.sys/main.c
View file @
620b514a
...
...
@@ -488,6 +488,13 @@ static void mouse_free_device(DEVICE_OBJECT *device)
static
NTSTATUS
mouse_start_device
(
DEVICE_OBJECT
*
device
)
{
if
(
!
hid_descriptor_begin
(
&
mouse_desc
,
HID_USAGE_PAGE_GENERIC
,
HID_USAGE_GENERIC_MOUSE
))
return
STATUS_NO_MEMORY
;
if
(
!
hid_descriptor_add_buttons
(
&
mouse_desc
,
HID_USAGE_PAGE_BUTTON
,
1
,
3
))
return
STATUS_NO_MEMORY
;
if
(
!
hid_descriptor_end
(
&
mouse_desc
))
return
STATUS_NO_MEMORY
;
return
STATUS_SUCCESS
;
}
...
...
@@ -551,14 +558,6 @@ static const platform_vtbl mouse_vtbl =
static
void
mouse_device_create
(
void
)
{
static
const
WCHAR
busidW
[]
=
{
'W'
,
'I'
,
'N'
,
'E'
,
'M'
,
'O'
,
'U'
,
'S'
,
'E'
,
0
};
if
(
!
hid_descriptor_begin
(
&
mouse_desc
,
HID_USAGE_PAGE_GENERIC
,
HID_USAGE_GENERIC_MOUSE
))
return
;
if
(
!
hid_descriptor_add_buttons
(
&
mouse_desc
,
HID_USAGE_PAGE_BUTTON
,
1
,
3
))
return
;
if
(
!
hid_descriptor_end
(
&
mouse_desc
))
return
;
mouse_obj
=
bus_create_hid_device
(
busidW
,
0
,
0
,
-
1
,
0
,
0
,
busidW
,
FALSE
,
&
mouse_vtbl
,
0
);
IoInvalidateDeviceRelations
(
bus_pdo
,
BusRelations
);
}
...
...
@@ -569,6 +568,13 @@ static void keyboard_free_device(DEVICE_OBJECT *device)
static
NTSTATUS
keyboard_start_device
(
DEVICE_OBJECT
*
device
)
{
if
(
!
hid_descriptor_begin
(
&
keyboard_desc
,
HID_USAGE_PAGE_GENERIC
,
HID_USAGE_GENERIC_KEYBOARD
))
return
STATUS_NO_MEMORY
;
if
(
!
hid_descriptor_add_buttons
(
&
keyboard_desc
,
HID_USAGE_PAGE_KEYBOARD
,
0
,
101
))
return
STATUS_NO_MEMORY
;
if
(
!
hid_descriptor_end
(
&
keyboard_desc
))
return
STATUS_NO_MEMORY
;
return
STATUS_SUCCESS
;
}
...
...
@@ -632,14 +638,6 @@ static const platform_vtbl keyboard_vtbl =
static
void
keyboard_device_create
(
void
)
{
static
const
WCHAR
busidW
[]
=
{
'W'
,
'I'
,
'N'
,
'E'
,
'K'
,
'E'
,
'Y'
,
'B'
,
'O'
,
'A'
,
'R'
,
'D'
,
0
};
if
(
!
hid_descriptor_begin
(
&
keyboard_desc
,
HID_USAGE_PAGE_GENERIC
,
HID_USAGE_GENERIC_KEYBOARD
))
return
;
if
(
!
hid_descriptor_add_buttons
(
&
keyboard_desc
,
HID_USAGE_PAGE_KEYBOARD
,
0
,
101
))
return
;
if
(
!
hid_descriptor_end
(
&
keyboard_desc
))
return
;
keyboard_obj
=
bus_create_hid_device
(
busidW
,
0
,
0
,
-
1
,
0
,
0
,
busidW
,
FALSE
,
&
keyboard_vtbl
,
0
);
IoInvalidateDeviceRelations
(
bus_pdo
,
BusRelations
);
}
...
...
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