2011-05-03 00:15:23 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Universal Serial Bus Bulk Storage Driver
|
2019-03-24 20:01:43 +00:00
|
|
|
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
2011-05-03 00:15:23 +00:00
|
|
|
* PURPOSE: USB block storage device driver.
|
2019-03-24 20:01:43 +00:00
|
|
|
* COPYRIGHT: 2005-2006 James Tabor
|
|
|
|
* 2011-2012 Michael Martin (michael.martin@reactos.org)
|
|
|
|
* 2011-2013 Johannes Anderwald (johannes.anderwald@reactos.org)
|
2019-06-10 23:50:43 +00:00
|
|
|
* 2019 Victor Perevertkin (victor.perevertkin@reactos.org)
|
2011-05-03 00:15:23 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "usbstor.h"
|
|
|
|
|
2013-12-23 14:50:17 +00:00
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
2019-03-24 20:01:43 +00:00
|
|
|
|
2019-06-25 16:04:20 +00:00
|
|
|
#if DBG
|
|
|
|
static
|
2011-05-03 00:15:23 +00:00
|
|
|
VOID
|
|
|
|
USBSTOR_DumpDeviceDescriptor(PUSB_DEVICE_DESCRIPTOR DeviceDescriptor)
|
|
|
|
{
|
2019-06-25 16:04:20 +00:00
|
|
|
DPRINT("Dumping Device Descriptor %p\n", DeviceDescriptor);
|
|
|
|
DPRINT("bLength %x\n", DeviceDescriptor->bLength);
|
|
|
|
DPRINT("bDescriptorType %x\n", DeviceDescriptor->bDescriptorType);
|
|
|
|
DPRINT("bcdUSB %x\n", DeviceDescriptor->bcdUSB);
|
|
|
|
DPRINT("bDeviceClass %x\n", DeviceDescriptor->bDeviceClass);
|
|
|
|
DPRINT("bDeviceSubClass %x\n", DeviceDescriptor->bDeviceSubClass);
|
|
|
|
DPRINT("bDeviceProtocol %x\n", DeviceDescriptor->bDeviceProtocol);
|
|
|
|
DPRINT("bMaxPacketSize0 %x\n", DeviceDescriptor->bMaxPacketSize0);
|
|
|
|
DPRINT("idVendor %x\n", DeviceDescriptor->idVendor);
|
|
|
|
DPRINT("idProduct %x\n", DeviceDescriptor->idProduct);
|
|
|
|
DPRINT("bcdDevice %x\n", DeviceDescriptor->bcdDevice);
|
|
|
|
DPRINT("iManufacturer %x\n", DeviceDescriptor->iManufacturer);
|
|
|
|
DPRINT("iProduct %x\n", DeviceDescriptor->iProduct);
|
|
|
|
DPRINT("iSerialNumber %x\n", DeviceDescriptor->iSerialNumber);
|
|
|
|
DPRINT("bNumConfigurations %x\n", DeviceDescriptor->bNumConfigurations);
|
2011-05-03 00:15:23 +00:00
|
|
|
}
|
2019-06-25 16:04:20 +00:00
|
|
|
#endif
|
2011-05-03 00:15:23 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
USBSTOR_FdoHandleDeviceRelations(
|
|
|
|
IN PFDO_DEVICE_EXTENSION DeviceExtension,
|
|
|
|
IN OUT PIRP Irp)
|
|
|
|
{
|
2019-11-09 22:05:47 +00:00
|
|
|
INT32 DeviceCount = 0;
|
2015-02-14 19:07:36 +00:00
|
|
|
LONG Index;
|
2011-05-03 00:15:23 +00:00
|
|
|
PDEVICE_RELATIONS DeviceRelations;
|
|
|
|
PIO_STACK_LOCATION IoStack;
|
|
|
|
|
|
|
|
IoStack = IoGetCurrentIrpStackLocation(Irp);
|
|
|
|
|
2019-06-10 23:50:43 +00:00
|
|
|
// FDO always only handles bus relations
|
|
|
|
if (IoStack->Parameters.QueryDeviceRelations.Type == BusRelations)
|
2011-05-03 00:15:23 +00:00
|
|
|
{
|
2019-06-10 23:50:43 +00:00
|
|
|
// go through array and count device objects
|
|
|
|
for (Index = 0; Index < max(DeviceExtension->MaxLUN, 1); Index++)
|
2011-05-03 00:15:23 +00:00
|
|
|
{
|
2019-06-10 23:50:43 +00:00
|
|
|
if (DeviceExtension->ChildPDO[Index])
|
|
|
|
{
|
|
|
|
DeviceCount++;
|
|
|
|
}
|
2011-05-03 00:15:23 +00:00
|
|
|
}
|
|
|
|
|
2020-06-13 00:07:00 +00:00
|
|
|
DeviceRelations = ExAllocatePoolWithTag(PagedPool, sizeof(DEVICE_RELATIONS) + (DeviceCount - 1) * sizeof(PDEVICE_OBJECT), USB_STOR_TAG);
|
2019-06-10 23:50:43 +00:00
|
|
|
if (!DeviceRelations)
|
|
|
|
{
|
|
|
|
Irp->IoStatus.Information = 0;
|
|
|
|
Irp->IoStatus.Status = STATUS_INSUFFICIENT_RESOURCES;
|
|
|
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
|
|
|
return STATUS_INSUFFICIENT_RESOURCES;
|
|
|
|
}
|
2011-05-03 00:15:23 +00:00
|
|
|
|
2020-06-13 00:07:00 +00:00
|
|
|
DeviceRelations->Count = 0;
|
|
|
|
|
2019-06-10 23:50:43 +00:00
|
|
|
// add device objects
|
|
|
|
for (Index = 0; Index < max(DeviceExtension->MaxLUN, 1); Index++)
|
2011-05-03 00:15:23 +00:00
|
|
|
{
|
2019-06-10 23:50:43 +00:00
|
|
|
if (DeviceExtension->ChildPDO[Index])
|
|
|
|
{
|
|
|
|
// store child pdo
|
|
|
|
DeviceRelations->Objects[DeviceRelations->Count] = DeviceExtension->ChildPDO[Index];
|
2011-05-03 00:15:23 +00:00
|
|
|
|
2019-06-10 23:50:43 +00:00
|
|
|
// add reference
|
|
|
|
ObReferenceObject(DeviceExtension->ChildPDO[Index]);
|
2011-05-03 00:15:23 +00:00
|
|
|
|
2019-06-10 23:50:43 +00:00
|
|
|
DeviceRelations->Count++;
|
|
|
|
}
|
2011-05-03 00:15:23 +00:00
|
|
|
}
|
2019-06-10 23:50:43 +00:00
|
|
|
|
|
|
|
Irp->IoStatus.Information = (ULONG_PTR)DeviceRelations;
|
|
|
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
2011-05-03 00:15:23 +00:00
|
|
|
}
|
|
|
|
|
2019-06-10 23:50:43 +00:00
|
|
|
IoCopyCurrentIrpStackLocationToNext(Irp);
|
2011-05-03 00:15:23 +00:00
|
|
|
|
2019-06-10 23:50:43 +00:00
|
|
|
return IoCallDriver(DeviceExtension->LowerDeviceObject, Irp);
|
2011-05-03 00:15:23 +00:00
|
|
|
}
|
|
|
|
|
2012-01-22 21:58:06 +00:00
|
|
|
NTSTATUS
|
|
|
|
USBSTOR_FdoHandleRemoveDevice(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PFDO_DEVICE_EXTENSION DeviceExtension,
|
|
|
|
IN OUT PIRP Irp)
|
|
|
|
{
|
|
|
|
NTSTATUS Status;
|
2012-10-22 11:33:26 +00:00
|
|
|
ULONG Index;
|
2012-01-22 21:58:06 +00:00
|
|
|
|
2012-10-22 11:33:26 +00:00
|
|
|
DPRINT("Handling FDO removal %p\n", DeviceObject);
|
2012-01-22 21:58:06 +00:00
|
|
|
|
2019-03-24 20:01:43 +00:00
|
|
|
// FIXME: wait for devices finished processing
|
2019-11-09 22:05:47 +00:00
|
|
|
for (Index = 0; Index < USB_MAXCHILDREN; Index++)
|
2012-10-22 11:33:26 +00:00
|
|
|
{
|
|
|
|
if (DeviceExtension->ChildPDO[Index] != NULL)
|
|
|
|
{
|
|
|
|
DPRINT("Deleting PDO %p RefCount %x AttachedDevice %p \n", DeviceExtension->ChildPDO[Index], DeviceExtension->ChildPDO[Index]->ReferenceCount, DeviceExtension->ChildPDO[Index]->AttachedDevice);
|
|
|
|
IoDeleteDevice(DeviceExtension->ChildPDO[Index]);
|
|
|
|
}
|
|
|
|
}
|
2012-01-22 21:58:06 +00:00
|
|
|
|
2019-06-10 22:31:44 +00:00
|
|
|
// Freeing everything in DeviceExtension
|
2024-10-02 21:21:50 +00:00
|
|
|
if (DeviceExtension->DeviceDescriptor)
|
|
|
|
ExFreePoolWithTag(DeviceExtension->DeviceDescriptor, USB_STOR_TAG);
|
|
|
|
if (DeviceExtension->ConfigurationDescriptor)
|
|
|
|
ExFreePoolWithTag(DeviceExtension->ConfigurationDescriptor, USB_STOR_TAG);
|
|
|
|
if (DeviceExtension->InterfaceInformation)
|
|
|
|
ExFreePoolWithTag(DeviceExtension->InterfaceInformation, USB_STOR_TAG);
|
|
|
|
if (DeviceExtension->ResetDeviceWorkItem)
|
|
|
|
IoFreeWorkItem(DeviceExtension->ResetDeviceWorkItem);
|
2019-06-10 22:31:44 +00:00
|
|
|
if (DeviceExtension->SerialNumber)
|
|
|
|
ExFreePoolWithTag(DeviceExtension->SerialNumber, USB_STOR_TAG);
|
|
|
|
|
2019-03-24 20:01:43 +00:00
|
|
|
// Send the IRP down the stack
|
2012-01-22 21:58:06 +00:00
|
|
|
IoSkipCurrentIrpStackLocation(Irp);
|
2019-06-10 22:31:44 +00:00
|
|
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
2012-01-22 21:58:06 +00:00
|
|
|
Status = IoCallDriver(DeviceExtension->LowerDeviceObject, Irp);
|
|
|
|
|
2019-03-24 20:01:43 +00:00
|
|
|
// Detach from the device stack
|
2012-01-23 00:39:28 +00:00
|
|
|
IoDetachDevice(DeviceExtension->LowerDeviceObject);
|
2012-01-22 21:58:06 +00:00
|
|
|
|
|
|
|
IoDeleteDevice(DeviceObject);
|
|
|
|
|
|
|
|
return Status;
|
|
|
|
}
|
|
|
|
|
2011-05-03 00:15:23 +00:00
|
|
|
NTSTATUS
|
|
|
|
USBSTOR_FdoHandleStartDevice(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PFDO_DEVICE_EXTENSION DeviceExtension,
|
|
|
|
IN OUT PIRP Irp)
|
|
|
|
{
|
2011-05-13 09:14:28 +00:00
|
|
|
PUSB_INTERFACE_DESCRIPTOR InterfaceDesc;
|
2011-05-03 00:15:23 +00:00
|
|
|
NTSTATUS Status;
|
|
|
|
UCHAR Index = 0;
|
2019-04-13 12:48:14 +00:00
|
|
|
PIO_WORKITEM WorkItem;
|
2011-05-03 00:15:23 +00:00
|
|
|
|
|
|
|
// forward irp to lower device
|
2022-01-04 00:56:52 +00:00
|
|
|
if (!IoForwardIrpSynchronously(DeviceExtension->LowerDeviceObject, Irp))
|
|
|
|
{
|
|
|
|
return STATUS_UNSUCCESSFUL;
|
|
|
|
}
|
|
|
|
|
|
|
|
Status = Irp->IoStatus.Status;
|
2011-05-03 00:15:23 +00:00
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
DPRINT1("USBSTOR_FdoHandleStartDevice Lower device failed to start %x\n", Status);
|
|
|
|
return Status;
|
|
|
|
}
|
|
|
|
|
2019-04-13 12:48:14 +00:00
|
|
|
if (!DeviceExtension->ResetDeviceWorkItem)
|
|
|
|
{
|
|
|
|
WorkItem = IoAllocateWorkItem(DeviceObject);
|
|
|
|
DeviceExtension->ResetDeviceWorkItem = WorkItem;
|
|
|
|
|
|
|
|
if (!WorkItem)
|
|
|
|
{
|
|
|
|
return STATUS_INSUFFICIENT_RESOURCES;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-13 15:31:39 +00:00
|
|
|
// initialize irp queue
|
2011-05-14 18:09:00 +00:00
|
|
|
USBSTOR_QueueInitialize(DeviceExtension);
|
|
|
|
|
2011-05-03 00:15:23 +00:00
|
|
|
// first get device & configuration & string descriptor
|
|
|
|
Status = USBSTOR_GetDescriptors(DeviceObject);
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
DPRINT1("USBSTOR_FdoHandleStartDevice failed to get device descriptor with %x\n", Status);
|
|
|
|
return Status;
|
|
|
|
}
|
|
|
|
|
2019-06-25 16:04:20 +00:00
|
|
|
#if DBG
|
2011-05-03 00:15:23 +00:00
|
|
|
USBSTOR_DumpDeviceDescriptor(DeviceExtension->DeviceDescriptor);
|
2019-06-25 16:04:20 +00:00
|
|
|
#endif
|
2019-03-24 20:01:43 +00:00
|
|
|
|
2011-05-13 09:14:28 +00:00
|
|
|
// Check that this device uses bulk transfers and is SCSI
|
2012-02-02 19:37:38 +00:00
|
|
|
|
2019-03-24 20:01:43 +00:00
|
|
|
InterfaceDesc = (PUSB_INTERFACE_DESCRIPTOR)((ULONG_PTR)DeviceExtension->ConfigurationDescriptor + sizeof(USB_CONFIGURATION_DESCRIPTOR));
|
2012-02-02 19:37:38 +00:00
|
|
|
ASSERT(InterfaceDesc->bDescriptorType == USB_INTERFACE_DESCRIPTOR_TYPE);
|
|
|
|
ASSERT(InterfaceDesc->bLength == sizeof(USB_INTERFACE_DESCRIPTOR));
|
|
|
|
|
2012-02-12 02:53:34 +00:00
|
|
|
DPRINT("bInterfaceSubClass %x\n", InterfaceDesc->bInterfaceSubClass);
|
2019-11-09 22:05:47 +00:00
|
|
|
if (InterfaceDesc->bInterfaceProtocol != USB_PROTOCOL_BULK)
|
2011-05-13 09:14:28 +00:00
|
|
|
{
|
|
|
|
DPRINT1("USB Device is not a bulk only device and is not currently supported\n");
|
|
|
|
return STATUS_NOT_SUPPORTED;
|
|
|
|
}
|
2012-02-02 19:37:38 +00:00
|
|
|
|
2019-11-09 22:05:47 +00:00
|
|
|
if (InterfaceDesc->bInterfaceSubClass == USB_SUBCLASS_UFI)
|
2012-02-02 19:37:38 +00:00
|
|
|
{
|
2019-11-09 22:05:47 +00:00
|
|
|
DPRINT1("USB Floppy devices are not supported\n");
|
2019-04-27 20:29:45 +00:00
|
|
|
return STATUS_NOT_SUPPORTED;
|
2012-02-02 19:37:38 +00:00
|
|
|
}
|
2011-05-13 09:14:28 +00:00
|
|
|
|
2011-05-03 00:15:23 +00:00
|
|
|
// now select an interface
|
|
|
|
Status = USBSTOR_SelectConfigurationAndInterface(DeviceObject, DeviceExtension);
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
// failed to get device descriptor
|
|
|
|
DPRINT1("USBSTOR_FdoHandleStartDevice failed to select configuration / interface with %x\n", Status);
|
|
|
|
return Status;
|
|
|
|
}
|
|
|
|
|
|
|
|
// check if we got a bulk in + bulk out endpoint
|
|
|
|
Status = USBSTOR_GetPipeHandles(DeviceExtension);
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
DPRINT1("USBSTOR_FdoHandleStartDevice no pipe handles %x\n", Status);
|
|
|
|
return Status;
|
|
|
|
}
|
|
|
|
|
|
|
|
Status = USBSTOR_GetMaxLUN(DeviceExtension->LowerDeviceObject, DeviceExtension);
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
DPRINT1("USBSTOR_FdoHandleStartDevice failed to get max lun %x\n", Status);
|
|
|
|
return Status;
|
|
|
|
}
|
|
|
|
|
|
|
|
// now create for each LUN a device object, 1 minimum
|
|
|
|
do
|
|
|
|
{
|
2012-10-22 11:33:26 +00:00
|
|
|
Status = USBSTOR_CreatePDO(DeviceObject, Index);
|
2011-05-03 00:15:23 +00:00
|
|
|
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
DPRINT1("USBSTOR_FdoHandleStartDevice USBSTOR_CreatePDO failed for Index %lu with Status %x\n", Index, Status);
|
|
|
|
return Status;
|
|
|
|
}
|
|
|
|
|
|
|
|
Index++;
|
2012-10-22 11:33:26 +00:00
|
|
|
DeviceExtension->InstanceCount++;
|
2011-05-03 00:15:23 +00:00
|
|
|
|
2019-03-24 20:01:43 +00:00
|
|
|
} while(Index < DeviceExtension->MaxLUN);
|
2011-05-03 00:15:23 +00:00
|
|
|
|
2011-06-02 15:35:04 +00:00
|
|
|
#if 0
|
2011-05-03 00:15:23 +00:00
|
|
|
//
|
|
|
|
// finally get usb device interface
|
|
|
|
//
|
|
|
|
Status = USBSTOR_GetBusInterface(DeviceExtension->LowerDeviceObject, &DeviceExtension->BusInterface);
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
//
|
|
|
|
// failed to device interface
|
|
|
|
//
|
2011-06-02 15:35:04 +00:00
|
|
|
DPRINT1("USBSTOR_FdoHandleStartDevice failed to get device interface %x\n", Status);
|
2011-05-03 00:15:23 +00:00
|
|
|
return Status;
|
|
|
|
}
|
2011-06-02 15:35:04 +00:00
|
|
|
#endif
|
2011-05-03 00:15:23 +00:00
|
|
|
|
2012-02-17 03:02:14 +00:00
|
|
|
//IoStartTimer(DeviceObject);
|
|
|
|
|
2012-02-12 02:53:34 +00:00
|
|
|
DPRINT("USBSTOR_FdoHandleStartDevice FDO is initialized\n");
|
2011-05-03 00:15:23 +00:00
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
USBSTOR_FdoHandlePnp(
|
|
|
|
IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN OUT PIRP Irp)
|
|
|
|
{
|
|
|
|
PIO_STACK_LOCATION IoStack;
|
|
|
|
PFDO_DEVICE_EXTENSION DeviceExtension;
|
|
|
|
NTSTATUS Status;
|
|
|
|
|
|
|
|
IoStack = IoGetCurrentIrpStackLocation(Irp);
|
|
|
|
DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
|
|
|
ASSERT(DeviceExtension->Common.IsFDO);
|
|
|
|
|
|
|
|
switch(IoStack->MinorFunction)
|
|
|
|
{
|
2019-03-24 20:01:43 +00:00
|
|
|
case IRP_MN_SURPRISE_REMOVAL:
|
|
|
|
{
|
|
|
|
DPRINT("IRP_MN_SURPRISE_REMOVAL %p\n", DeviceObject);
|
|
|
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
2012-10-22 11:33:26 +00:00
|
|
|
|
|
|
|
// forward irp to next device object
|
|
|
|
IoSkipCurrentIrpStackLocation(Irp);
|
|
|
|
return IoCallDriver(DeviceExtension->LowerDeviceObject, Irp);
|
2019-03-24 20:01:43 +00:00
|
|
|
}
|
|
|
|
case IRP_MN_QUERY_DEVICE_RELATIONS:
|
|
|
|
{
|
2019-06-10 23:50:43 +00:00
|
|
|
DPRINT("IRP_MN_QUERY_DEVICE_RELATIONS %p Type: %u\n", DeviceObject, IoStack->Parameters.QueryDeviceRelations.Type);
|
|
|
|
return USBSTOR_FdoHandleDeviceRelations(DeviceExtension, Irp);
|
2019-03-24 20:01:43 +00:00
|
|
|
}
|
|
|
|
case IRP_MN_STOP_DEVICE:
|
|
|
|
{
|
|
|
|
DPRINT1("USBSTOR_FdoHandlePnp: IRP_MN_STOP_DEVICE unimplemented\n");
|
|
|
|
IoStopTimer(DeviceObject);
|
|
|
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
2012-02-17 03:02:14 +00:00
|
|
|
|
|
|
|
// forward irp to next device object
|
|
|
|
IoSkipCurrentIrpStackLocation(Irp);
|
|
|
|
return IoCallDriver(DeviceExtension->LowerDeviceObject, Irp);
|
2019-03-24 20:01:43 +00:00
|
|
|
}
|
|
|
|
case IRP_MN_REMOVE_DEVICE:
|
|
|
|
{
|
|
|
|
DPRINT("IRP_MN_REMOVE_DEVICE\n");
|
|
|
|
|
|
|
|
return USBSTOR_FdoHandleRemoveDevice(DeviceObject, DeviceExtension, Irp);
|
|
|
|
}
|
|
|
|
case IRP_MN_QUERY_CAPABILITIES:
|
|
|
|
{
|
|
|
|
// FIXME: set custom capabilities
|
|
|
|
IoSkipCurrentIrpStackLocation(Irp);
|
|
|
|
return IoCallDriver(DeviceExtension->LowerDeviceObject, Irp);
|
|
|
|
}
|
|
|
|
case IRP_MN_QUERY_STOP_DEVICE:
|
|
|
|
case IRP_MN_QUERY_REMOVE_DEVICE:
|
|
|
|
{
|
2020-12-06 20:32:29 +00:00
|
|
|
if (DeviceExtension->IrpPendingCount != 0 || DeviceExtension->ActiveSrb != NULL)
|
2019-03-24 20:01:43 +00:00
|
|
|
{
|
|
|
|
/* We have pending requests */
|
|
|
|
DPRINT1("Failing removal/stop request due to pending requests present\n");
|
|
|
|
Status = STATUS_UNSUCCESSFUL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* We're all clear */
|
|
|
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
|
|
|
|
|
|
|
IoSkipCurrentIrpStackLocation(Irp);
|
|
|
|
return IoCallDriver(DeviceExtension->LowerDeviceObject, Irp);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case IRP_MN_START_DEVICE:
|
|
|
|
{
|
|
|
|
Status = USBSTOR_FdoHandleStartDevice(DeviceObject, DeviceExtension, Irp);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
2011-05-03 00:15:23 +00:00
|
|
|
{
|
|
|
|
// forward irp to next device object
|
|
|
|
IoSkipCurrentIrpStackLocation(Irp);
|
|
|
|
return IoCallDriver(DeviceExtension->LowerDeviceObject, Irp);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Status != STATUS_PENDING)
|
|
|
|
{
|
|
|
|
Irp->IoStatus.Status = Status;
|
|
|
|
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
|
|
|
}
|
|
|
|
|
|
|
|
return Status;
|
|
|
|
}
|