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
4b343790
Commit
4b343790
authored
Sep 17, 2019
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 17, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebus.sys: Stop device report threads to avoid crash on driver unload.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
90fa9967
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
bus_udev.c
dlls/winebus.sys/bus_udev.c
+9
-0
main.c
dlls/winebus.sys/main.c
+7
-3
No files found.
dlls/winebus.sys/bus_udev.c
View file @
4b343790
...
@@ -1478,6 +1478,12 @@ static DWORD CALLBACK deviceloop_thread(void *args)
...
@@ -1478,6 +1478,12 @@ static DWORD CALLBACK deviceloop_thread(void *args)
return
0
;
return
0
;
}
}
static
int
device_unload
(
DEVICE_OBJECT
*
device
,
void
*
context
)
{
try_remove_device
(
impl_from_DEVICE_OBJECT
(
device
)
->
udev_device
);
return
1
;
}
void
udev_driver_unload
(
void
)
void
udev_driver_unload
(
void
)
{
{
TRACE
(
"Unload Driver
\n
"
);
TRACE
(
"Unload Driver
\n
"
);
...
@@ -1487,6 +1493,9 @@ void udev_driver_unload( void )
...
@@ -1487,6 +1493,9 @@ void udev_driver_unload( void )
close
(
deviceloop_control
[
0
]);
close
(
deviceloop_control
[
0
]);
close
(
deviceloop_control
[
1
]);
close
(
deviceloop_control
[
1
]);
CloseHandle
(
deviceloop_handle
);
CloseHandle
(
deviceloop_handle
);
bus_enumerate_hid_devices
(
&
hidraw_vtbl
,
device_unload
,
NULL
);
bus_enumerate_hid_devices
(
&
lnxev_vtbl
,
device_unload
,
NULL
);
}
}
NTSTATUS
udev_driver_init
(
void
)
NTSTATUS
udev_driver_init
(
void
)
...
...
dlls/winebus.sys/main.c
View file @
4b343790
...
@@ -329,17 +329,21 @@ DEVICE_OBJECT *bus_find_hid_device(const platform_vtbl *vtbl, void *platform_dev
...
@@ -329,17 +329,21 @@ DEVICE_OBJECT *bus_find_hid_device(const platform_vtbl *vtbl, void *platform_dev
DEVICE_OBJECT
*
bus_enumerate_hid_devices
(
const
platform_vtbl
*
vtbl
,
enum_func
function
,
void
*
context
)
DEVICE_OBJECT
*
bus_enumerate_hid_devices
(
const
platform_vtbl
*
vtbl
,
enum_func
function
,
void
*
context
)
{
{
struct
pnp_device
*
dev
;
struct
pnp_device
*
dev
,
*
dev_next
;
DEVICE_OBJECT
*
ret
=
NULL
;
DEVICE_OBJECT
*
ret
=
NULL
;
int
cont
;
TRACE
(
"(%p)
\n
"
,
vtbl
);
TRACE
(
"(%p)
\n
"
,
vtbl
);
EnterCriticalSection
(
&
device_list_cs
);
EnterCriticalSection
(
&
device_list_cs
);
LIST_FOR_EACH_ENTRY
(
dev
,
&
pnp_devset
,
struct
pnp_device
,
entry
)
LIST_FOR_EACH_ENTRY
_SAFE
(
dev
,
dev_next
,
&
pnp_devset
,
struct
pnp_device
,
entry
)
{
{
struct
device_extension
*
ext
=
(
struct
device_extension
*
)
dev
->
device
->
DeviceExtension
;
struct
device_extension
*
ext
=
(
struct
device_extension
*
)
dev
->
device
->
DeviceExtension
;
if
(
ext
->
vtbl
!=
vtbl
)
continue
;
if
(
ext
->
vtbl
!=
vtbl
)
continue
;
if
(
function
(
dev
->
device
,
context
)
==
0
)
LeaveCriticalSection
(
&
device_list_cs
);
cont
=
function
(
dev
->
device
,
context
);
EnterCriticalSection
(
&
device_list_cs
);
if
(
!
cont
)
{
{
ret
=
dev
->
device
;
ret
=
dev
->
device
;
break
;
break
;
...
...
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