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
5b6cee0d
Commit
5b6cee0d
authored
Aug 28, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http.sys: Allow sending response data.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3256484a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
0 deletions
+53
-0
http.c
dlls/http.sys/http.c
+45
-0
http.h
include/wine/http.h
+8
-0
No files found.
dlls/http.sys/http.c
View file @
5b6cee0d
...
...
@@ -1193,6 +1193,48 @@ static NTSTATUS http_receive_request(struct request_queue *queue, IRP *irp)
return
ret
;
}
static
NTSTATUS
http_send_response
(
struct
request_queue
*
queue
,
IRP
*
irp
)
{
const
struct
http_response
*
response
=
irp
->
AssociatedIrp
.
SystemBuffer
;
struct
connection
*
conn
;
TRACE
(
"id %s, len %d.
\n
"
,
wine_dbgstr_longlong
(
response
->
id
),
response
->
len
);
EnterCriticalSection
(
&
http_cs
);
LIST_FOR_EACH_ENTRY
(
conn
,
&
connections
,
struct
connection
,
entry
)
{
if
(
conn
->
req_id
==
response
->
id
)
{
if
(
send
(
conn
->
socket
,
response
->
buffer
,
response
->
len
,
0
)
>=
0
)
{
conn
->
queue
=
NULL
;
conn
->
req_id
=
HTTP_NULL_ID
;
WSAEventSelect
(
conn
->
socket
,
request_event
,
FD_READ
|
FD_CLOSE
);
irp
->
IoStatus
.
Information
=
response
->
len
;
/* We might have another request already in the buffer. */
if
(
parse_request
(
conn
)
<
0
)
{
WARN
(
"Failed to parse request; shutting down connection.
\n
"
);
send_400
(
conn
);
close_connection
(
conn
);
}
}
else
{
ERR
(
"Got error %u; shutting down connection.
\n
"
,
WSAGetLastError
());
close_connection
(
conn
);
}
LeaveCriticalSection
(
&
http_cs
);
return
STATUS_SUCCESS
;
}
}
LeaveCriticalSection
(
&
http_cs
);
return
STATUS_CONNECTION_INVALID
;
}
static
NTSTATUS
WINAPI
dispatch_ioctl
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
)
{
IO_STACK_LOCATION
*
stack
=
IoGetCurrentIrpStackLocation
(
irp
);
...
...
@@ -1210,6 +1252,9 @@ static NTSTATUS WINAPI dispatch_ioctl(DEVICE_OBJECT *device, IRP *irp)
case
IOCTL_HTTP_RECEIVE_REQUEST
:
ret
=
http_receive_request
(
queue
,
irp
);
break
;
case
IOCTL_HTTP_SEND_RESPONSE
:
ret
=
http_send_response
(
queue
,
irp
);
break
;
default:
FIXME
(
"Unhandled ioctl %#x.
\n
"
,
stack
->
Parameters
.
DeviceIoControl
.
IoControlCode
);
ret
=
STATUS_NOT_IMPLEMENTED
;
...
...
include/wine/http.h
View file @
5b6cee0d
...
...
@@ -26,6 +26,7 @@
#define IOCTL_HTTP_ADD_URL CTL_CODE(FILE_DEVICE_UNKNOWN, 0x800, METHOD_BUFFERED, 0)
#define IOCTL_HTTP_REMOVE_URL CTL_CODE(FILE_DEVICE_UNKNOWN, 0x801, METHOD_BUFFERED, 0)
#define IOCTL_HTTP_RECEIVE_REQUEST CTL_CODE(FILE_DEVICE_UNKNOWN, 0x802, METHOD_BUFFERED, 0)
#define IOCTL_HTTP_SEND_RESPONSE CTL_CODE(FILE_DEVICE_UNKNOWN, 0x803, METHOD_BUFFERED, 0)
struct
http_add_url_params
{
...
...
@@ -41,4 +42,11 @@ struct http_receive_request_params
ULONG
bits
;
};
struct
http_response
{
HTTP_REQUEST_ID
id
;
int
len
;
char
buffer
[
1
];
};
#endif
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