NTAPI
USBSTOR_SyncForwardIrpCompletionRoutine(
PDEVICE_OBJECT DeviceObject,
- PIRP Irp,
+ PIRP Irp,
PVOID Context)
{
if (Irp->PendingReturned)
DPRINT("MaxLUN: %x\n", *Buffer);
- if (*Buffer > 0xF)
+ if (NT_SUCCESS(Status))
{
- //
- // invalid response documented in usb mass storage specification
- //
- Status = STATUS_DEVICE_DATA_ERROR;
+ if (*Buffer > 0xF)
+ {
+ //
+ // invalid response documented in usb mass storage specification
+ //
+ Status = STATUS_DEVICE_DATA_ERROR;
+ }
+ else
+ {
+ //
+ // store maxlun
+ //
+ DeviceExtension->MaxLUN = *Buffer;
+ }
}
else
{
//
- // store maxlun
+ // "USB Mass Storage Class. Bulk-Only Transport. Revision 1.0"
+ // 3.2 Get Max LUN (class-specific request) :
+ // Devices that do not support multiple LUNs may STALL this command.
//
- DeviceExtension->MaxLUN = *Buffer;
+ USBSTOR_ResetDevice(DeviceExtension->LowerDeviceObject, DeviceExtension);
+
+ DeviceExtension->MaxLUN = 0;
+ Status = STATUS_SUCCESS;
}
//