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
fb35743f
Commit
fb35743f
authored
Mar 02, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Mar 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http.sys: Support cancelling IRPs.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0959d189
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
2 deletions
+38
-2
http.c
dlls/http.sys/http.c
+26
-2
httpapi.c
dlls/httpapi/tests/httpapi.c
+12
-0
No files found.
dlls/http.sys/http.c
View file @
fb35743f
...
...
@@ -1178,6 +1178,20 @@ static struct connection *get_connection(HTTP_REQUEST_ID req_id)
return
NULL
;
}
static
void
WINAPI
http_receive_request_cancel
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
)
{
TRACE
(
"device %p, irp %p.
\n
"
,
device
,
irp
);
IoReleaseCancelSpinLock
(
irp
->
CancelIrql
);
EnterCriticalSection
(
&
http_cs
);
RemoveEntryList
(
&
irp
->
Tail
.
Overlay
.
ListEntry
);
LeaveCriticalSection
(
&
http_cs
);
irp
->
IoStatus
.
Status
=
STATUS_CANCELLED
;
IoCompleteRequest
(
irp
,
IO_NO_INCREMENT
);
}
static
NTSTATUS
http_receive_request
(
struct
request_queue
*
queue
,
IRP
*
irp
)
{
const
struct
http_receive_request_params
*
params
=
irp
->
AssociatedIrp
.
SystemBuffer
;
...
...
@@ -1199,8 +1213,18 @@ static NTSTATUS http_receive_request(struct request_queue *queue, IRP *irp)
if
(
params
->
id
==
HTTP_NULL_ID
)
{
TRACE
(
"Queuing IRP %p.
\n
"
,
irp
);
InsertTailList
(
&
queue
->
irp_queue
,
&
irp
->
Tail
.
Overlay
.
ListEntry
);
ret
=
STATUS_PENDING
;
IoSetCancelRoutine
(
irp
,
http_receive_request_cancel
);
if
(
irp
->
Cancel
&&
!
IoSetCancelRoutine
(
irp
,
NULL
))
{
/* The IRP was canceled before we set the cancel routine. */
ret
=
STATUS_CANCELLED
;
}
else
{
InsertTailList
(
&
queue
->
irp_queue
,
&
irp
->
Tail
.
Overlay
.
ListEntry
);
ret
=
STATUS_PENDING
;
}
}
else
ret
=
STATUS_CONNECTION_INVALID
;
...
...
dlls/httpapi/tests/httpapi.c
View file @
fb35743f
...
...
@@ -348,6 +348,18 @@ static void test_v1_server(void)
ret
=
remove_url_v1
(
queue
,
port
);
ok
(
ret
==
ERROR_FILE_NOT_FOUND
,
"Got error %u.
\n
"
,
ret
);
ret
=
HttpReceiveHttpRequest
(
queue
,
HTTP_NULL_ID
,
0
,
(
HTTP_REQUEST
*
)
req
,
sizeof
(
req_buffer
),
NULL
,
&
ovl
);
ok
(
ret
==
ERROR_IO_PENDING
,
"Got error %u.
\n
"
,
ret
);
ret
=
CancelIo
(
queue
);
ok
(
ret
,
"Failed to close queue handle, error %u.
\n
"
,
GetLastError
());
ret_size
=
0xdeadbeef
;
ret
=
GetOverlappedResult
(
queue
,
&
ovl
,
&
ret_size
,
FALSE
);
ok
(
!
ret
,
"Expected failure.
\n
"
);
ok
(
GetLastError
()
==
ERROR_OPERATION_ABORTED
,
"Got error %u.
\n
"
,
GetLastError
());
ok
(
!
ret_size
,
"Got size %u.
\n
"
,
ret_size
);
closesocket
(
s
);
CloseHandle
(
ovl
.
hEvent
);
ret
=
CloseHandle
(
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