mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 03:54:02 +00:00
[HIDUSB]
- Plug a memory leak in HidUsb_GetReportDescriptor - Do not try to free in the middle of a pool block on IRP_MN_STOP_DEVICE - Implement HidPower - Do not access an IRP after completing it in HidCreate - Do not waste a stack location in HidSystemControl svn path=/trunk/; revision=59010
This commit is contained in:
parent
a5852729fa
commit
ab06a44464
1 changed files with 18 additions and 19 deletions
|
@ -311,6 +311,11 @@ HidCreate(
|
||||||
//
|
//
|
||||||
ASSERT(IoStack->MajorFunction == IRP_MJ_CREATE || IoStack->MajorFunction == IRP_MJ_CLOSE);
|
ASSERT(IoStack->MajorFunction == IRP_MJ_CREATE || IoStack->MajorFunction == IRP_MJ_CLOSE);
|
||||||
|
|
||||||
|
//
|
||||||
|
// informational debug print
|
||||||
|
//
|
||||||
|
DPRINT("HIDUSB Request: %x\n", IoStack->MajorFunction);
|
||||||
|
|
||||||
//
|
//
|
||||||
// complete request
|
// complete request
|
||||||
//
|
//
|
||||||
|
@ -318,11 +323,6 @@ HidCreate(
|
||||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||||
|
|
||||||
//
|
|
||||||
// informal debug print
|
|
||||||
//
|
|
||||||
DPRINT("HIDUSB Request: %x\n", IoStack->MajorFunction);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// done
|
// done
|
||||||
//
|
//
|
||||||
|
@ -714,6 +714,11 @@ HidUsb_GetReportDescriptor(
|
||||||
//
|
//
|
||||||
Irp->IoStatus.Information = Length;
|
Irp->IoStatus.Information = Length;
|
||||||
|
|
||||||
|
//
|
||||||
|
// free the report buffer
|
||||||
|
//
|
||||||
|
ExFreePoolWithTag(Report, HIDUSB_TAG);
|
||||||
|
|
||||||
//
|
//
|
||||||
// done
|
// done
|
||||||
//
|
//
|
||||||
|
@ -909,9 +914,12 @@ HidPower(
|
||||||
IN PDEVICE_OBJECT DeviceObject,
|
IN PDEVICE_OBJECT DeviceObject,
|
||||||
IN PIRP Irp)
|
IN PIRP Irp)
|
||||||
{
|
{
|
||||||
UNIMPLEMENTED
|
PHID_DEVICE_EXTENSION DeviceExtension;
|
||||||
ASSERT(FALSE);
|
|
||||||
return STATUS_NOT_IMPLEMENTED;
|
DeviceExtension = DeviceObject->DeviceExtension;
|
||||||
|
PoStartNextPowerIrp(Irp);
|
||||||
|
IoSkipCurrentIrpStackLocation(Irp);
|
||||||
|
return PoCallDriver(DeviceExtension->NextDeviceObject, Irp);
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
@ -928,9 +936,9 @@ HidSystemControl(
|
||||||
DeviceExtension = DeviceObject->DeviceExtension;
|
DeviceExtension = DeviceObject->DeviceExtension;
|
||||||
|
|
||||||
//
|
//
|
||||||
// copy stack location
|
// skip stack location
|
||||||
//
|
//
|
||||||
IoCopyCurrentIrpStackLocationToNext(Irp);
|
IoSkipCurrentIrpStackLocation(Irp);
|
||||||
|
|
||||||
//
|
//
|
||||||
// submit request
|
// submit request
|
||||||
|
@ -1720,15 +1728,6 @@ HidPnp(
|
||||||
Status = Irp->IoStatus.Status;
|
Status = Irp->IoStatus.Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// free resources
|
|
||||||
//
|
|
||||||
if (HidDeviceExtension->HidDescriptor)
|
|
||||||
{
|
|
||||||
ExFreePoolWithTag(HidDeviceExtension->HidDescriptor, HIDUSB_TAG);
|
|
||||||
HidDeviceExtension->HidDescriptor = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// done
|
// done
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue