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
8599b204
Commit
8599b204
authored
May 11, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineusb.sys: Cache members of the device descriptor in the usb_device structure.
These are already cached by libusb, but for convenience we want to cache them on the PE side.
parent
e61498c0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
9 deletions
+12
-9
wineusb.c
dlls/wineusb.sys/wineusb.c
+12
-9
No files found.
dlls/wineusb.sys/wineusb.c
View file @
8599b204
...
@@ -84,6 +84,8 @@ struct usb_device
...
@@ -84,6 +84,8 @@ struct usb_device
uint8_t
class
,
subclass
,
protocol
;
uint8_t
class
,
subclass
,
protocol
;
uint16_t
vendor
,
product
,
revision
;
libusb_device
*
libusb_device
;
libusb_device
*
libusb_device
;
libusb_device_handle
*
handle
;
libusb_device_handle
*
handle
;
...
@@ -117,6 +119,9 @@ static void add_usb_interface(struct usb_device *parent, const struct libusb_int
...
@@ -117,6 +119,9 @@ static void add_usb_interface(struct usb_device *parent, const struct libusb_int
device
->
class
=
desc
->
bInterfaceClass
;
device
->
class
=
desc
->
bInterfaceClass
;
device
->
subclass
=
desc
->
bInterfaceSubClass
;
device
->
subclass
=
desc
->
bInterfaceSubClass
;
device
->
protocol
=
desc
->
bInterfaceProtocol
;
device
->
protocol
=
desc
->
bInterfaceProtocol
;
device
->
vendor
=
parent
->
vendor
;
device
->
product
=
parent
->
product
;
device
->
revision
=
parent
->
revision
;
InitializeListHead
(
&
device
->
irp_list
);
InitializeListHead
(
&
device
->
irp_list
);
EnterCriticalSection
(
&
wineusb_cs
);
EnterCriticalSection
(
&
wineusb_cs
);
...
@@ -173,6 +178,9 @@ static void add_usb_device(libusb_device *libusb_device)
...
@@ -173,6 +178,9 @@ static void add_usb_device(libusb_device *libusb_device)
device
->
class
=
device_desc
.
bDeviceClass
;
device
->
class
=
device_desc
.
bDeviceClass
;
device
->
subclass
=
device_desc
.
bDeviceSubClass
;
device
->
subclass
=
device_desc
.
bDeviceSubClass
;
device
->
protocol
=
device_desc
.
bDeviceProtocol
;
device
->
protocol
=
device_desc
.
bDeviceProtocol
;
device
->
vendor
=
device_desc
.
idVendor
;
device
->
product
=
device_desc
.
idProduct
;
device
->
revision
=
device_desc
.
bcdDevice
;
if
(
!
(
ret
=
libusb_get_active_config_descriptor
(
libusb_device
,
&
config_desc
)))
if
(
!
(
ret
=
libusb_get_active_config_descriptor
(
libusb_device
,
&
config_desc
)))
{
{
...
@@ -423,13 +431,11 @@ static void get_device_id(const struct usb_device *device, struct string_buffer
...
@@ -423,13 +431,11 @@ static void get_device_id(const struct usb_device *device, struct string_buffer
'&'
,
'P'
,
'I'
,
'D'
,
'_'
,
'%'
,
'0'
,
'4'
,
'X'
,
'&'
,
'M'
,
'I'
,
'_'
,
'%'
,
'0'
,
'2'
,
'X'
,
0
};
'&'
,
'P'
,
'I'
,
'D'
,
'_'
,
'%'
,
'0'
,
'4'
,
'X'
,
'&'
,
'M'
,
'I'
,
'_'
,
'%'
,
'0'
,
'2'
,
'X'
,
0
};
static
const
WCHAR
formatW
[]
=
{
'U'
,
'S'
,
'B'
,
'\\'
,
'V'
,
'I'
,
'D'
,
'_'
,
'%'
,
'0'
,
'4'
,
'X'
,
static
const
WCHAR
formatW
[]
=
{
'U'
,
'S'
,
'B'
,
'\\'
,
'V'
,
'I'
,
'D'
,
'_'
,
'%'
,
'0'
,
'4'
,
'X'
,
'&'
,
'P'
,
'I'
,
'D'
,
'_'
,
'%'
,
'0'
,
'4'
,
'X'
,
0
};
'&'
,
'P'
,
'I'
,
'D'
,
'_'
,
'%'
,
'0'
,
'4'
,
'X'
,
0
};
struct
libusb_device_descriptor
desc
;
libusb_get_device_descriptor
(
device
->
libusb_device
,
&
desc
);
if
(
device
->
parent
)
if
(
device
->
parent
)
append_id
(
buffer
,
interface_formatW
,
de
sc
.
idVendor
,
desc
.
idP
roduct
,
device
->
interface_index
);
append_id
(
buffer
,
interface_formatW
,
de
vice
->
vendor
,
device
->
p
roduct
,
device
->
interface_index
);
else
else
append_id
(
buffer
,
formatW
,
de
sc
.
idVendor
,
desc
.
idP
roduct
);
append_id
(
buffer
,
formatW
,
de
vice
->
vendor
,
device
->
p
roduct
);
}
}
static
void
get_hardware_ids
(
const
struct
usb_device
*
device
,
struct
string_buffer
*
buffer
)
static
void
get_hardware_ids
(
const
struct
usb_device
*
device
,
struct
string_buffer
*
buffer
)
...
@@ -438,14 +444,11 @@ static void get_hardware_ids(const struct usb_device *device, struct string_buff
...
@@ -438,14 +444,11 @@ static void get_hardware_ids(const struct usb_device *device, struct string_buff
'&'
,
'P'
,
'I'
,
'D'
,
'_'
,
'%'
,
'0'
,
'4'
,
'X'
,
'&'
,
'R'
,
'E'
,
'V'
,
'_'
,
'%'
,
'0'
,
'4'
,
'X'
,
'&'
,
'M'
,
'I'
,
'_'
,
'%'
,
'0'
,
'2'
,
'X'
,
0
};
'&'
,
'P'
,
'I'
,
'D'
,
'_'
,
'%'
,
'0'
,
'4'
,
'X'
,
'&'
,
'R'
,
'E'
,
'V'
,
'_'
,
'%'
,
'0'
,
'4'
,
'X'
,
'&'
,
'M'
,
'I'
,
'_'
,
'%'
,
'0'
,
'2'
,
'X'
,
0
};
static
const
WCHAR
formatW
[]
=
{
'U'
,
'S'
,
'B'
,
'\\'
,
'V'
,
'I'
,
'D'
,
'_'
,
'%'
,
'0'
,
'4'
,
'X'
,
static
const
WCHAR
formatW
[]
=
{
'U'
,
'S'
,
'B'
,
'\\'
,
'V'
,
'I'
,
'D'
,
'_'
,
'%'
,
'0'
,
'4'
,
'X'
,
'&'
,
'P'
,
'I'
,
'D'
,
'_'
,
'%'
,
'0'
,
'4'
,
'X'
,
'&'
,
'R'
,
'E'
,
'V'
,
'_'
,
'%'
,
'0'
,
'4'
,
'X'
,
0
};
'&'
,
'P'
,
'I'
,
'D'
,
'_'
,
'%'
,
'0'
,
'4'
,
'X'
,
'&'
,
'R'
,
'E'
,
'V'
,
'_'
,
'%'
,
'0'
,
'4'
,
'X'
,
0
};
struct
libusb_device_descriptor
desc
;
libusb_get_device_descriptor
(
device
->
libusb_device
,
&
desc
);
if
(
device
->
parent
)
if
(
device
->
parent
)
append_id
(
buffer
,
interface_formatW
,
de
sc
.
idVendor
,
desc
.
idProduct
,
desc
.
bcdDevice
,
device
->
interface_index
);
append_id
(
buffer
,
interface_formatW
,
de
vice
->
vendor
,
device
->
product
,
device
->
revision
,
device
->
interface_index
);
else
else
append_id
(
buffer
,
formatW
,
de
sc
.
idVendor
,
desc
.
idProduct
,
desc
.
bcdDevice
);
append_id
(
buffer
,
formatW
,
de
vice
->
vendor
,
device
->
product
,
device
->
revision
);
get_device_id
(
device
,
buffer
);
get_device_id
(
device
,
buffer
);
append_id
(
buffer
,
emptyW
);
append_id
(
buffer
,
emptyW
);
}
}
...
...
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