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
eb8cb9e0
Commit
eb8cb9e0
authored
Apr 15, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineusb.sys: Start an event handler thread.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ff9645b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
wineusb.c
dlls/wineusb.sys/wineusb.c
+26
-0
No files found.
dlls/wineusb.sys/wineusb.c
View file @
eb8cb9e0
...
@@ -40,6 +40,25 @@ WINE_DEFAULT_DEBUG_CHANNEL(wineusb);
...
@@ -40,6 +40,25 @@ WINE_DEFAULT_DEBUG_CHANNEL(wineusb);
static
DEVICE_OBJECT
*
bus_fdo
,
*
bus_pdo
;
static
DEVICE_OBJECT
*
bus_fdo
,
*
bus_pdo
;
static
BOOL
thread_shutdown
;
static
HANDLE
event_thread
;
static
DWORD
CALLBACK
event_thread_proc
(
void
*
arg
)
{
int
ret
;
TRACE
(
"Starting event thread.
\n
"
);
while
(
!
thread_shutdown
)
{
if
((
ret
=
libusb_handle_events
(
NULL
)))
ERR
(
"Error handling events: %s
\n
"
,
libusb_strerror
(
ret
));
}
TRACE
(
"Shutting down event thread.
\n
"
);
return
0
;
}
static
NTSTATUS
fdo_pnp
(
IRP
*
irp
)
static
NTSTATUS
fdo_pnp
(
IRP
*
irp
)
{
{
IO_STACK_LOCATION
*
stack
=
IoGetCurrentIrpStackLocation
(
irp
);
IO_STACK_LOCATION
*
stack
=
IoGetCurrentIrpStackLocation
(
irp
);
...
@@ -55,6 +74,11 @@ static NTSTATUS fdo_pnp(IRP *irp)
...
@@ -55,6 +74,11 @@ static NTSTATUS fdo_pnp(IRP *irp)
break
;
break
;
case
IRP_MN_REMOVE_DEVICE
:
case
IRP_MN_REMOVE_DEVICE
:
thread_shutdown
=
TRUE
;
libusb_interrupt_event_handler
(
NULL
);
WaitForSingleObject
(
event_thread
,
INFINITE
);
CloseHandle
(
event_thread
);
irp
->
IoStatus
.
Status
=
STATUS_SUCCESS
;
irp
->
IoStatus
.
Status
=
STATUS_SUCCESS
;
IoSkipCurrentIrpStackLocation
(
irp
);
IoSkipCurrentIrpStackLocation
(
irp
);
ret
=
IoCallDriver
(
bus_pdo
,
irp
);
ret
=
IoCallDriver
(
bus_pdo
,
irp
);
...
@@ -111,6 +135,8 @@ NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, UNICODE_STRING *path)
...
@@ -111,6 +135,8 @@ NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, UNICODE_STRING *path)
return
STATUS_UNSUCCESSFUL
;
return
STATUS_UNSUCCESSFUL
;
}
}
event_thread
=
CreateThread
(
NULL
,
0
,
event_thread_proc
,
NULL
,
0
,
NULL
);
driver
->
DriverExtension
->
AddDevice
=
driver_add_device
;
driver
->
DriverExtension
->
AddDevice
=
driver_add_device
;
driver
->
DriverUnload
=
driver_unload
;
driver
->
DriverUnload
=
driver_unload
;
driver
->
MajorFunction
[
IRP_MJ_PNP
]
=
driver_pnp
;
driver
->
MajorFunction
[
IRP_MJ_PNP
]
=
driver_pnp
;
...
...
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