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
0b02f2e9
Commit
0b02f2e9
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: Do not store a reference to the libusb device in the usb_device structure.
Retrieve it from the handle if necessary. For simplicity.
parent
8599b204
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
10 deletions
+1
-10
wineusb.c
dlls/wineusb.sys/wineusb.c
+1
-10
No files found.
dlls/wineusb.sys/wineusb.c
View file @
0b02f2e9
...
...
@@ -86,7 +86,6 @@ struct usb_device
uint16_t
vendor
,
product
,
revision
;
libusb_device
*
libusb_device
;
libusb_device_handle
*
handle
;
LIST_ENTRY
irp_list
;
...
...
@@ -114,7 +113,6 @@ static void add_usb_interface(struct usb_device *parent, const struct libusb_int
device
->
device_obj
=
device_obj
;
device
->
parent
=
parent
;
device
->
handle
=
parent
->
handle
;
device
->
libusb_device
=
parent
->
libusb_device
;
device
->
interface_index
=
desc
->
bInterfaceNumber
;
device
->
class
=
desc
->
bInterfaceClass
;
device
->
subclass
=
desc
->
bInterfaceSubClass
;
...
...
@@ -166,7 +164,6 @@ static void add_usb_device(libusb_device *libusb_device)
device
=
device_obj
->
DeviceExtension
;
device
->
device_obj
=
device_obj
;
device
->
libusb_device
=
libusb_ref_device
(
libusb_device
);
device
->
handle
=
handle
;
InitializeListHead
(
&
device
->
irp_list
);
...
...
@@ -227,7 +224,7 @@ static void remove_usb_device(libusb_device *libusb_device)
EnterCriticalSection
(
&
wineusb_cs
);
LIST_FOR_EACH_ENTRY
(
device
,
&
device_list
,
struct
usb_device
,
entry
)
{
if
(
device
->
libusb_device
==
libusb_device
)
if
(
libusb_get_device
(
device
->
handle
)
==
libusb_device
)
{
if
(
!
device
->
removed
)
{
...
...
@@ -364,10 +361,7 @@ static NTSTATUS fdo_pnp(IRP *irp)
{
assert
(
!
device
->
removed
);
if
(
!
device
->
parent
)
{
libusb_unref_device
(
device
->
libusb_device
);
libusb_close
(
device
->
handle
);
}
list_remove
(
&
device
->
entry
);
IoDeleteDevice
(
device
->
device_obj
);
}
...
...
@@ -564,10 +558,7 @@ static NTSTATUS pdo_pnp(DEVICE_OBJECT *device_obj, IRP *irp)
remove_pending_irps
(
device
);
if
(
!
device
->
parent
)
{
libusb_unref_device
(
device
->
libusb_device
);
libusb_close
(
device
->
handle
);
}
IoDeleteDevice
(
device
->
device_obj
);
ret
=
STATUS_SUCCESS
;
...
...
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