ntdll: Do not fill the IOSB in NtDeviceIoControlFile() if the NT status denotes error.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2021-12-10 11:27:29 -06:00 committed by Alexandre Julliard
parent c2384cf233
commit 6fe23ed8c3
2 changed files with 7 additions and 7 deletions

View File

@ -5735,7 +5735,7 @@ NTSTATUS WINAPI NtDeviceIoControlFile( HANDLE handle, HANDLE event, PIO_APC_ROUT
return server_ioctl_file( handle, event, apc, apc_context, io, code,
in_buffer, in_size, out_buffer, out_size );
if (status != STATUS_PENDING) io->u.Status = status;
if (status != STATUS_PENDING && !NT_ERROR(status)) io->u.Status = status;
return status;
}

View File

@ -688,7 +688,7 @@ static void test_poll(void)
ret = NtDeviceIoControlFile((HANDLE)client, event, NULL, NULL, &io,
IOCTL_AFD_POLL, in_params, params_size, out_params, params_size);
ok(ret == STATUS_INVALID_HANDLE, "got %#x\n", ret);
todo_wine ok(!io.Status, "got %#x\n", io.Status);
ok(!io.Status, "got %#x\n", io.Status);
ok(!io.Information, "got %#Ix\n", io.Information);
/* Test passing the same handle twice. */
@ -1201,7 +1201,7 @@ static void test_recv(void)
memset(&io, 0, sizeof(io));
ret = NtDeviceIoControlFile((HANDLE)listener, event, NULL, NULL, &io, IOCTL_AFD_RECV, NULL, 0, NULL, 0);
todo_wine ok(ret == STATUS_INVALID_CONNECTION, "got %#x\n", ret);
todo_wine ok(!io.Status, "got status %#x\n", io.Status);
ok(!io.Status, "got status %#x\n", io.Status);
ok(!io.Information, "got information %#Ix\n", io.Information);
client = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
@ -1213,7 +1213,7 @@ static void test_recv(void)
memset(&io, 0, sizeof(io));
ret = NtDeviceIoControlFile((HANDLE)client, event, NULL, NULL, &io, IOCTL_AFD_RECV, NULL, 0, NULL, 0);
ok(ret == STATUS_INVALID_PARAMETER, "got %#x\n", ret);
todo_wine ok(!io.Status, "got status %#x\n", io.Status);
ok(!io.Status, "got status %#x\n", io.Status);
ok(!io.Information, "got information %#Ix\n", io.Information);
wsabufs[0].len = sizeof(buffer);
@ -1301,7 +1301,7 @@ static void test_recv(void)
ret = NtDeviceIoControlFile((HANDLE)client, event, NULL, NULL, &io,
IOCTL_AFD_RECV, &params, sizeof(params), NULL, 0);
ok(ret == STATUS_DEVICE_NOT_READY, "got %#x\n", ret);
todo_wine ok(!io.Status, "got status %#x\n", io.Status);
ok(!io.Status, "got status %#x\n", io.Status);
ok(!io.Information, "got information %#Ix\n", io.Information);
ret = send(server, "data", 5, 0);
@ -1368,7 +1368,7 @@ static void test_recv(void)
ret = NtDeviceIoControlFile((HANDLE)client, event, NULL, NULL, &io,
IOCTL_AFD_RECV, &params, sizeof(params), NULL, 0);
ok(ret == STATUS_INVALID_PARAMETER, "got %#x\n", ret);
todo_wine ok(io.Status == 0xdeadbeef, "got %#x\n", io.Status);
ok(io.Status == 0xdeadbeef, "got %#x\n", io.Status);
params.msg_flags = AFD_MSG_OOB | AFD_MSG_NOT_OOB;
@ -1376,7 +1376,7 @@ static void test_recv(void)
ret = NtDeviceIoControlFile((HANDLE)client, event, NULL, NULL, &io,
IOCTL_AFD_RECV, &params, sizeof(params), NULL, 0);
ok(ret == STATUS_INVALID_PARAMETER, "got %#x\n", ret);
todo_wine ok(io.Status == 0xdeadbeef, "got %#x\n", io.Status);
ok(io.Status == 0xdeadbeef, "got %#x\n", io.Status);
params.msg_flags = AFD_MSG_OOB;