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
b0f25d7e
Commit
b0f25d7e
authored
Apr 14, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winebus.sys: Reject ioctls on a removed device.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f8ec3fdc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
main.c
dlls/winebus.sys/main.c
+18
-4
No files found.
dlls/winebus.sys/main.c
View file @
b0f25d7e
...
...
@@ -114,6 +114,8 @@ struct device_extension
{
CRITICAL_SECTION
cs
;
BOOL
removed
;
struct
pnp_device
*
pnp_device
;
WORD
vid
,
pid
,
input
;
...
...
@@ -355,6 +357,10 @@ void bus_unlink_hid_device(DEVICE_OBJECT *device)
EnterCriticalSection
(
&
device_list_cs
);
list_remove
(
&
pnp_device
->
entry
);
LeaveCriticalSection
(
&
device_list_cs
);
EnterCriticalSection
(
&
ext
->
cs
);
ext
->
removed
=
TRUE
;
LeaveCriticalSection
(
&
ext
->
cs
);
}
void
bus_remove_hid_device
(
DEVICE_OBJECT
*
device
)
...
...
@@ -709,6 +715,16 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
return
IoCallDriver
(
bus_pdo
,
irp
);
}
EnterCriticalSection
(
&
ext
->
cs
);
if
(
ext
->
removed
)
{
LeaveCriticalSection
(
&
ext
->
cs
);
irp
->
IoStatus
.
u
.
Status
=
STATUS_DELETE_PENDING
;
IoCompleteRequest
(
irp
,
IO_NO_INCREMENT
);
return
STATUS_DELETE_PENDING
;
}
switch
(
irpsp
->
Parameters
.
DeviceIoControl
.
IoControlCode
)
{
case
IOCTL_HID_GET_DEVICE_ATTRIBUTES
:
...
...
@@ -791,7 +807,6 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
{
HID_XFER_PACKET
*
packet
=
(
HID_XFER_PACKET
*
)(
irp
->
UserBuffer
);
TRACE_
(
hid_report
)(
"IOCTL_HID_GET_INPUT_REPORT
\n
"
);
EnterCriticalSection
(
&
ext
->
cs
);
status
=
ext
->
vtbl
->
begin_report_processing
(
device
);
if
(
status
!=
STATUS_SUCCESS
)
{
...
...
@@ -806,13 +821,11 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
if
(
status
==
STATUS_SUCCESS
)
packet
->
reportBufferLen
=
irp
->
IoStatus
.
Information
;
LeaveCriticalSection
(
&
ext
->
cs
);
break
;
}
case
IOCTL_HID_READ_REPORT
:
{
TRACE_
(
hid_report
)(
"IOCTL_HID_READ_REPORT
\n
"
);
EnterCriticalSection
(
&
ext
->
cs
);
status
=
ext
->
vtbl
->
begin_report_processing
(
device
);
if
(
status
!=
STATUS_SUCCESS
)
{
...
...
@@ -832,7 +845,6 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
InsertTailList
(
&
ext
->
irp_queue
,
&
irp
->
Tail
.
Overlay
.
s
.
ListEntry
);
status
=
STATUS_PENDING
;
}
LeaveCriticalSection
(
&
ext
->
cs
);
break
;
}
case
IOCTL_HID_SET_OUTPUT_REPORT
:
...
...
@@ -873,6 +885,8 @@ static NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
}
}
LeaveCriticalSection
(
&
ext
->
cs
);
if
(
status
!=
STATUS_PENDING
)
IoCompleteRequest
(
irp
,
IO_NO_INCREMENT
);
...
...
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