nsiproxy: Fill the reply when it's not pending on the unix-side.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gabriel Ivăncescu 2021-11-08 18:18:03 +02:00 committed by Alexandre Julliard
parent 5e8bd4d38e
commit 5cd42975c3
3 changed files with 5 additions and 10 deletions

View file

@ -353,13 +353,13 @@ static DWORD WINAPI listen_thread_proc( void *arg )
static void handle_queued_send_echo( IRP *irp )
{
struct nsiproxy_icmp_echo *in = (struct nsiproxy_icmp_echo *)irp->AssociatedIrp.SystemBuffer;
struct nsiproxy_icmp_echo_reply *reply = (struct nsiproxy_icmp_echo_reply *)irp->AssociatedIrp.SystemBuffer;
struct icmp_send_echo_params params;
NTSTATUS status;
TRACE( "\n" );
params.request = in->data + ((in->opt_size + 3) & ~3);
params.request_size = in->req_size;
params.reply = irp->AssociatedIrp.SystemBuffer;
params.ttl = in->ttl;
params.tos = in->tos;
params.dst = &in->dst;
@ -371,11 +371,7 @@ static void handle_queued_send_echo( IRP *irp )
{
irp->IoStatus.Status = status;
if (status == STATUS_SUCCESS)
{
memset( reply, 0, sizeof(*reply) );
reply->status = params.ip_status;
irp->IoStatus.Information = sizeof(*reply);
}
irp->IoStatus.Information = params.reply_len;
IoCompleteRequest( irp, IO_NO_INCREMENT );
}
else

View file

@ -586,7 +586,7 @@ NTSTATUS icmp_send_echo( void *args )
{
TRACE( "sendto() rets %d errno %d\n", ret, errno );
icmp_data_free( data );
params->ip_status = errno_to_ip_status( errno );
params->reply_len = data->ops->set_reply_ip_status( errno_to_ip_status( errno ), params->reply );
return STATUS_SUCCESS;
}

View file

@ -28,9 +28,8 @@ struct icmp_listen_params
struct icmp_send_echo_params
{
SOCKADDR_INET *dst;
void *request;
DWORD request_size;
void *request, *reply;
DWORD request_size, reply_len;
BYTE ttl, tos;
HANDLE handle;
ULONG ip_status;
};