Author: tfaber
Date: Sun Jun 29 12:39:10 2014
New Revision: 63665
URL:
http://svn.reactos.org/svn/reactos?rev=63665&view=rev
Log:
[LIBUSB]
- Correctly stub IRP_MJ_POWER handling
- Stub handlers for the (mandatory!) IRP_MJ_SYSTEM_CONTROL
Modified:
trunk/reactos/lib/drivers/libusb/common_interfaces.h
trunk/reactos/lib/drivers/libusb/hcd_controller.cpp
trunk/reactos/lib/drivers/libusb/hub_controller.cpp
trunk/reactos/lib/drivers/libusb/libusb.cpp
Modified: trunk/reactos/lib/drivers/libusb/common_interfaces.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/libusb/common_…
==============================================================================
--- trunk/reactos/lib/drivers/libusb/common_interfaces.h [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/libusb/common_interfaces.h [iso-8859-1] Sun Jun 29 12:39:10
2014
@@ -491,6 +491,15 @@
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;
Modified: trunk/reactos/lib/drivers/libusb/hcd_controller.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/libusb/hcd_con…
==============================================================================
--- trunk/reactos/lib/drivers/libusb/hcd_controller.cpp [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/libusb/hcd_controller.cpp [iso-8859-1] Sun Jun 29 12:39:10
2014
@@ -43,6 +43,7 @@
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 @@
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
- UNIMPLEMENTED
-
- Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED;
- IoCompleteRequest(Irp, IO_NO_INCREMENT);
-
- return STATUS_NOT_IMPLEMENTED;
+ PoStartNextPowerIrp(Irp);
+ IoSkipCurrentIrpStackLocation(Irp);
+ return PoCallDriver(m_NextDeviceObject, Irp);
+}
+
+NTSTATUS
+CHCDController::HandleSystemControl(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp)
+{
+ IoSkipCurrentIrpStackLocation(Irp);
+ return IoCallDriver(m_NextDeviceObject, Irp);
}
NTSTATUS
Modified: trunk/reactos/lib/drivers/libusb/hub_controller.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/libusb/hub_con…
==============================================================================
--- trunk/reactos/lib/drivers/libusb/hub_controller.cpp [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/libusb/hub_controller.cpp [iso-8859-1] Sun Jun 29 12:39:10
2014
@@ -48,6 +48,7 @@
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 @@
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;
}
//-----------------------------------------------------------------------------------------
Modified: trunk/reactos/lib/drivers/libusb/libusb.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/drivers/libusb/libusb.…
==============================================================================
--- trunk/reactos/lib/drivers/libusb/libusb.cpp [iso-8859-1] (original)
+++ trunk/reactos/lib/drivers/libusb/libusb.cpp [iso-8859-1] Sun Jun 29 12:39:10 2014
@@ -102,7 +102,7 @@
case IRP_MJ_POWER:
{
//
- // dispatch pnp
+ // dispatch power
//
return DeviceExtension->Dispatcher->HandlePower(DeviceObject, Irp);
}
@@ -110,9 +110,16 @@
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:
{