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
05fe2f3f
Commit
05fe2f3f
authored
Jul 05, 2022
by
Zebediah Figura
Committed by
Alexandre Julliard
Jul 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineusb.sys: Move the libusb_init() and libusb_exit() calls to the Unix library.
parent
03034f2c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
unixlib.c
dlls/wineusb.sys/unixlib.c
+9
-0
wineusb.c
dlls/wineusb.sys/wineusb.c
+0
-8
No files found.
dlls/wineusb.sys/unixlib.c
View file @
05fe2f3f
...
...
@@ -173,12 +173,19 @@ static NTSTATUS usb_main_loop(void *args)
TRACE
(
"Starting libusb event thread.
\n
"
);
if
((
ret
=
libusb_init
(
NULL
)))
{
ERR
(
"Failed to initialize libusb: %s
\n
"
,
libusb_strerror
(
ret
));
return
STATUS_UNSUCCESSFUL
;
}
if
((
ret
=
libusb_hotplug_register_callback
(
NULL
,
LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED
|
LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT
,
LIBUSB_HOTPLUG_ENUMERATE
,
LIBUSB_HOTPLUG_MATCH_ANY
,
LIBUSB_HOTPLUG_MATCH_ANY
,
LIBUSB_HOTPLUG_MATCH_ANY
,
hotplug_cb
,
NULL
,
&
hotplug_cb_handle
)))
{
ERR
(
"Failed to register callback: %s
\n
"
,
libusb_strerror
(
ret
));
libusb_exit
(
NULL
);
return
STATUS_UNSUCCESSFUL
;
}
...
...
@@ -188,6 +195,8 @@ static NTSTATUS usb_main_loop(void *args)
ERR
(
"Error handling events: %s
\n
"
,
libusb_strerror
(
ret
));
}
libusb_exit
(
NULL
);
queue_event
(
&
shutdown_event
);
TRACE
(
"Shutting down libusb event thread.
\n
"
);
...
...
dlls/wineusb.sys/wineusb.c
View file @
05fe2f3f
...
...
@@ -731,14 +731,12 @@ static NTSTATUS WINAPI driver_add_device(DRIVER_OBJECT *driver, DEVICE_OBJECT *p
static
void
WINAPI
driver_unload
(
DRIVER_OBJECT
*
driver
)
{
libusb_exit
(
NULL
);
}
NTSTATUS
WINAPI
DriverEntry
(
DRIVER_OBJECT
*
driver
,
UNICODE_STRING
*
path
)
{
NTSTATUS
status
;
void
*
instance
;
int
err
;
TRACE
(
"driver %p, path %s.
\n
"
,
driver
,
debugstr_w
(
path
->
Buffer
));
...
...
@@ -752,12 +750,6 @@ NTSTATUS WINAPI DriverEntry(DRIVER_OBJECT *driver, UNICODE_STRING *path)
driver_obj
=
driver
;
if
((
err
=
libusb_init
(
NULL
)))
{
ERR
(
"Failed to initialize libusb: %s
\n
"
,
libusb_strerror
(
err
));
return
STATUS_UNSUCCESSFUL
;
}
driver
->
DriverExtension
->
AddDevice
=
driver_add_device
;
driver
->
DriverUnload
=
driver_unload
;
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