winebus.sys: Implement IOCTL_HID_SET_OUTPUT_REPORT for hidraw.
Signed-off-by: Aric Stewart <aric@codeweavers.com> Signed-off-by: Sebastian Lackner <sebastian@fds-team.de> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3f5e8715b3
commit
253204570e
|
@ -26,6 +26,7 @@ typedef struct
|
|||
NTSTATUS (*get_reportdescriptor)(DEVICE_OBJECT *device, BYTE *buffer, DWORD length, DWORD *out_length);
|
||||
NTSTATUS (*get_string)(DEVICE_OBJECT *device, DWORD index, WCHAR *buffer, DWORD length);
|
||||
NTSTATUS (*begin_report_processing)(DEVICE_OBJECT *device);
|
||||
NTSTATUS (*set_output_report)(DEVICE_OBJECT *device, UCHAR id, BYTE *report, DWORD length, ULONG_PTR *written);
|
||||
} platform_vtbl;
|
||||
|
||||
void *get_platform_private(DEVICE_OBJECT *device) DECLSPEC_HIDDEN;
|
||||
|
|
|
@ -284,12 +284,30 @@ static NTSTATUS begin_report_processing(DEVICE_OBJECT *device)
|
|||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static NTSTATUS hidraw_set_output_report(DEVICE_OBJECT *device, UCHAR id, BYTE *report, DWORD length, ULONG_PTR *written)
|
||||
{
|
||||
struct platform_private* ext = impl_from_DEVICE_OBJECT(device);
|
||||
ssize_t rc;
|
||||
rc = write(ext->device_fd, report, length);
|
||||
if (rc > 0)
|
||||
{
|
||||
*written = rc;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
*written = 0;
|
||||
return STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
}
|
||||
|
||||
static const platform_vtbl hidraw_vtbl =
|
||||
{
|
||||
compare_platform_device,
|
||||
hidraw_get_reportdescriptor,
|
||||
hidraw_get_string,
|
||||
begin_report_processing,
|
||||
hidraw_set_output_report,
|
||||
};
|
||||
|
||||
static void try_add_device(struct udev_device *dev)
|
||||
|
|
|
@ -531,6 +531,16 @@ NTSTATUS WINAPI hid_internal_dispatch(DEVICE_OBJECT *device, IRP *irp)
|
|||
LeaveCriticalSection(&ext->report_cs);
|
||||
break;
|
||||
}
|
||||
case IOCTL_HID_SET_OUTPUT_REPORT:
|
||||
case IOCTL_HID_WRITE_REPORT:
|
||||
{
|
||||
HID_XFER_PACKET *packet = (HID_XFER_PACKET*)(irp->UserBuffer);
|
||||
TRACE_(hid_report)("IOCTL_HID_WRITE_REPORT / IOCTL_HID_SET_OUTPUT_REPORT\n");
|
||||
irp->IoStatus.u.Status = status = ext->vtbl->set_output_report(
|
||||
device, packet->reportId, packet->reportBuffer,
|
||||
packet->reportBufferLen, &irp->IoStatus.Information);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
ULONG code = irpsp->Parameters.DeviceIoControl.IoControlCode;
|
||||
|
|
Loading…
Reference in New Issue