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
d4bb82af
Commit
d4bb82af
authored
May 25, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineusb.sys: Complete IRPs through the event thread.
parent
f8e5e72a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
6 deletions
+20
-6
wineusb.c
dlls/wineusb.sys/wineusb.c
+20
-6
No files found.
dlls/wineusb.sys/wineusb.c
View file @
d4bb82af
...
...
@@ -115,6 +115,7 @@ enum usb_event_type
{
USB_EVENT_ADD_DEVICE
,
USB_EVENT_REMOVE_DEVICE
,
USB_EVENT_TRANSFER_COMPLETE
,
USB_EVENT_SHUTDOWN
,
};
...
...
@@ -126,6 +127,7 @@ struct usb_event
{
struct
unix_device
*
added_device
;
struct
unix_device
*
removed_device
;
IRP
*
completed_irp
;
}
u
;
};
...
...
@@ -407,6 +409,16 @@ static DWORD CALLBACK libusb_event_thread_proc(void *arg)
return
0
;
}
static
void
complete_irp
(
IRP
*
irp
)
{
EnterCriticalSection
(
&
wineusb_cs
);
RemoveEntryList
(
&
irp
->
Tail
.
Overlay
.
ListEntry
);
LeaveCriticalSection
(
&
wineusb_cs
);
irp
->
IoStatus
.
Status
=
STATUS_SUCCESS
;
IoCompleteRequest
(
irp
,
IO_NO_INCREMENT
);
}
static
DWORD
CALLBACK
event_thread_proc
(
void
*
arg
)
{
struct
usb_event
event
;
...
...
@@ -427,6 +439,10 @@ static DWORD CALLBACK event_thread_proc(void *arg)
remove_unix_device
(
event
.
u
.
removed_device
);
break
;
case
USB_EVENT_TRANSFER_COMPLETE
:
complete_irp
(
event
.
u
.
completed_irp
);
break
;
case
USB_EVENT_SHUTDOWN
:
TRACE
(
"Shutting down client event thread.
\n
"
);
return
0
;
...
...
@@ -772,6 +788,7 @@ static void LIBUSB_CALL transfer_cb(struct libusb_transfer *transfer)
{
IRP
*
irp
=
transfer
->
user_data
;
URB
*
urb
=
IoGetCurrentIrpStackLocation
(
irp
)
->
Parameters
.
Others
.
Argument1
;
struct
usb_event
event
;
TRACE
(
"Completing IRP %p, status %#x.
\n
"
,
irp
,
transfer
->
status
);
...
...
@@ -807,12 +824,9 @@ static void LIBUSB_CALL transfer_cb(struct libusb_transfer *transfer)
}
}
EnterCriticalSection
(
&
wineusb_cs
);
RemoveEntryList
(
&
irp
->
Tail
.
Overlay
.
ListEntry
);
LeaveCriticalSection
(
&
wineusb_cs
);
irp
->
IoStatus
.
Status
=
STATUS_SUCCESS
;
IoCompleteRequest
(
irp
,
IO_NO_INCREMENT
);
event
.
type
=
USB_EVENT_TRANSFER_COMPLETE
;
event
.
u
.
completed_irp
=
irp
;
queue_event
(
&
event
);
}
static
void
queue_irp
(
struct
usb_device
*
device
,
IRP
*
irp
,
struct
libusb_transfer
*
transfer
)
...
...
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