mirror of
https://github.com/reactos/reactos.git
synced 2024-11-20 06:15:26 +00:00
[LIBUSB]
- 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:
parent
420285a3c0
commit
75c0ba4cf3
4 changed files with 47 additions and 10 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue