http.sys: Fill out the local and remote addresses.
Signed-off-by: Zebediah Figura <z.figura12@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
d39dc9803b
commit
0d5643592f
|
@ -274,6 +274,8 @@ static NTSTATUS complete_irp(struct connection *conn, IRP *irp)
|
|||
const DWORD output_len = stack->Parameters.DeviceIoControl.OutputBufferLength;
|
||||
ULONG cooked_len, host_len, abs_path_len, query_len, offset;
|
||||
const char *p, *host, *abs_path, *query;
|
||||
struct sockaddr_in addr;
|
||||
int len;
|
||||
|
||||
TRACE("Completing IRP %p.\n", irp);
|
||||
|
||||
|
@ -309,6 +311,9 @@ static NTSTATUS complete_irp(struct connection *conn, IRP *irp)
|
|||
cooked_len = (7 /* scheme */ + host_len + abs_path_len + query_len) * sizeof(WCHAR);
|
||||
irp_size += cooked_len + sizeof(WCHAR);
|
||||
|
||||
/* addresses */
|
||||
irp_size += 2 * sizeof(addr);
|
||||
|
||||
TRACE("Need %u bytes, have %u.\n", irp_size, output_len);
|
||||
irp->IoStatus.Information = irp_size;
|
||||
|
||||
|
@ -376,6 +381,18 @@ static NTSTATUS complete_irp(struct connection *conn, IRP *irp)
|
|||
buffer[offset++] = 0;
|
||||
buffer[offset++] = 0;
|
||||
|
||||
req->Address.pRemoteAddress = params.addr + offset;
|
||||
len = sizeof(addr);
|
||||
getpeername(conn->socket, (struct sockaddr *)&addr, &len);
|
||||
memcpy(buffer + offset, &addr, sizeof(addr));
|
||||
offset += sizeof(addr);
|
||||
|
||||
req->Address.pLocalAddress = params.addr + offset;
|
||||
len = sizeof(addr);
|
||||
getsockname(conn->socket, (struct sockaddr *)&addr, &len);
|
||||
memcpy(buffer + offset, &addr, sizeof(addr));
|
||||
offset += sizeof(addr);
|
||||
|
||||
req->BytesReceived = conn->req_len;
|
||||
}
|
||||
else
|
||||
|
@ -425,6 +442,18 @@ static NTSTATUS complete_irp(struct connection *conn, IRP *irp)
|
|||
buffer[offset++] = 0;
|
||||
buffer[offset++] = 0;
|
||||
|
||||
req->Address.pRemoteAddress = params.addr + offset;
|
||||
len = sizeof(addr);
|
||||
getpeername(conn->socket, (struct sockaddr *)&addr, &len);
|
||||
memcpy(buffer + offset, &addr, sizeof(addr));
|
||||
offset += sizeof(addr);
|
||||
|
||||
req->Address.pLocalAddress = params.addr + offset;
|
||||
len = sizeof(addr);
|
||||
getsockname(conn->socket, (struct sockaddr *)&addr, &len);
|
||||
memcpy(buffer + offset, &addr, sizeof(addr));
|
||||
offset += sizeof(addr);
|
||||
|
||||
req->BytesReceived = conn->req_len;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue