30#include "obsolete.tmh"
37 #pragma alloc_text(PAGE, ClassDeleteSrbLookasideList)
38 #pragma alloc_text(PAGE, ClassInitializeSrbLookasideList)
39 #pragma alloc_text(PAGE, ClasspInitializeCScanList)
67 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_RW,
"ClassSplitRequest - driver requesting split to size that "
68 "hardware is unable to handle!\n"));
71 if (MaximumBytes < fdoData->HwMaxXferLen){
72 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_RW,
"ClassSplitRequest - driver requesting smaller HwMaxXferLen "
128 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_GENERAL,
"ClassIoCompleteAssociated is OBSOLETE !"));
173#pragma warning(suppress:4213)
249 (originalIrp->Tail.Overlay.Thread !=
NULL)) {
284 "ClassIoCompleteAssociated: All partial IRPs complete %p\n",
296 UCHAR uniqueAddress = 0;
369 ULONG transferByteCount;
370 ULONG dataTransferLength;
390 }
else if (
Irp->MdlAddress !=
NULL) {
401 transferByteCount =
Irp->MdlAddress->ByteCount;
405 transferByteCount = 0;
425 srbHeader->SrbStatus = 0;
535#pragma prefast(suppress:28194)
582 ULONG logicalBlockAddress;
599 logicalBlockAddress =
700 cdb->
CDB10.LogicalBlockByte0 = ((
PFOUR_BYTE)&logicalBlockAddress)->Byte3;
701 cdb->
CDB10.LogicalBlockByte1 = ((
PFOUR_BYTE)&logicalBlockAddress)->Byte2;
702 cdb->
CDB10.LogicalBlockByte2 = ((
PFOUR_BYTE)&logicalBlockAddress)->Byte1;
703 cdb->
CDB10.LogicalBlockByte3 = ((
PFOUR_BYTE)&logicalBlockAddress)->Byte0;
787 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_GENERAL,
"ClasspInsertCScanList is OBSOLETE !"));
799 if(
Entry->BlockNumber <
t->BlockNumber) {
860 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_GENERAL,
"ClassInsertCScanList is OBSOLETE !"));
865 entry->BlockNumber = BlockNumber;
872 if((LowPriority !=
TRUE) && (BlockNumber >
List->BlockNumber)) {
929 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_GENERAL,
"ClassFreeOrReuseSrb: someone is trying to use an uninitialized SrbLookasideList !!!"));
966 if (CommonExtension->IsSrbLookasideListInitialized){
967 CommonExtension->IsSrbLookasideListInitialized =
FALSE;
971 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_GENERAL,
"ClassDeleteSrbLookasideList: attempt to delete uninitialized or freed srblookasidelist"));
1016 NT_ASSERT(!CommonExtension->IsSrbLookasideListInitialized);
1017 if (!CommonExtension->IsSrbLookasideListInitialized){
1019 if (CommonExtension->IsFdo ==
TRUE) {
1054 CommonExtension->IsSrbLookasideListInitialized =
TRUE;
1088 List->CurrentSweep =
List->NextSweep;
1101 List->CurrentSweep.Flink->Blink = &(
List->CurrentSweep);
1102 List->CurrentSweep.Blink->Flink = &(
List->CurrentSweep);
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define InterlockedDecrement
_In_ PSCSI_REQUEST_BLOCK Srb
FORCEINLINE BOOLEAN PORT_ALLOCATED_SENSE(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ PSCSI_REQUEST_BLOCK Srb)
#define FREE_POOL(_PoolPtr)
FORCEINLINE VOID FREE_PORT_ALLOCATED_SENSE_BUFFER(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ PSCSI_REQUEST_BLOCK Srb)
#define SRB_CLASS_FLAGS_PAGING
#define TEST_FLAG(Flags, Bit)
NTSTATUS InitializeStorageRequestBlock(_Inout_bytecount_(ByteSize) PSTORAGE_REQUEST_BLOCK Srb, _In_ USHORT AddressType, _In_ ULONG ByteSize, _In_ ULONG NumSrbExData,...)
FORCEINLINE UCHAR GET_FDO_EXTENSON_SENSE_DATA_LENGTH(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
#define ClasspFreeSrb(ext, srb)
#define ClassAcquireRemoveLock(devobj, tag)
#define ClasspAllocateSrb(ext)
struct _FUNCTIONAL_DEVICE_EXTENSION * PFUNCTIONAL_DEVICE_EXTENSION
#define CLASS_SRBEX_SCSI_CDB16_BUFFER_SIZE
_In_ ULONG NumberElements
#define NT_SUCCESS(StatCode)
NTSTATUS NTAPI ClassIoComplete(IN PDEVICE_OBJECT Fdo, IN PIRP Irp, IN PVOID Context)
VOID ClassRetryRequest(IN PDEVICE_OBJECT SelfDeviceObject, IN PIRP Irp, _In_ _In_range_(0, MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) IN LONGLONG TimeDelta100ns)
NTSTATUS ServiceTransferRequest(PDEVICE_OBJECT Fdo, PIRP Irp, BOOLEAN PostToDpc)
VOID NTAPI ClassReleaseQueue(_In_ PDEVICE_OBJECT Fdo)
BOOLEAN InterpretSenseInfoWithoutHistory(_In_ PDEVICE_OBJECT Fdo, _In_opt_ PIRP OriginalRequest, _In_ PSCSI_REQUEST_BLOCK Srb, UCHAR MajorFunctionCode, ULONG IoDeviceCode, ULONG PreviousRetryCount, _Out_ NTSTATUS *Status, _Out_opt_ _Deref_out_range_(0, MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) LONGLONG *RetryIn100nsUnits)
VOID NTAPI ClassCompleteRequest(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp, _In_ CCHAR PriorityBoost)
VOID NTAPI ClassReleaseRemoveLock(_In_ PDEVICE_OBJECT DeviceObject, _In_opt_ PIRP Tag)
struct _CSCAN_LIST_ENTRY * PCSCAN_LIST_ENTRY
VOID RetryRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp, PSCSI_REQUEST_BLOCK Srb, BOOLEAN Associated, LONGLONG TimeDelta100ns)
PIRP ClassRemoveCScanList(IN PCSCAN_LIST List)
VOID ClasspInitializeCScanList(IN PCSCAN_LIST List)
VOID ClasspInsertCScanList(IN PLIST_ENTRY ListHead, IN PCSCAN_LIST_ENTRY Entry)
NTSTATUS NTAPI ClassIoCompleteAssociated(IN PDEVICE_OBJECT Fdo, IN PIRP Irp, IN PVOID Context)
VOID ClasspBuildRequestEx(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _In_ PIRP Irp, _In_ __drv_aliasesMem PSCSI_REQUEST_BLOCK Srb)
VOID NTAPI ClassSplitRequest(_In_ PDEVICE_OBJECT Fdo, _In_ PIRP Irp, _In_ ULONG MaximumBytes)
VOID ClasspStartNextSweep(PCSCAN_LIST List)
struct _CSCAN_LIST_ENTRY CSCAN_LIST_ENTRY
NTSTATUS NTAPI ClassBuildRequest(_In_ PDEVICE_OBJECT Fdo, _In_ PIRP Irp)
VOID ClassFreeOrReuseSrb(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN __drv_freesMem(mem) PSCSI_REQUEST_BLOCK Srb)
VOID ClassInsertCScanList(IN PCSCAN_LIST List, IN PIRP Irp, IN ULONGLONG BlockNumber, IN BOOLEAN LowPriority)
struct _SCSI_REQUEST_BLOCK SCSI_REQUEST_BLOCK
#define SRB_FLAGS_FREE_SENSE_BUFFER
#define SRB_FUNCTION_EXECUTE_SCSI
#define SRB_FLAGS_DATA_OUT
#define SRB_FLAGS_DISABLE_DISCONNECT
#define SRB_SIMPLE_TAG_REQUEST
#define SRB_FLAGS_QUEUE_ACTION_ENABLE
#define SRB_FLAGS_DATA_IN
#define SRB_FLAGS_ADAPTER_CACHE_ENABLE
#define SRB_FLAGS_DISABLE_SYNCH_TRANSFER
#define SRB_STATUS(Status)
#define SRB_STATUS_QUEUE_FROZEN
#define SRB_STATUS_SUCCESS
#define __drv_freesMem(kind)
#define _IRQL_requires_max_(irql)
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define KeRaiseIrql(irql, oldIrql)
#define KeLowerIrql(oldIrql)
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
VOID NTAPI ExDeleteNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside)
VOID NTAPI ExInitializeNPagedLookasideList(IN PNPAGED_LOOKASIDE_LIST Lookaside, IN PALLOCATE_FUNCTION Allocate OPTIONAL, IN PFREE_FUNCTION Free OPTIONAL, IN ULONG Flags, IN SIZE_T Size, IN ULONG Tag, IN USHORT Depth)
#define _Analysis_assume_(expr)
#define Int64ShrlMod32(a, b)
VOID NTAPI IoStartNextPacket(IN PDEVICE_OBJECT DeviceObject, IN BOOLEAN Cancelable)
VOID NTAPI IoFreeIrp(IN PIRP Irp)
VOID NTAPI IoSetHardErrorOrVerifyDevice(IN PIRP Irp, IN PDEVICE_OBJECT DeviceObject)
#define IRP_MJ_DEVICE_CONTROL
#define SRB_TYPE_STORAGE_REQUEST_BLOCK
#define STORAGE_ADDRESS_TYPE_BTL8
struct SRB_ALIGN _STORAGE_REQUEST_BLOCK_HEADER * PSTORAGE_REQUEST_BLOCK_HEADER
#define STATUS_MORE_PROCESSING_REQUIRED
FORCEINLINE VOID SrbSetSrbFlags(_In_ PVOID Srb, _In_ ULONG Flags)
FORCEINLINE VOID SrbSetRequestAttribute(_In_ PVOID Srb, _In_ UCHAR RequestAttribute)
FORCEINLINE VOID SrbSetQueueSortKey(_In_ PVOID Srb, _In_ ULONG QueueSortKey)
FORCEINLINE VOID SrbSetDataTransferLength(_In_ PVOID Srb, _In_ ULONG DataTransferLength)
FORCEINLINE VOID SrbSetOriginalRequest(_In_ PVOID Srb, _In_opt_ PVOID OriginalRequest)
FORCEINLINE VOID SrbClearSrbFlags(_In_ PVOID Srb, _In_ ULONG Flags)
FORCEINLINE VOID SrbSetScsiStatus(_In_ PVOID Srb, _In_ UCHAR ScsiStatus)
FORCEINLINE VOID SrbSetSenseInfoBufferLength(_In_ PVOID Srb, _In_ UCHAR SenseInfoBufferLength)
FORCEINLINE ULONG SrbGetSrbFlags(_In_ PVOID Srb)
FORCEINLINE VOID SrbSetQueueTag(_In_ PVOID Srb, _In_ ULONG QueueTag)
FORCEINLINE VOID SrbSetSenseInfoBuffer(_In_ PVOID Srb, _In_opt_ PVOID SenseInfoBuffer)
FORCEINLINE VOID SrbSetDataBuffer(_In_ PVOID Srb, _In_opt_ __drv_aliasesMem PVOID DataBuffer)
FORCEINLINE VOID SrbSetCdbLength(_In_ PVOID Srb, _In_ UCHAR CdbLength)
FORCEINLINE PVOID SrbGetDataBuffer(_In_ PVOID Srb)
FORCEINLINE VOID SrbSetTimeOutValue(_In_ PVOID Srb, _In_ ULONG TimeOutValue)
FORCEINLINE ULONG SrbGetDataTransferLength(_In_ PVOID Srb)
#define TRACE_LEVEL_WARNING
#define TRACE_LEVEL_ERROR
#define TRACE_LEVEL_INFORMATION
base of all file and directory entries
PDRIVER_STARTIO ClassStartIo
PCLASS_DRIVER_EXTENSION DriverExtension
BOOLEAN IsSrbLookasideListInitialized
COMMON_DEVICE_EXTENSION CommonExtension
PSTORAGE_ADAPTER_DESCRIPTOR AdapterDescriptor
struct _IO_STACK_LOCATION::@3974::@3996 Scsi
struct _IO_STACK_LOCATION::@3974::@3978 Read
struct _IO_STACK_LOCATION::@1575::@1576 DeviceIoControl
union _IO_STACK_LOCATION::@1575 Parameters
struct _IO_STACK_LOCATION::@3974::@4013 Others
union _IRP::@1577 AssociatedIrp
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_IO_DEVICE_ERROR
#define STATUS_VERIFY_REQUIRED
#define STATUS_INSUFFICIENT_RESOURCES
struct _CDB::_CDB10 CDB10
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ WDFDEVICE Fdo
_Must_inspect_result_ _In_ WDFCMRESLIST List
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
#define IoIsErrorUserInduced(Status)
#define SL_OVERRIDE_VERIFY_VOLUME
#define POOL_NX_ALLOCATION
#define IO_DISK_INCREMENT
#define IRP_SYNCHRONOUS_PAGING_IO
#define MmGetMdlVirtualAddress(_Mdl)