Commit 9c5ab964 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

hidclass.sys: Return STATUS_INVALID_USER_BUFFER when appropriate.

parent 6f4ccd04
......@@ -499,7 +499,12 @@ NTSTATUS WINAPI pdo_ioctl(DEVICE_OBJECT *device, IRP *irp)
BYTE *buffer = MmGetSystemAddressForMdlSafe(irp->MdlAddress, NormalPagePriority);
ULONG out_length;
if (!irpsp->Parameters.DeviceIoControl.OutputBufferLength || !buffer)
if (!buffer)
{
irp->IoStatus.Status = STATUS_INVALID_USER_BUFFER;
break;
}
if (!irpsp->Parameters.DeviceIoControl.OutputBufferLength)
{
irp->IoStatus.Status = STATUS_BUFFER_TOO_SMALL;
break;
......
......@@ -2441,7 +2441,7 @@ static void test_hidp(HANDLE file, HANDLE async_file, int report_id, BOOL polled
SetLastError(0xdeadbeef);
ret = HidD_GetInputReport(file, report, 0);
ok(!ret, "HidD_GetInputReport succeeded\n");
todo_wine ok(GetLastError() == ERROR_INVALID_USER_BUFFER, "HidD_GetInputReport returned error %u\n", GetLastError());
ok(GetLastError() == ERROR_INVALID_USER_BUFFER, "HidD_GetInputReport returned error %u\n", GetLastError());
SetLastError(0xdeadbeef);
ret = HidD_GetInputReport(file, report, caps.InputReportByteLength - 1);
......
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