mirror of
https://github.com/reactos/reactos.git
synced 2025-06-10 20:34:59 +00:00
[KBDHID][MOUHID]
- Free device resources svn path=/trunk/; revision=58993
This commit is contained in:
parent
22de130758
commit
aec2159f30
2 changed files with 95 additions and 0 deletions
|
@ -771,6 +771,47 @@ KbdHid_StartDeviceCompletion(
|
||||||
return STATUS_MORE_PROCESSING_REQUIRED;
|
return STATUS_MORE_PROCESSING_REQUIRED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
KbdHid_FreeResources(
|
||||||
|
IN PDEVICE_OBJECT DeviceObject)
|
||||||
|
{
|
||||||
|
PKBDHID_DEVICE_EXTENSION DeviceExtension;
|
||||||
|
|
||||||
|
/* get device extension */
|
||||||
|
DeviceExtension = DeviceObject->DeviceExtension;
|
||||||
|
|
||||||
|
/* free resources */
|
||||||
|
if (DeviceExtension->PreparsedData)
|
||||||
|
{
|
||||||
|
ExFreePool(DeviceExtension->PreparsedData);
|
||||||
|
DeviceExtension->PreparsedData = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DeviceExtension->CurrentUsageList)
|
||||||
|
{
|
||||||
|
ExFreePool(DeviceExtension->CurrentUsageList);
|
||||||
|
DeviceExtension->CurrentUsageList = NULL;
|
||||||
|
DeviceExtension->PreviousUsageList = NULL;
|
||||||
|
DeviceExtension->MakeUsageList = NULL;
|
||||||
|
DeviceExtension->BreakUsageList = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DeviceExtension->ReportMDL)
|
||||||
|
{
|
||||||
|
IoFreeMdl(DeviceExtension->ReportMDL);
|
||||||
|
DeviceExtension->ReportMDL = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DeviceExtension->Report)
|
||||||
|
{
|
||||||
|
ExFreePool(DeviceExtension->Report);
|
||||||
|
DeviceExtension->Report = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
KbdHid_Flush(
|
KbdHid_Flush(
|
||||||
|
@ -818,6 +859,10 @@ KbdHid_Pnp(
|
||||||
switch (IoStack->MinorFunction)
|
switch (IoStack->MinorFunction)
|
||||||
{
|
{
|
||||||
case IRP_MN_STOP_DEVICE:
|
case IRP_MN_STOP_DEVICE:
|
||||||
|
case IRP_MN_SURPRISE_REMOVAL:
|
||||||
|
/* free resources */
|
||||||
|
KbdHid_FreeResources(DeviceObject);
|
||||||
|
/* fall through */
|
||||||
case IRP_MN_CANCEL_REMOVE_DEVICE:
|
case IRP_MN_CANCEL_REMOVE_DEVICE:
|
||||||
case IRP_MN_QUERY_STOP_DEVICE:
|
case IRP_MN_QUERY_STOP_DEVICE:
|
||||||
case IRP_MN_CANCEL_STOP_DEVICE:
|
case IRP_MN_CANCEL_STOP_DEVICE:
|
||||||
|
@ -837,6 +882,9 @@ KbdHid_Pnp(
|
||||||
/* cancel irp */
|
/* cancel irp */
|
||||||
IoCancelIrp(DeviceExtension->Irp);
|
IoCancelIrp(DeviceExtension->Irp);
|
||||||
|
|
||||||
|
/* free resources */
|
||||||
|
KbdHid_FreeResources(DeviceObject);
|
||||||
|
|
||||||
/* indicate success */
|
/* indicate success */
|
||||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
|
|
@ -902,6 +902,47 @@ MouHid_StartDeviceCompletion(
|
||||||
return STATUS_MORE_PROCESSING_REQUIRED;
|
return STATUS_MORE_PROCESSING_REQUIRED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
|
MouHid_FreeResources(
|
||||||
|
IN PDEVICE_OBJECT DeviceObject)
|
||||||
|
{
|
||||||
|
PMOUHID_DEVICE_EXTENSION DeviceExtension;
|
||||||
|
|
||||||
|
/* get device extension */
|
||||||
|
DeviceExtension = DeviceObject->DeviceExtension;
|
||||||
|
|
||||||
|
/* free resources */
|
||||||
|
if (DeviceExtension->PreparsedData)
|
||||||
|
{
|
||||||
|
ExFreePool(DeviceExtension->PreparsedData);
|
||||||
|
DeviceExtension->PreparsedData = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DeviceExtension->CurrentUsageList)
|
||||||
|
{
|
||||||
|
ExFreePool(DeviceExtension->CurrentUsageList);
|
||||||
|
DeviceExtension->CurrentUsageList = NULL;
|
||||||
|
DeviceExtension->PreviousUsageList = NULL;
|
||||||
|
DeviceExtension->MakeUsageList = NULL;
|
||||||
|
DeviceExtension->BreakUsageList = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DeviceExtension->ReportMDL)
|
||||||
|
{
|
||||||
|
IoFreeMdl(DeviceExtension->ReportMDL);
|
||||||
|
DeviceExtension->ReportMDL = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DeviceExtension->Report)
|
||||||
|
{
|
||||||
|
ExFreePool(DeviceExtension->Report);
|
||||||
|
DeviceExtension->Report = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return STATUS_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
NTAPI
|
NTAPI
|
||||||
MouHid_Flush(
|
MouHid_Flush(
|
||||||
|
@ -949,6 +990,9 @@ MouHid_Pnp(
|
||||||
switch (IoStack->MinorFunction)
|
switch (IoStack->MinorFunction)
|
||||||
{
|
{
|
||||||
case IRP_MN_STOP_DEVICE:
|
case IRP_MN_STOP_DEVICE:
|
||||||
|
case IRP_MN_SURPRISE_REMOVAL:
|
||||||
|
/* free resources */
|
||||||
|
MouHid_FreeResources(DeviceObject);
|
||||||
case IRP_MN_CANCEL_REMOVE_DEVICE:
|
case IRP_MN_CANCEL_REMOVE_DEVICE:
|
||||||
case IRP_MN_QUERY_STOP_DEVICE:
|
case IRP_MN_QUERY_STOP_DEVICE:
|
||||||
case IRP_MN_CANCEL_STOP_DEVICE:
|
case IRP_MN_CANCEL_STOP_DEVICE:
|
||||||
|
@ -971,6 +1015,9 @@ MouHid_Pnp(
|
||||||
/* cancel irp */
|
/* cancel irp */
|
||||||
IoCancelIrp(DeviceExtension->Irp);
|
IoCancelIrp(DeviceExtension->Irp);
|
||||||
|
|
||||||
|
/* free resources */
|
||||||
|
MouHid_FreeResources(DeviceObject);
|
||||||
|
|
||||||
/* indicate success */
|
/* indicate success */
|
||||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue