- Correctly stub IRP_MJ_POWER handling
- Stub handlers for the (mandatory!) IRP_MJ_SYSTEM_CONTROL

svn path=/trunk/; revision=63665
This commit is contained in:
Thomas Faber 2014-06-29 12:39:10 +00:00
parent 420285a3c0
commit 75c0ba4cf3
4 changed files with 47 additions and 10 deletions

View file

@ -491,6 +491,15 @@ DECLARE_INTERFACE_(IDispatchIrp, IUnknown)
virtual NTSTATUS HandleDeviceControl(IN PDEVICE_OBJECT DeviceObject,
IN OUT PIRP Irp) = 0;
//-----------------------------------------------------------------------------------------
//
// HandleSystemControl
//
// Description: handles WMI system control requests
virtual NTSTATUS HandleSystemControl(IN PDEVICE_OBJECT DeviceObject,
IN OUT PIRP Irp) = 0;
};
typedef IDispatchIrp *PDISPATCHIRP;

View file

@ -43,6 +43,7 @@ public:
NTSTATUS HandlePnp(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp);
NTSTATUS HandlePower(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp);
NTSTATUS HandleDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp);
NTSTATUS HandleSystemControl(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp);
// local functions
NTSTATUS CreateFDO(PDRIVER_OBJECT DriverObject, PDEVICE_OBJECT * OutDeviceObject);
@ -605,12 +606,18 @@ CHCDController::HandlePower(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
UNIMPLEMENTED
PoStartNextPowerIrp(Irp);
IoSkipCurrentIrpStackLocation(Irp);
return PoCallDriver(m_NextDeviceObject, Irp);
}
Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_NOT_IMPLEMENTED;
NTSTATUS
CHCDController::HandleSystemControl(
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
IoSkipCurrentIrpStackLocation(Irp);
return IoCallDriver(m_NextDeviceObject, Irp);
}
NTSTATUS

View file

@ -48,6 +48,7 @@ public:
virtual NTSTATUS HandlePnp(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp);
virtual NTSTATUS HandlePower(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp);
virtual NTSTATUS HandleDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp);
virtual NTSTATUS HandleSystemControl(IN PDEVICE_OBJECT DeviceObject, IN OUT PIRP Irp);
// local functions
NTSTATUS HandleQueryInterface(PIO_STACK_LOCATION IoStack);
@ -759,10 +760,23 @@ CHubController::HandlePower(
IN PDEVICE_OBJECT DeviceObject,
IN OUT PIRP Irp)
{
UNIMPLEMENTED
Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
NTSTATUS Status;
Status = Irp->IoStatus.Status;
PoStartNextPowerIrp(Irp);
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return STATUS_NOT_IMPLEMENTED;
return Status;
}
//-----------------------------------------------------------------------------------------
NTSTATUS
CHubController::HandleSystemControl(
IN PDEVICE_OBJECT DeviceObject,
IN OUT PIRP Irp)
{
NTSTATUS Status;
Status = Irp->IoStatus.Status;
IoCompleteRequest(Irp, IO_NO_INCREMENT);
return Status;
}
//-----------------------------------------------------------------------------------------

View file

@ -102,7 +102,7 @@ USBLIB_Dispatch(
case IRP_MJ_POWER:
{
//
// dispatch pnp
// dispatch power
//
return DeviceExtension->Dispatcher->HandlePower(DeviceObject, Irp);
}
@ -110,10 +110,17 @@ USBLIB_Dispatch(
case IRP_MJ_DEVICE_CONTROL:
{
//
// dispatch pnp
// dispatch io control
//
return DeviceExtension->Dispatcher->HandleDeviceControl(DeviceObject, Irp);
}
case IRP_MJ_SYSTEM_CONTROL:
{
//
// dispatch system control
//
return DeviceExtension->Dispatcher->HandleSystemControl(DeviceObject, Irp);
}
default:
{
DPRINT1("USBLIB_Dispatch> Major %lu Minor %lu unhandeled\n", IoStack->MajorFunction, IoStack->MinorFunction);