kernelbase: Don't set the output size in DeviceIoControl() 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-09-14 01:02:47 -05:00 committed by Alexandre Julliard
parent cc7e3ec8e2
commit f5bd946399
2 changed files with 2 additions and 2 deletions

View file

@ -4115,7 +4115,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH DeviceIoControl( HANDLE handle, DWORD code, void *
status = NtDeviceIoControlFile( handle, event, NULL, cvalue, piosb, code,
in_buff, in_count, out_buff, out_count );
if (returned) *returned = piosb->Information;
if (returned && !NT_ERROR(status)) *returned = piosb->Information;
if (status == STATUS_PENDING || !NT_SUCCESS( status )) return set_ntstatus( status );
return TRUE;
}

View file

@ -675,7 +675,7 @@ static void do_return_status(ULONG ioctl, struct return_status_params *params)
ok(GetLastError() == RtlNtStatusToDosError(expect_status), "got error %u\n", GetLastError());
}
if (NT_ERROR(expect_status))
todo_wine ok(size == 0xdeadf00d, "got size %u\n", size);
ok(size == 0xdeadf00d, "got size %u\n", size);
else if (!NT_ERROR(params->iosb_status))
todo_wine_if (params->iosb_status == STATUS_PENDING) ok(size == 3, "got size %u\n", size);
/* size is garbage if !NT_ERROR(expect_status) && NT_ERROR(iosb_status) */