48#pragma alloc_text(PAGE, SenseInfoInterpretRefineByIoControl)
69#define TOTAL_COUNT_RETRY_DEFAULT 4
70#define TOTAL_COUNT_RETRY_LOCK_MEDIA 1
71#define TOTAL_COUNT_RETRY_MODESENSE 1
72#define TOTAL_COUNT_RETRY_READ_CAPACITY 1
75#define TOTAL_SECONDS_RETRY_TIME_WRITE 160
76#define TOTAL_SECONDS_RETRY_TIME_MEDIUM_REMOVAL 120
131 switch (senseBuffer->
SenseKey & 0xf)
138 if (DeviceExtension->DeviceAdditionalData.Mmc.WriteAllowed)
141 "DeviceErrorHandlerForMmc: media removed, writes will be "
142 "failed until new media detected\n"));
146 DeviceExtension->DeviceAdditionalData.Mmc.WriteAllowed =
FALSE;
153 "DeviceErrorHandlerForMmc: media becoming ready, "
154 "SHOULD notify shell of change time by sending "
155 "GESN request immediately!\n"));
174 "DeviceErrorHandlerForMmc: LONG_WRITE or "
175 "OP_IN_PROGRESS for limited subset of cmds -- "
176 "setting retry to TRUE\n"));
193 DeviceExtension->DeviceAdditionalData.Mmc.WriteAllowed =
FALSE;
197 "DeviceErrorHandlerForMmc: media change detected, need to "
198 "update drive capabilities\n"));
207 DeviceExtension->DeviceAdditionalData.Mmc.WriteAllowed =
FALSE;
211 "DeviceErrorHandlerForMmc: bus reset detected, need to "
212 "update drive capabilities\n"));
228 "DeviceErrorHandlerForMmc: Eject requested by user\n"));
239 "DeviceErrorHandlerForMmc: Write protect %s requested "
241 (
b ?
"disable" :
"enable")));
245 DeviceExtension->DeviceAdditionalData.Mmc.WriteAllowed =
FALSE;
261 "DeviceErrorHandlerForMmc: Unit attention %02x/%02x\n",
276 if (DeviceExtension->DeviceAdditionalData.Mmc.WriteAllowed)
279 "DeviceErrorHandlerForMmc: media was writable, but "
280 "failed request with WRITE_PROTECT error...\n"));
285 DeviceExtension->DeviceAdditionalData.Mmc.WriteAllowed =
FALSE;
329 if (DeviceExtension->DeviceAdditionalData.RestoreDefaults ==
TRUE)
334 WDFWORKITEM workItem;
342 status = WdfWorkItemCreate(&workitemConfig,
350 WdfWorkItemEnqueue(workItem);
353 "DeviceErrorHandlerForMmc: Restore device default speed for %p\n",
354 DeviceExtension->DeviceObject));
406 "DeviceErrorHandlerForHitachiGD2000 (%p) => Internal Target "
407 "Failure Detected -- spinning up drive\n", DeviceExtension->Device));
438 *OverrideVerifyVolume =
FALSE;
439 *Total100nsSinceFirstSend = 0;
447 if (originalIrp !=
NULL)
452 if (originalIrpStack !=
NULL)
472 *Total100nsSinceFirstSend = tmp.
QuadPart;
477 *Total100nsSinceFirstSend = (
ULONGLONG) -1;
507 *RetryIntervalInSeconds = 0;
514 "SenseInfoInterpretByAdditionalSenseCode: Lun not ready\n"));
537 switch (AdditionalSenseCodeQual)
544 "SenseInfoInterpretByAdditionalSenseCode: Operation In Progress\n"));
546 needFurtherInterpret =
FALSE;
556 &GUID_IO_DEVICE_BECOMING_READY,
568 "SenseInfoInterpretByAdditionalSenseCode: In process of becoming ready\n"));
570 needFurtherInterpret =
FALSE;
580 &GUID_IO_DEVICE_BECOMING_READY,
590 "SenseInfoInterpretByAdditionalSenseCode: Long write in progress\n"));
592 needFurtherInterpret =
FALSE;
598 *RetryIntervalInSeconds = 0;
606 "SenseInfoInterpretByAdditionalSenseCode: Manual intervention required\n"));
608 needFurtherInterpret =
FALSE;
620 "SenseInfoInterpretByAdditionalSenseCode: Format in progress\n"));
622 needFurtherInterpret =
FALSE;
636 "SenseInfoInterpretByAdditionalSenseCode: Initializing command required\n"));
638 needFurtherInterpret =
FALSE;
642 *RetryIntervalInSeconds = 0;
662 "SenseInfoInterpretByAdditionalSenseCode: No Media in device.\n"));
664 needFurtherInterpret =
FALSE;
669 if (AdditionalSenseCodeQual == 0xCC)
687 switch (AdditionalSenseCodeQual)
692 needFurtherInterpret =
FALSE;
699 LogContext->UniqueErrorValue = 256;
707 needFurtherInterpret =
FALSE;
712 LogContext->LogError =
FALSE;
719 needFurtherInterpret =
FALSE;
724 LogContext->LogError =
FALSE;
725 LogContext->UniqueErrorValue = 256;
732 needFurtherInterpret =
TRUE;
742 switch (AdditionalSenseCodeQual)
747 needFurtherInterpret =
FALSE;
751 *RetryIntervalInSeconds = 0;
752 LogContext->LogError =
TRUE;
753 LogContext->UniqueErrorValue = 256;
760 needFurtherInterpret =
TRUE;
770 switch (AdditionalSenseCodeQual)
775 needFurtherInterpret =
FALSE;
779 *RetryIntervalInSeconds = 1;
780 LogContext->LogError =
TRUE;
781 LogContext->UniqueErrorValue = 257;
788 needFurtherInterpret =
TRUE;
798 needFurtherInterpret =
FALSE;
801 "SenseInfoInterpretByAdditionalSenseCode: Illegal block address\n"));
809 needFurtherInterpret =
FALSE;
812 "SenseInfoInterpretByAdditionalSenseCode: Invalid LUN\n"));
820 needFurtherInterpret =
FALSE;
825 "SenseInfoInterpretByAdditionalSenseCode: Key - Copy protection failure\n"));
827 switch (AdditionalSenseCodeQual)
831 "SenseInfoInterpretByAdditionalSenseCode: Authentication failure\n"));
836 "SenseInfoInterpretByAdditionalSenseCode: Key not present\n"));
841 "SenseInfoInterpretByAdditionalSenseCode: Key not established\n"));
846 "SenseInfoInterpretByAdditionalSenseCode: Read of scrambled sector w/o authentication\n"));
851 "SenseInfoInterpretByAdditionalSenseCode: Media region does not logical unit region\n"));
856 "SenseInfoInterpretByAdditionalSenseCode: Region set error -- region may be permanent\n"));
870 needFurtherInterpret =
FALSE;
873 "SenseInfoInterpretByAdditionalSenseCode: Key - Invalid CDB\n"));
886 *RetryIntervalInSeconds = 3;
893 needFurtherInterpret =
FALSE;
894 *RetryIntervalInSeconds = 0;
897 "SenseInfoInterpretByAdditionalSenseCode: Media changed\n"));
920 switch (AdditionalSenseCodeQual)
924 needFurtherInterpret =
FALSE;
925 *RetryIntervalInSeconds = 0;
930 "SenseInfoInterpretByAdditionalSenseCode: Ejection request received!\n"));
933 &GUID_IO_MEDIA_EJECT_REQUEST,
954 needFurtherInterpret =
TRUE;
963 needFurtherInterpret =
FALSE;
964 *RetryIntervalInSeconds = 5;
971 "SenseInfoInterpretByAdditionalSenseCode: Device information changed. Invalidate the bus\n"));
996 needFurtherInterpret =
FALSE;
1000 LogContext->LogError =
TRUE;
1001 LogContext->UniqueErrorValue = 258;
1007 "SenseInfoInterpretByAdditionalSenseCode: Incorrect length detected.\n"));
1018 wmiEventData[
sizeof(
ULONG)] = AdditionalSenseCodeQual;
1020 needFurtherInterpret =
FALSE;
1031 LogContext->UniqueErrorValue = 258;
1032 LogContext->LogError =
TRUE;
1038 "SenseInfoInterpretByAdditionalSenseCode: Incorrect length detected.\n"));
1050 switch (AdditionalSenseCodeQual)
1054 needFurtherInterpret =
FALSE;
1062 needFurtherInterpret =
TRUE;
1071 needFurtherInterpret =
TRUE;
1076 return needFurtherInterpret;
1093 *RetryIntervalInSeconds = 0;
1100 "SenseInfoInterpretBySenseKey: Key - Not Ready (bad block)\n"));
1106 *RetryIntervalInSeconds = 0;
1113 "SenseInfoInterpretBySenseKey: Key - Media write protected\n"));
1122 "SenseInfoInterpretBySenseKey: Key - Medium Error (bad block)\n"));
1126 LogContext->LogError =
TRUE;
1127 LogContext->UniqueErrorValue = 256;
1136 "SenseInfoInterpretBySenseKey: Key - Hardware error\n"));
1140 LogContext->LogError =
TRUE;
1141 LogContext->UniqueErrorValue = 257;
1150 "SenseInfoInterpretBySenseKey: Key - Illegal SCSI request\n"));
1160 "SenseInfoInterpretBySenseKey: Key - Unit Attention\n"));
1188 "SenseInfoInterpretBySenseKey: Command aborted\n"));
1191 *RetryIntervalInSeconds = 1;
1198 "SenseInfoInterpretBySenseKey: Media blank check\n"));
1207 "SenseInfoInterpretBySenseKey: Recovered error\n"));
1210 LogContext->LogError =
TRUE;
1211 LogContext->UniqueErrorValue = 258;
1214 if (SenseData->IncorrectLength)
1217 "SenseInfoInterpretBySenseKey: Incorrect length detected.\n"));
1227 if (SenseData->IncorrectLength)
1230 "SenseInfoInterpretBySenseKey: Incorrect length detected.\n"));
1237 "SenseInfoInterpretBySenseKey: No specific sense key\n"));
1248 "SenseInfoInterpretBySenseKey: Unrecognized sense code\n"));
1251 *RetryIntervalInSeconds = 0;
1277 *RetryIntervalInSeconds = 0;
1298 *RetryIntervalInSeconds = 0;
1299 incrementErrorCount =
TRUE;
1308 *RetryIntervalInSeconds = 1;
1309 incrementErrorCount =
TRUE;
1317 *RetryIntervalInSeconds = 2;
1318 LogContext->LogError =
TRUE;
1320 LogContext->UniqueErrorValue = 260;
1334 incrementErrorCount =
TRUE;
1338 *
Retry = (RetriedCount <= 1);
1372 incrementErrorCount =
TRUE;
1390 incrementErrorCount =
TRUE;
1405 LogContext->LogError =
TRUE;
1407 LogContext->UniqueErrorValue = 259;
1408 LogContext->ErrorUnhandled =
TRUE;
1414 if (incrementErrorCount)
1418 if (*RetryIntervalInSeconds == 0)
1420 *RetryIntervalInSeconds = 1;
1444 ULONG totalSize = 0;
1445 ULONG senseBufferSize = 0;
1462 ULONG validSenseBytes;
1468 AdditionalSenseLength);
1473 validSenseBytes = senseBuffer->AdditionalSenseLength
1497 totalSize += senseBufferSize-
sizeof(
SENSE_DATA);
1521 staticErrLogEntry.FinalStatus = *
Status;
1529 LogContext->LogError =
FALSE;
1540 staticErrLogEntry.DeviceOffset.QuadPart = (
LONGLONG)LogContext->BadSector;
1541 staticErrLogEntry.DeviceOffset.QuadPart *= (
LONGLONG)DeviceExtension->DiskGeometry.BytesPerSector;
1543 if (LogContext->ErrorCode == -1)
1549 staticErrLogEntry.ErrorCode = LogContext->ErrorCode;
1555 staticErrLogEntry.SequenceNumber = 0;
1558 staticErrLogEntry.RetryCount = (
UCHAR)RetriedCount;
1559 staticErrLogEntry.UniqueErrorValue = LogContext->UniqueErrorValue;
1565 staticErrLogData.
Srb = *
Srb;
1568 if (senseBufferSize != 0)
1578 DeviceExtension->PrivateFdoData->ErrorLogs[DeviceExtension->PrivateFdoData->ErrorLogNextIndex] = staticErrLogData;
1579 DeviceExtension->PrivateFdoData->ErrorLogNextIndex++;
1587 if (LogContext->LogError)
1590 switch (((
PCDB)
Srb->
Cdb)->CDB10.OperationCode)
1594 if (DeviceExtension->PrivateFdoData->LoggedTURFailureSinceLastIO)
1596 LogContext->LogError =
FALSE;
1600 DeviceExtension->PrivateFdoData->LoggedTURFailureSinceLastIO =
TRUE;
1608 if (DeviceExtension->PrivateFdoData->LoggedSYNCFailure)
1610 LogContext->LogError =
FALSE;
1614 DeviceExtension->PrivateFdoData->LoggedSYNCFailure =
TRUE;
1627 senseBuffer->AdditionalSenseCodeQualifier == 0 &&
1630 LogContext->LogError =
FALSE;
1635 if (LogContext->LogError)
1645 *errorLogEntry = staticErrLogEntry;
1646 *errlogData = staticErrLogData;
1649 if (senseBufferSize != 0)
1703 if (( cdb->
AsByte[1] == 0) &&
1704 ( cdb->
AsByte[2] == 0) &&
1705 ( cdb->
AsByte[3] == 0) &&
1706 ((cdb->
AsByte[4] & 0xFC) == 0)
1710 if ((cdb->
AsByte[4] & 0x01) == 0)
1838 disableStreaming =
TRUE;
1845 disableStreaming =
TRUE;
1854 disableStreaming =
TRUE;
1858 if (disableStreaming)
1864 *RetryIntervalIn100ns = 0;
1881 if ((Total100nsSinceFirstSend < 0) ||
1898 *RetryIntervalIn100ns = DeviceExtension->DeviceAdditionalData.ReadWriteRetryDelay100nsUnits;
1928 "TYPE ONE GetConfiguration failed. Set hack flag and retry.\n"));
2021 (
VOID) MediaReadCapacity(DeviceExtension->Device);
2030 DeviceExtension->DeviceAdditionalData.RestoreDefaults =
FALSE;
2074 ULONG retryIntervalInSeconds = 0;
2077 ULONG readSector = 0;
2080 UCHAR majorFunctionCode = 0;
2081 ULONG ioControlCode = 0;
2096 &overrideVerifyVolume,
2097 &total100nsSinceFirstSend);
2112 "SenseInfoInterpret: Internal Error code is %x\n",
2129 UCHAR additionalSenseCodeQual = 0;
2146 "\tcdb: %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n"
2147 "\tsrb status: %X; sense: %02X/%02X/%02X; Retried count: %d\n\n",
2154 additionalSenseCodeQual,
2159 ULONG mediaChangeCount;
2164 "SenseInfoInterpret: Media change count for device %d incremented to %#lx\n",
2165 DeviceExtension->DeviceNumber, mediaChangeCount));
2168 if ((zpoddInfo !=
NULL) &&
2185 additionalSenseCodeQual,
2188 &retryIntervalInSeconds,
2198 &retryIntervalInSeconds,
2218 readSector = (readSector << 8) |
Srb->
Cdb[
index+2];
2237 "\tcdb: %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n"
2238 "\tsrb status: %X; sense info not valid; Retried count: %d\n\n",
2250 &retryIntervalInSeconds,
2260 if (DeviceExtension->DeviceAdditionalData.ErrorHandler)
2262 DeviceExtension->DeviceAdditionalData.ErrorHandler(DeviceExtension,
Srb,
Status, &retry);
2269 total100nsSinceFirstSend,
2270 overrideVerifyVolume,
2273 RetryIntervalIn100ns);
2280 overrideVerifyVolume,
2307 "Request %p was cancelled when it would have been retried\n",
2312 *RetryIntervalIn100ns = 0;
2320 "Command shall be retried in %2I64d.%03I64d seconds\n",
2322 (*RetryIntervalIn100ns / 10000) % 1000
2328 "Will not retry; Sense/ASC/ASCQ of %02x/%02x/%02x\n",
2375 ULONG readSector = 0;
2379 *RetryIntervalIn100ns = 0;
2397 UCHAR additionalSenseCodeQual = 0;
2419 "SenseInfoInterpretForZPODD: In process of becoming ready\n"));
2435 &GUID_IO_DEVICE_BECOMING_READY,
2446 "Command shall be retried in %2I64d.%03I64d seconds\n",
2448 (*RetryIntervalIn100ns / 10000) % 1000
2454 "Will not retry; Sense/ASC/ASCQ of %02x/%02x/%02x\n",
2508 if ((zpoddInfo !=
NULL) &&
2527 if ((zpoddInfo !=
NULL) &&
2533 &retryIntervalIn100ns);
2539 if ((zpoddInfo !=
NULL) &&
2550 &retryIntervalIn100ns);
2554 if (RetryIntervalIn100ns !=
NULL)
2556 *RetryIntervalIn100ns = retryIntervalIn100ns;
2590 NT_ASSERT(DeviceExtension->ScratchContext.ScratchInUse != 0);
2593 DeviceExtension->ScratchContext.ScratchRequest,
2594 DeviceExtension->ScratchContext.ScratchSrb,
2597 RetryIntervalIn100ns);
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define InterlockedIncrement
VOID DeviceSetMediaChangeStateEx(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ MEDIA_CHANGE_DETECTION_STATE NewState, _Inout_opt_ PMEDIA_CHANGE_DETECTION_STATE OldState)
_In_ PSCSI_REQUEST_BLOCK Srb
#define DEV_SAFE_START_UNIT
VOID DeviceReleaseQueue(_In_ WDFDEVICE Device)
#define CDROM_HACK_BAD_TYPE_ONE_GET_CONFIG
#define IS_SCSIOP_READ(opCode)
#define CdromMmcUpdateRequired
#define IS_SCSIOP_READWRITE(opCode)
FORCEINLINE BOOLEAN IsVolumeMounted(_In_ PDEVICE_OBJECT DeviceObject)
#define SRB_CLASS_FLAGS_LOW_PRIORITY
#define SECONDS_TO_100NS_UNITS(x)
#define SRB_CLASS_FLAGS_PAGING
VOID DevicePerfIncrementErrorCount(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension)
#define TEST_FLAG(Flags, Bit)
VOID DeviceSendNotification(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ const GUID *Guid, _In_ ULONG ExtraDataSize, _In_opt_ PVOID ExtraData)
#define SET_FLAG(Flags, Bit)
#define UNIT_100NS_PER_SECOND
VOID DeviceSendStartUnit(_In_ WDFDEVICE Device)
EVT_WDF_WORKITEM DeviceRestoreDefaultSpeed
struct _CDROM_ERROR_LOG_DATA * PCDROM_ERROR_LOG_DATA
#define FDO_HACK_NO_RESERVE6
#define FDO_HACK_NO_STREAMING
#define MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS
#define BECOMING_READY_RETRY_INTERNVAL_IN_100NS
#define NUM_ERROR_LOG_ENTRIES
#define SCSI_ADSENSE_ILLEGAL_BLOCK
#define SCSI_ADSENSE_LUN_NOT_READY
#define SCSIOP_MODE_SENSE10
#define SCSI_SENSEQ_MANUAL_INTERVENTION_REQUIRED
#define SCSI_SENSE_NO_SENSE
#define SCSI_SENSEQ_CLEANING_CARTRIDGE_INSTALLED
#define SCSI_SENSEQ_OPERATION_IN_PROGRESS
#define SCSI_SENSEQ_INCOMPATIBLE_FORMAT
#define SCSISTAT_RESERVATION_CONFLICT
#define SCSI_SENSEQ_AUTHENTICATION_FAILURE
#define SCSIOP_TEST_UNIT_READY
#define SCSI_ADSENSE_REC_DATA_NOECC
#define SCSI_ADSENSE_INVALID_LUN
#define SCSI_SENSE_DATA_PROTECT
#define SCSI_ADSENSE_INVALID_CDB
#define SCSI_ADSENSE_WRITE_PROTECT
#define SCSIOP_RELEASE_UNIT
#define SCSIOP_MEDIUM_REMOVAL
#define SCSIOP_GET_PERFORMANCE
#define SCSI_SENSEQ_KEY_NOT_ESTABLISHED
#define SCSI_SENSE_MEDIUM_ERROR
#define SCSI_SENSEQ_READ_OF_SCRAMBLED_SECTOR_WITHOUT_AUTHENTICATION
struct _SENSE_DATA * PSENSE_DATA
#define SCSI_SENSEQ_UNKNOWN_FORMAT
#define SCSIOP_READ_CAPACITY
#define SCSI_SENSEQ_MEDIA_CODE_MISMATCHED_TO_LOGICAL_UNIT
struct _SENSE_DATA SENSE_DATA
#define SCSI_SENSEQ_CAUSE_NOT_REPORTABLE
#define SCSI_SENSEQ_KEY_NOT_PRESENT
#define SCSIOP_RESERVE_UNIT
#define SCSI_ADSENSE_REC_DATA_ECC
#define NOT_READY_RETRY_INTERVAL
#define SCSI_SENSEQ_BECOMING_READY
#define SCSI_ADSENSE_INVALID_MEDIA
#define SCSI_SENSE_ILLEGAL_REQUEST
#define SCSI_SENSEQ_LOGICAL_UNIT_RESET_COUNT_ERROR
#define SCSIOP_MODE_SENSE
#define SCSI_SENSE_UNIT_ATTENTION
#define SCSI_ADSENSE_NO_MEDIA_IN_DEVICE
#define SCSI_SENSEQ_INIT_COMMAND_REQUIRED
#define SCSI_ADSENSE_MEDIUM_CHANGED
#define SCSIOP_READ_CD_MSF
#define SCSI_SENSE_BLANK_CHECK
#define SCSI_SENSE_HARDWARE_ERROR
#define SCSI_SENSE_RECOVERED_ERROR
#define SCSI_SENSE_NOT_READY
#define SCSI_SENSE_ABORTED_COMMAND
#define SCSI_ADSENSE_BUS_RESET
#define SCSI_SENSEQ_FORMAT_IN_PROGRESS
#define SCSIOP_SYNCHRONIZE_CACHE
#define SCSI_SENSEQ_LONG_WRITE_IN_PROGRESS
#define IOCTL_DISK_CHECK_VERIFY
_In_ PSCSI_REQUEST_BLOCK _Out_ NTSTATUS _Inout_ BOOLEAN * Retry
_In_opt_ PIRP _In_ PSCSI_REQUEST_BLOCK _In_ UCHAR MajorFunctionCode
#define NT_SUCCESS(StatCode)
#define SRB_STATUS_INVALID_LUN
#define SRB_STATUS_REQUEST_FLUSHED
#define SRB_STATUS_PHASE_SEQUENCE_FAILURE
#define SRB_STATUS_NO_HBA
#define SRB_STATUS_BUS_RESET
#define SRB_STATUS_INVALID_TARGET_ID
#define SRB_STATUS_UNEXPECTED_BUS_FREE
#define SRB_STATUS_DATA_OVERRUN
#define SRB_STATUS_ABORTED
#define SRB_STATUS_INVALID_PATH_ID
#define SRB_STATUS_TIMEOUT
#define SRB_STATUS_AUTOSENSE_VALID
#define SRB_STATUS_SELECTION_TIMEOUT
#define SRB_STATUS(Status)
#define SRB_STATUS_INTERNAL_ERROR
#define SRB_STATUS_COMMAND_TIMEOUT
#define SRB_STATUS_PARITY_ERROR
#define SRB_STATUS_QUEUE_FROZEN
#define SRB_STATUS_NO_DEVICE
#define SRB_STATUS_SUCCESS
#define SRB_STATUS_INVALID_REQUEST
#define KeReleaseSpinLock(sl, irql)
#define KeAcquireSpinLock(sl, irql)
#define IOCTL_STORAGE_CHECK_VERIFY2
GLboolean GLboolean GLboolean b
#define _Out_range_(lb, ub)
#define _Deref_out_range_(lb, ub)
#define RTL_CONTAINS_FIELD(Struct, Size, Field)
#define RTL_SIZEOF_THROUGH_FIELD(type, field)
#define IOCTL_CDROM_GET_LAST_SESSION
#define IOCTL_CDROM_READ_TOC_EX
#define IOCTL_CDROM_GET_VOLUME
#define IOCTL_CDROM_CHECK_VERIFY
#define IOCTL_CDROM_READ_Q_CHANNEL
#define IOCTL_CDROM_SET_SPEED
#define IOCTL_CDROM_GET_CONFIGURATION
#define IOCTL_CDROM_READ_TOC
#define SCSI_GET_CONFIGURATION_REQUEST_TYPE_ONE
#define IOCTL_STORAGE_CHECK_VERIFY
#define IO_WRN_FAILURE_PREDICTED
#define IO_WARNING_PAGING_FAILURE
#define IO_ERR_CONTROLLER_ERROR
#define IO_RECOVERED_VIA_ECC
VOID NTAPI IoWriteErrorLogEntry(IN PVOID ElEntry)
PVOID NTAPI IoAllocateErrorLogEntry(IN PVOID IoObject, IN UCHAR EntrySize)
ULONG NTAPI KeQueryTimeIncrement(VOID)
#define STATUS_CLEANER_CARTRIDGE_INSTALLED
#define STATUS_CSS_AUTHENTICATION_FAILURE
#define STATUS_COPY_PROTECTION_FAILURE
#define STATUS_MEDIA_CHANGED
#define STATUS_CSS_REGION_MISMATCH
#define STATUS_CSS_KEY_NOT_ESTABLISHED
#define STATUS_CSS_SCRAMBLED_SECTOR
#define STATUS_CSS_KEY_NOT_PRESENT
#define STATUS_CSS_RESETS_EXHAUSTED
VOID NTAPI IoInvalidateDeviceRelations(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_RELATION_TYPE Type)
#define IRP_MJ_DEVICE_CONTROL
#define offsetof(TYPE, MEMBER)
#define SCSIOP_RELEASE_UNIT10
UCHAR additionalSenseCode
#define SCSI_ADSENSE_COPY_PROTECTION_FAILURE
#define SCSI_ADSENSE_FAILURE_PREDICTION_THRESHOLD_EXCEEDED
#define SCSIOP_RESERVE_UNIT10
#define SCSIOP_READ_TRACK_INFORMATION
#define SCSI_SESNEQ_COMM_CRC_ERROR
#define SCSI_ADSENSE_LUN_COMMUNICATION
#define SCSI_ADSENSE_NO_SEEK_COMPLETE
#define SCSI_ADSENSE_INSUFFICIENT_TIME_FOR_OPERATION
#define SCSI_SENSEQ_WRITE_PROTECT_DISABLE
_In_ UCHAR _Out_opt_ PUCHAR _Out_opt_ PUCHAR _Out_opt_ PUCHAR AdditionalSenseCodeQualifier
#define SCSIOP_READ_DISK_INFORMATION
#define SCSI_SENSEQ_MEDIUM_REMOVAL
#define SCSI_ADSENSE_OPERATOR_REQUEST
#define SCSI_ADSENSE_OPERATING_CONDITIONS_CHANGED
#define SCSIOP_READ_CAPACITY16
#define MAX_ADDITIONAL_SENSE_BYTES
_In_ UCHAR _Out_opt_ PUCHAR _Out_opt_ PUCHAR AdditionalSenseCode
_In_ UCHAR _Out_opt_ PUCHAR SenseKey
#define SCSI_SENSEQ_WRITE_PROTECT_ENABLE
#define KeQueryTickCount(CurrentCount)
VOID SenseInfoInterpretBySenseKey(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ PSENSE_DATA SenseData, _In_ UCHAR SenseKey, _Inout_ NTSTATUS *Status, _Inout_ BOOLEAN *Retry, _Out_ _Deref_out_range_(0, 100) ULONG *RetryIntervalInSeconds, _Inout_ PERROR_LOG_CONTEXT LogContext)
NTSTATUS DeviceErrorHandlerForMmc(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ PSCSI_REQUEST_BLOCK Srb, _Inout_ PNTSTATUS Status, _Inout_ PBOOLEAN Retry)
struct _ERROR_LOG_CONTEXT * PERROR_LOG_CONTEXT
BOOLEAN SenseInfoInterpretForZPODD(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ PSCSI_REQUEST_BLOCK Srb, _Out_ NTSTATUS *Status, _Out_ _Out_range_(0, MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) LONGLONG *RetryIntervalIn100ns)
VOID SenseInfoInterpretRefineByScsiCommand(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ PSCSI_REQUEST_BLOCK Srb, _In_ ULONG RetriedCount, _In_ LONGLONG Total100nsSinceFirstSend, _In_ BOOLEAN OverrideVerifyVolume, _Inout_ BOOLEAN *Retry, _Inout_ NTSTATUS *Status, _Inout_ _Deref_out_range_(0, MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) LONGLONG *RetryIntervalIn100ns)
VOID SenseInfoInterpretBySrbStatus(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ PSCSI_REQUEST_BLOCK Srb, _In_ ULONG RetriedCount, _Inout_ NTSTATUS *Status, _Inout_ BOOLEAN *Retry, _Out_ _Deref_out_range_(0, 100) ULONG *RetryIntervalInSeconds, _Inout_ PERROR_LOG_CONTEXT LogContext)
BOOLEAN RequestSenseInfoInterpretForScratchBuffer(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ ULONG RetriedCount, _Out_ NTSTATUS *Status, _Out_ _Deref_out_range_(0, MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) LONGLONG *RetryIntervalIn100ns)
#define TOTAL_SECONDS_RETRY_TIME_WRITE
#define TOTAL_COUNT_RETRY_READ_CAPACITY
#define TOTAL_COUNT_RETRY_MODESENSE
VOID SenseInfoInterpretRefineByIoControl(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ ULONG IoControlCode, _In_ BOOLEAN OverrideVerifyVolume, _Inout_ BOOLEAN *Retry, _Inout_ NTSTATUS *Status)
struct _ERROR_LOG_CONTEXT ERROR_LOG_CONTEXT
#define TOTAL_COUNT_RETRY_DEFAULT
VOID SenseInfoLogError(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ PSCSI_REQUEST_BLOCK Srb, _In_ UCHAR MajorFunctionCode, _In_ ULONG IoControlCode, _In_ ULONG RetriedCount, _In_ NTSTATUS *Status, _In_ BOOLEAN *Retry, _Inout_ PERROR_LOG_CONTEXT LogContext)
VOID SenseInfoRequestGetInformation(_In_ WDFREQUEST Request, _Out_ UCHAR *MajorFunctionCode, _Out_ ULONG *IoControlCode, _Out_ BOOLEAN *OverrideVerifyVolume, _Out_ ULONGLONG *Total100nsSinceFirstSend)
BOOLEAN RequestSenseInfoInterpret(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ WDFREQUEST Request, _In_ PSCSI_REQUEST_BLOCK Srb, _In_ ULONG RetriedCount, _Out_ NTSTATUS *Status, _Out_opt_ _Deref_out_range_(0, MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) LONGLONG *RetryIntervalIn100ns)
BOOLEAN SenseInfoInterpret(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ WDFREQUEST Request, _In_ PSCSI_REQUEST_BLOCK Srb, _In_ ULONG RetriedCount, _Out_ NTSTATUS *Status, _Out_ _Deref_out_range_(0, MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) LONGLONG *RetryIntervalIn100ns)
BOOLEAN SenseInfoInterpretByAdditionalSenseCode(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ PSCSI_REQUEST_BLOCK Srb, _In_ UCHAR AdditionalSenseCode, _In_ UCHAR AdditionalSenseCodeQual, _Inout_ NTSTATUS *Status, _Inout_ BOOLEAN *Retry, _Out_ _Deref_out_range_(0, 100) ULONG *RetryIntervalInSeconds, _Inout_ PERROR_LOG_CONTEXT LogContext)
NTSTATUS DeviceErrorHandlerForHitachiGD2000(_In_ PCDROM_DEVICE_EXTENSION DeviceExtension, _In_ PSCSI_REQUEST_BLOCK Srb, _Inout_ PNTSTATUS Status, _Inout_ PBOOLEAN Retry)
#define TOTAL_COUNT_RETRY_LOCK_MEDIA
#define STATUS_DEVICE_NOT_READY
#define TRACE_LEVEL_WARNING
#define TRACE_LEVEL_VERBOSE
#define TRACE_LEVEL_ERROR
#define TRACE_LEVEL_INFORMATION
WDFREQUEST OriginalRequest
LARGE_INTEGER TimeSentDownFirstTime
ULONG Estimated100msToReady
struct _IO_STACK_LOCATION::@1575::@1576 DeviceIoControl
union _IO_STACK_LOCATION::@1575 Parameters
UCHAR SenseInfoBufferLength
UCHAR AdditionalSenseLength
UCHAR AdditionalSenseCode
UCHAR AdditionalSenseCodeQualifier
UCHAR AdditionalSenseCode
BOOLEAN RetryFirstCommand
ULONG BecomingReadyRetryCount
UCHAR AdditionalSenseCodeQualifier
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_IO_DEVICE_ERROR
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_UNRECOGNIZED_MEDIA
#define STATUS_INVALID_BLOCK_LENGTH
#define STATUS_MEDIA_WRITE_PROTECTED
#define STATUS_DATA_OVERRUN
#define STATUS_DEVICE_NOT_CONNECTED
#define STATUS_IO_TIMEOUT
#define STATUS_NO_SUCH_DEVICE
#define STATUS_NONEXISTENT_SECTOR
#define STATUS_NO_MEDIA_IN_DEVICE
#define STATUS_DEVICE_BUSY
#define STATUS_NO_DATA_DETECTED
#define STATUS_VERIFY_REQUIRED
#define STATUS_DEVICE_DATA_ERROR
struct _CDB::_CDB10 CDB10
struct _CDB::_CDB6GENERIC CDB6GENERIC
struct _CDB::_SEND_KEY SEND_KEY
struct _CDB::_READ12 READ12
struct _CDB::_WRITE12 WRITE12
struct _CDB::_CDB16 CDB16
_In_ WDFREQUEST _In_ size_t _In_ size_t _In_ ULONG IoControlCode
FORCEINLINE VOID WDF_OBJECT_ATTRIBUTES_INIT(_Out_ PWDF_OBJECT_ATTRIBUTES Attributes)
FORCEINLINE VOID WDF_WORKITEM_CONFIG_INIT(_Out_ PWDF_WORKITEM_CONFIG Config, _In_ PFN_WDF_WORKITEM EvtWorkItemFunc)
#define SL_OVERRIDE_VERIFY_VOLUME
#define ERROR_LOG_MAXIMUM_SIZE
struct _IO_ERROR_LOG_PACKET * PIO_ERROR_LOG_PACKET
struct _IO_ERROR_LOG_PACKET IO_ERROR_LOG_PACKET