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
c3bfc1b7
Commit
c3bfc1b7
authored
Nov 12, 2019
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebus: Fix DEVICE_RELATIONS content on device removal.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cc395391
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
4 deletions
+16
-4
bus.h
dlls/winebus.sys/bus.h
+1
-0
bus_iohid.c
dlls/winebus.sys/bus_iohid.c
+1
-0
bus_sdl.c
dlls/winebus.sys/bus_sdl.c
+2
-0
bus_udev.c
dlls/winebus.sys/bus_udev.c
+2
-0
main.c
dlls/winebus.sys/main.c
+10
-4
No files found.
dlls/winebus.sys/bus.h
View file @
c3bfc1b7
...
...
@@ -45,6 +45,7 @@ DEVICE_OBJECT *bus_create_hid_device(const WCHAR *busidW, WORD vid, WORD pid,
WORD
input
,
DWORD
version
,
DWORD
uid
,
const
WCHAR
*
serialW
,
BOOL
is_gamepad
,
const
platform_vtbl
*
vtbl
,
DWORD
platform_data_size
)
DECLSPEC_HIDDEN
;
DEVICE_OBJECT
*
bus_find_hid_device
(
const
platform_vtbl
*
vtbl
,
void
*
platform_dev
)
DECLSPEC_HIDDEN
;
void
bus_unlink_hid_device
(
DEVICE_OBJECT
*
device
)
DECLSPEC_HIDDEN
;
void
bus_remove_hid_device
(
DEVICE_OBJECT
*
device
)
DECLSPEC_HIDDEN
;
void
process_hid_report
(
DEVICE_OBJECT
*
device
,
BYTE
*
report
,
DWORD
length
)
DECLSPEC_HIDDEN
;
DEVICE_OBJECT
*
bus_enumerate_hid_devices
(
const
platform_vtbl
*
vtbl
,
enum_func
function
,
void
*
context
)
DECLSPEC_HIDDEN
;
...
...
dlls/winebus.sys/bus_iohid.c
View file @
c3bfc1b7
...
...
@@ -368,6 +368,7 @@ static void handle_RemovalCallback(void *context, IOReturn result, void *sender,
device
=
bus_find_hid_device
(
&
iohid_vtbl
,
IOHIDDevice
);
if
(
device
)
{
bus_unlink_hid_device
(
device
);
IoInvalidateDeviceRelations
(
bus_pdo
,
BusRelations
);
bus_remove_hid_device
(
device
);
}
...
...
dlls/winebus.sys/bus_sdl.c
View file @
c3bfc1b7
...
...
@@ -899,6 +899,7 @@ static void try_remove_device(SDL_JoystickID id)
sdl_controller
=
private
->
sdl_controller
;
sdl_haptic
=
private
->
sdl_haptic
;
bus_unlink_hid_device
(
device
);
IoInvalidateDeviceRelations
(
bus_pdo
,
BusRelations
);
bus_remove_hid_device
(
device
);
...
...
@@ -988,6 +989,7 @@ static void try_add_device(unsigned int index)
if
(
!
rc
)
{
ERR
(
"Building report descriptor failed, removing device
\n
"
);
bus_unlink_hid_device
(
device
);
bus_remove_hid_device
(
device
);
HeapFree
(
GetProcessHeap
(),
0
,
serial
);
return
;
...
...
dlls/winebus.sys/bus_udev.c
View file @
c3bfc1b7
...
...
@@ -1259,6 +1259,7 @@ static void try_add_device(struct udev_device *dev)
ERR
(
"Building report descriptor failed, removing device
\n
"
);
close
(
fd
);
udev_device_unref
(
dev
);
bus_unlink_hid_device
(
device
);
bus_remove_hid_device
(
device
);
HeapFree
(
GetProcessHeap
(),
0
,
serial
);
return
;
...
...
@@ -1293,6 +1294,7 @@ static void try_remove_device(struct udev_device *dev)
#endif
if
(
!
device
)
return
;
bus_unlink_hid_device
(
device
);
IoInvalidateDeviceRelations
(
bus_pdo
,
BusRelations
);
private
=
impl_from_DEVICE_OBJECT
(
device
);
...
...
dlls/winebus.sys/main.c
View file @
c3bfc1b7
...
...
@@ -346,6 +346,16 @@ DEVICE_OBJECT* bus_enumerate_hid_devices(const platform_vtbl *vtbl, enum_func fu
return
ret
;
}
void
bus_unlink_hid_device
(
DEVICE_OBJECT
*
device
)
{
struct
device_extension
*
ext
=
(
struct
device_extension
*
)
device
->
DeviceExtension
;
struct
pnp_device
*
pnp_device
=
ext
->
pnp_device
;
EnterCriticalSection
(
&
device_list_cs
);
list_remove
(
&
pnp_device
->
entry
);
LeaveCriticalSection
(
&
device_list_cs
);
}
void
bus_remove_hid_device
(
DEVICE_OBJECT
*
device
)
{
struct
device_extension
*
ext
=
(
struct
device_extension
*
)
device
->
DeviceExtension
;
...
...
@@ -355,10 +365,6 @@ void bus_remove_hid_device(DEVICE_OBJECT *device)
TRACE
(
"(%p)
\n
"
,
device
);
EnterCriticalSection
(
&
device_list_cs
);
list_remove
(
&
pnp_device
->
entry
);
LeaveCriticalSection
(
&
device_list_cs
);
/* Cancel pending IRPs */
EnterCriticalSection
(
&
ext
->
report_cs
);
while
((
entry
=
RemoveHeadList
(
&
ext
->
irp_queue
))
!=
&
ext
->
irp_queue
)
...
...
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