Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c698dc6e
Commit
c698dc6e
authored
May 25, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineusb.sys: Pass the device descriptor as part of the event data.
parent
05fe2f3f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
17 deletions
+25
-17
unixlib.c
dlls/wineusb.sys/unixlib.c
+7
-1
unixlib.h
dlls/wineusb.sys/unixlib.h
+6
-1
wineusb.c
dlls/wineusb.sys/wineusb.c
+12
-15
No files found.
dlls/wineusb.sys/unixlib.c
View file @
c698dc6e
...
...
@@ -133,7 +133,13 @@ static void add_usb_device(libusb_device *libusb_device)
pthread_mutex_unlock
(
&
device_mutex
);
usb_event
.
type
=
USB_EVENT_ADD_DEVICE
;
usb_event
.
u
.
added_device
=
unix_device
;
usb_event
.
u
.
added_device
.
device
=
unix_device
;
usb_event
.
u
.
added_device
.
vendor
=
device_desc
.
idVendor
;
usb_event
.
u
.
added_device
.
product
=
device_desc
.
idProduct
;
usb_event
.
u
.
added_device
.
revision
=
device_desc
.
bcdDevice
;
usb_event
.
u
.
added_device
.
class
=
device_desc
.
bDeviceClass
;
usb_event
.
u
.
added_device
.
subclass
=
device_desc
.
bDeviceSubClass
;
usb_event
.
u
.
added_device
.
protocol
=
device_desc
.
bDeviceProtocol
;
queue_event
(
&
usb_event
);
}
...
...
dlls/wineusb.sys/unixlib.h
View file @
c698dc6e
...
...
@@ -47,7 +47,12 @@ struct usb_event
union
{
struct
unix_device
*
added_device
;
struct
usb_add_device_event
{
struct
unix_device
*
device
;
UINT16
vendor
,
product
,
revision
;
UINT8
class
,
subclass
,
protocol
;
}
added_device
;
struct
unix_device
*
removed_device
;
IRP
*
completed_irp
;
}
u
;
...
...
dlls/wineusb.sys/wineusb.c
View file @
c698dc6e
...
...
@@ -137,12 +137,11 @@ static void add_usb_interface(struct usb_device *parent, const struct libusb_int
LeaveCriticalSection
(
&
wineusb_cs
);
}
static
void
add_unix_device
(
struct
unix_device
*
unix_device
)
static
void
add_unix_device
(
const
struct
usb_add_device_event
*
event
)
{
static
const
WCHAR
formatW
[]
=
{
'\\'
,
'D'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
'\\'
,
'U'
,
'S'
,
'B'
,
'P'
,
'D'
,
'O'
,
'-'
,
'%'
,
'u'
,
0
};
libusb_device
*
libusb_device
=
libusb_get_device
(
unix_
device
->
handle
);
libusb_device
*
libusb_device
=
libusb_get_device
(
event
->
device
->
handle
);
struct
libusb_config_descriptor
*
config_desc
;
struct
libusb_device_descriptor
device_desc
;
static
unsigned
int
name_index
;
struct
usb_device
*
device
;
DEVICE_OBJECT
*
device_obj
;
...
...
@@ -151,10 +150,8 @@ static void add_unix_device(struct unix_device *unix_device)
WCHAR
name
[
26
];
int
ret
;
libusb_get_device_descriptor
(
libusb_device
,
&
device_desc
);
TRACE
(
"Adding new device %p, vendor %04x, product %04x.
\n
"
,
unix_device
,
device_desc
.
idVendor
,
device_desc
.
idProduct
);
TRACE
(
"Adding new device %p, vendor %04x, product %04x.
\n
"
,
event
->
device
,
event
->
vendor
,
event
->
product
);
sprintfW
(
name
,
formatW
,
name_index
++
);
RtlInitUnicodeString
(
&
string
,
name
);
...
...
@@ -167,16 +164,16 @@ static void add_unix_device(struct unix_device *unix_device)
device
=
device_obj
->
DeviceExtension
;
device
->
device_obj
=
device_obj
;
device
->
unix_device
=
unix_
device
;
device
->
unix_device
=
event
->
device
;
InitializeListHead
(
&
device
->
irp_list
);
device
->
removed
=
FALSE
;
device
->
class
=
device_desc
.
bDeviceC
lass
;
device
->
subclass
=
device_desc
.
bDeviceSubC
lass
;
device
->
protocol
=
device_desc
.
bDeviceP
rotocol
;
device
->
vendor
=
device_desc
.
idV
endor
;
device
->
product
=
device_desc
.
idP
roduct
;
device
->
revision
=
device_desc
.
bcdDevice
;
device
->
class
=
event
->
c
lass
;
device
->
subclass
=
event
->
subc
lass
;
device
->
protocol
=
event
->
p
rotocol
;
device
->
vendor
=
event
->
v
endor
;
device
->
product
=
event
->
p
roduct
;
device
->
revision
=
event
->
revision
;
EnterCriticalSection
(
&
wineusb_cs
);
list_add_tail
(
&
device_list
,
&
device
->
entry
);
...
...
@@ -279,7 +276,7 @@ static DWORD CALLBACK event_thread_proc(void *arg)
switch
(
event
.
type
)
{
case
USB_EVENT_ADD_DEVICE
:
add_unix_device
(
event
.
u
.
added_device
);
add_unix_device
(
&
event
.
u
.
added_device
);
break
;
case
USB_EVENT_REMOVE_DEVICE
:
...
...
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