Commit 0d564359 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

http.sys: Fill out the local and remote addresses.

parent d39dc980
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment