94 SrbProcessing = FDODeviceExtension->IrpPendingCount != 0;
102 FDODeviceExtension->IrpPendingCount++;
115 ASSERT(FDODeviceExtension->ActiveSrb !=
NULL);
121 ASSERT(FDODeviceExtension->ActiveSrb ==
NULL);
123 FDODeviceExtension->ActiveSrb =
Request;
128 if (
Irp->Cancel && OldDriverCancel ==
NULL)
138 DPRINT(
"IrpListFreeze: %lu IrpPendingCount %lu\n", IrpListFreeze, FDODeviceExtension->IrpPendingCount);
140 return (IrpListFreeze || SrbProcessing);
157 if (!
IsListEmpty(&FDODeviceExtension->IrpListHead))
200 FDODeviceExtension->IrpPendingCount--;
203 if (FDODeviceExtension->ActiveSrb ==
Request)
206 FDODeviceExtension->ActiveSrb =
NULL;
210 if (FDODeviceExtension->IrpPendingCount == 0 &&
211 FDODeviceExtension->ActiveSrb ==
NULL)
232 if (FDODeviceExtension->ActiveSrb !=
NULL ||
254 FDODeviceExtension->ActiveSrb =
Request;
277 FDODeviceExtension->
Flags &= ~USBSTOR_FDO_FLAGS_IRP_LIST_FREEZE;
311 DPRINT(
"USBSTOR_StartIo\n");
326 Irp->IoStatus.Information = 0;
350 Request->DataTransferLength = 0;
351 Irp->IoStatus.Information = 0;
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
#define ASSERT_IRQL_EQUAL(x)
struct _SCSI_REQUEST_BLOCK * PSCSI_REQUEST_BLOCK
#define SRB_STATUS_NO_DEVICE
VOID NTAPI USBSTOR_Cancel(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
BOOLEAN USBSTOR_QueueAddIrp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
VOID USBSTOR_QueueRelease(IN PDEVICE_OBJECT DeviceObject)
PIRP USBSTOR_RemoveIrp(IN PDEVICE_OBJECT DeviceObject)
VOID USBSTOR_QueueInitialize(PFDO_DEVICE_EXTENSION FDODeviceExtension)
VOID USBSTOR_QueueTerminateRequest(IN PDEVICE_OBJECT FDODeviceObject, IN PIRP Irp)
VOID USBSTOR_QueueWaitForPendingRequests(IN PDEVICE_OBJECT DeviceObject)
VOID USBSTOR_QueueNextRequest(IN PDEVICE_OBJECT DeviceObject)
VOID NTAPI USBSTOR_CancelIo(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
VOID NTAPI USBSTOR_StartIo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeReleaseSpinLock(sl, irql)
#define KeSetEvent(pEvt, foo, foo2)
#define KeAcquireSpinLock(sl, irql)
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
#define KeInitializeSpinLock(sl)
VOID NTAPI KeClearEvent(IN PKEVENT Event)
#define BooleanFlagOn(F, SF)
IoSetCancelRoutine(Irp, CancelRoutine)
VOID NTAPI IoStartPacket(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PULONG Key, IN PDRIVER_CANCEL CancelFunction)
VOID NTAPI IoStartNextPacket(IN PDEVICE_OBJECT DeviceObject, IN BOOLEAN Cancelable)
#define IoCompleteRequest
VOID NTAPI IoReleaseCancelSpinLock(IN KIRQL Irql)
VOID NTAPI IoAcquireCancelSpinLock(OUT PKIRQL Irql)
#define STATUS_DEVICE_DOES_NOT_EXIST
#define KeAcquireSpinLockAtDpcLevel(SpinLock)
#define KeReleaseSpinLockFromDpcLevel(SpinLock)
base of all file and directory entries
COMMON_DEVICE_EXTENSION Common
PDEVICE_OBJECT DeviceObject
struct _IO_STACK_LOCATION::@3978::@4017 Others
union _IO_STACK_LOCATION::@1579 Parameters
struct _IO_STACK_LOCATION::@3978::@4000 Scsi
COMMON_DEVICE_EXTENSION Common
#define CONTAINING_RECORD(address, type, field)
NTSTATUS USBSTOR_HandleExecuteSCSI(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
#define USBSTOR_FDO_FLAGS_DEVICE_RESETTING
#define USBSTOR_FDO_FLAGS_IRP_LIST_FREEZE
_In_ PDEVICE_OBJECT DeviceObject
DRIVER_CANCEL * PDRIVER_CANCEL