Commit 6d8eb8ba authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

hidclass.sys: Use MmGetSystemAddressForMdlSafe to access MDL data.

parent ddfc5275
...@@ -419,7 +419,7 @@ static NTSTATUS handle_minidriver_string(DEVICE_OBJECT *device, IRP *irp, SHORT ...@@ -419,7 +419,7 @@ static NTSTATUS handle_minidriver_string(DEVICE_OBJECT *device, IRP *irp, SHORT
if (status == STATUS_SUCCESS) if (status == STATUS_SUCCESS)
{ {
WCHAR *out_buffer = (WCHAR*)(((BYTE*)irp->MdlAddress->StartVa) + irp->MdlAddress->ByteOffset); WCHAR *out_buffer = MmGetSystemAddressForMdlSafe(irp->MdlAddress, NormalPagePriority);
int length = irpsp->Parameters.DeviceIoControl.OutputBufferLength/sizeof(WCHAR); int length = irpsp->Parameters.DeviceIoControl.OutputBufferLength/sizeof(WCHAR);
TRACE("got string %s from minidriver\n",debugstr_w(buffer)); TRACE("got string %s from minidriver\n",debugstr_w(buffer));
lstrcpynW(out_buffer, buffer, length); lstrcpynW(out_buffer, buffer, length);
...@@ -440,7 +440,7 @@ static NTSTATUS HID_get_feature(DEVICE_OBJECT *device, IRP *irp) ...@@ -440,7 +440,7 @@ static NTSTATUS HID_get_feature(DEVICE_OBJECT *device, IRP *irp)
irp->IoStatus.Information = 0; irp->IoStatus.Information = 0;
out_buffer = (((BYTE*)irp->MdlAddress->StartVa) + irp->MdlAddress->ByteOffset); out_buffer = MmGetSystemAddressForMdlSafe(irp->MdlAddress, NormalPagePriority);
TRACE_(hid_report)("Device %p Buffer length %i Buffer %p\n", device, irpsp->Parameters.DeviceIoControl.OutputBufferLength, out_buffer); TRACE_(hid_report)("Device %p Buffer length %i Buffer %p\n", device, irpsp->Parameters.DeviceIoControl.OutputBufferLength, out_buffer);
len = sizeof(*packet) + irpsp->Parameters.DeviceIoControl.OutputBufferLength; len = sizeof(*packet) + irpsp->Parameters.DeviceIoControl.OutputBufferLength;
...@@ -569,7 +569,7 @@ NTSTATUS WINAPI HID_Device_ioctl(DEVICE_OBJECT *device, IRP *irp) ...@@ -569,7 +569,7 @@ NTSTATUS WINAPI HID_Device_ioctl(DEVICE_OBJECT *device, IRP *irp)
case IOCTL_HID_GET_INPUT_REPORT: case IOCTL_HID_GET_INPUT_REPORT:
{ {
HID_XFER_PACKET packet; HID_XFER_PACKET packet;
BYTE* buffer = ((BYTE*)irp->MdlAddress->StartVa) + irp->MdlAddress->ByteOffset; BYTE *buffer = MmGetSystemAddressForMdlSafe(irp->MdlAddress, NormalPagePriority);
if (extension->preparseData->InputReports[0].reportID) if (extension->preparseData->InputReports[0].reportID)
packet.reportId = buffer[0]; packet.reportId = buffer[0];
......
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