hid: Implement HidD_SetOutputReport.

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:
Aric Stewart 2016-10-26 12:46:12 -05:00 committed by Alexandre Julliard
parent 1a81022f4e
commit fc1485b86b
4 changed files with 14 additions and 7 deletions

View File

@ -17,7 +17,7 @@
@ stub HidD_SetConfiguration
@ stdcall HidD_SetFeature(long ptr long)
@ stdcall HidD_SetNumInputBuffers(long long)
@ stub HidD_SetOutputReport
@ stdcall HidD_SetOutputReport(long ptr long)
@ stdcall HidP_GetButtonCaps(long ptr ptr ptr)
@ stdcall HidP_GetCaps(ptr ptr)
@ stub HidP_GetData

View File

@ -133,3 +133,9 @@ BOOLEAN WINAPI HidD_GetPreparsedData(HANDLE HidDeviceObject, PHIDP_PREPARSED_DAT
*PreparsedData = data;
return TRUE;
}
BOOLEAN WINAPI HidD_SetOutputReport(HANDLE HidDeviceObject, void *ReportBuffer, ULONG ReportBufferLength)
{
TRACE("(%p %p %u)\n", HidDeviceObject, ReportBuffer, ReportBufferLength);
return DeviceIoControl(HidDeviceObject, IOCTL_HID_SET_OUTPUT_REPORT, ReportBuffer, ReportBufferLength, NULL, 0, NULL, NULL);
}

View File

@ -463,21 +463,20 @@ static NTSTATUS HID_get_feature(DEVICE_OBJECT *device, IRP *irp)
return rc;
}
static NTSTATUS HID_set_feature(DEVICE_OBJECT *device, IRP *irp)
static NTSTATUS HID_set_to_device(DEVICE_OBJECT *device, IRP *irp)
{
IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation( irp );
IO_STACK_LOCATION *irpsp = IoGetCurrentIrpStackLocation(irp);
HID_XFER_PACKET packet;
NTSTATUS rc;
irp->IoStatus.Information = 0;
TRACE_(hid_report)("Device %p Buffer length %i Buffer %p\n", device, irpsp->Parameters.DeviceIoControl.InputBufferLength, irp->AssociatedIrp.SystemBuffer);
packet.reportBuffer = irp->AssociatedIrp.SystemBuffer;
packet.reportId = ((char*)irp->AssociatedIrp.SystemBuffer)[0];
packet.reportBufferLen = irpsp->Parameters.DeviceIoControl.InputBufferLength;
TRACE_(hid_report)("(id %i, len %i buffer %p)\n", packet.reportId, packet.reportBufferLen, packet.reportBuffer);
rc = call_minidriver(IOCTL_HID_SET_FEATURE, device, &packet, sizeof(packet), NULL, 0);
rc = call_minidriver(irpsp->Parameters.DeviceIoControl.IoControlCode,
device, NULL, 0, &packet, sizeof(packet));
irp->IoStatus.u.Status = rc;
if (irp->IoStatus.u.Status == STATUS_SUCCESS)
@ -609,7 +608,8 @@ NTSTATUS WINAPI HID_Device_ioctl(DEVICE_OBJECT *device, IRP *irp)
rc = HID_get_feature(device, irp);
break;
case IOCTL_HID_SET_FEATURE:
rc = HID_set_feature(device, irp);
case IOCTL_HID_SET_OUTPUT_REPORT:
rc = HID_set_to_device(device, irp);
break;
default:
{

View File

@ -45,5 +45,6 @@ BOOLEAN WINAPI HidD_SetNumInputBuffers(HANDLE HidDeviceObject, ULONG NumberBuffe
BOOLEAN WINAPI HidD_GetPreparsedData( HANDLE HidDeviceObject, PHIDP_PREPARSED_DATA *PreparsedData);
BOOLEAN WINAPI HidD_FreePreparsedData(PHIDP_PREPARSED_DATA PreparsedData);
BOOLEAN WINAPI HidD_GetAttributes(HANDLE HidDeviceObject, PHIDD_ATTRIBUTES Attr);
BOOLEAN WINAPI HidD_SetOutputReport(HANDLE HidDeviceObject, void *ReportBuffer, ULONG ReportBufferLength);
#endif /* __WINE_HIDSDI_H */