140#define DiskGeometryGuid 0
141#define SmartStatusGuid 1
142#define SmartDataGuid 2
143#define SmartPerformFunction 3
144 #define AllowDisallowPerformanceHit 1
145 #define EnableDisableHardwareFailurePrediction 2
146 #define EnableDisableFailurePredictionPolling 3
147 #define GetFailurePredictionCapability 4
148 #define EnableOfflineDiags 5
150#define SmartEventGuid 4
151#define SmartThresholdsGuid 5
152#define ScsiInfoExceptionsGuid 6
156#pragma alloc_text(PAGE, DiskWmiFunctionControl)
157#pragma alloc_text(PAGE, DiskFdoQueryWmiRegInfo)
158#pragma alloc_text(PAGE, DiskFdoQueryWmiDataBlock)
159#pragma alloc_text(PAGE, DiskFdoSetWmiDataBlock)
160#pragma alloc_text(PAGE, DiskFdoSetWmiDataItem)
161#pragma alloc_text(PAGE, DiskFdoExecuteWmiMethod)
163#pragma alloc_text(PAGE, DiskDetectFailurePrediction)
164#pragma alloc_text(PAGE, DiskEnableDisableFailurePrediction)
165#pragma alloc_text(PAGE, DiskEnableDisableFailurePredictPolling)
166#pragma alloc_text(PAGE, DiskReadFailurePredictStatus)
167#pragma alloc_text(PAGE, DiskReadFailurePredictData)
168#pragma alloc_text(PAGE, DiskReadFailurePredictThresholds)
169#pragma alloc_text(PAGE, DiskGetIdentifyInfo)
170#pragma alloc_text(PAGE, DiskReadSmartLog)
171#pragma alloc_text(PAGE, DiskWriteSmartLog)
172#pragma alloc_text(PAGE, DiskPerformSmartCommand)
173#pragma alloc_text(PAGE, DiskSendFailurePredictIoctl)
174#pragma alloc_text(PAGE, DiskReregWorker)
175#pragma alloc_text(PAGE, DiskInitializeReregistration)
177#if (NTDDI_VERSION >= NTDDI_WINBLUE)
178#pragma alloc_text(PAGE, DiskGetModePage)
179#pragma alloc_text(PAGE, DiskEnableInfoExceptions)
200#define DiskReadSmartData(FdoExtension, \
203 DiskPerformSmartCommand(FdoExtension, \
204 IOCTL_SCSI_MINIPORT_READ_SMART_ATTRIBS, \
218#define DiskReadSmartThresholds(FdoExtension, \
221 DiskPerformSmartCommand(FdoExtension, \
222 IOCTL_SCSI_MINIPORT_READ_SMART_THRESHOLDS, \
236#define DiskReadSmartStatus(FdoExtension, \
239 DiskPerformSmartCommand(FdoExtension, \
240 IOCTL_SCSI_MINIPORT_RETURN_STATUS, \
242 RETURN_SMART_STATUS, \
254#define DiskGetIdentifyData(FdoExtension, \
257 DiskPerformSmartCommand(FdoExtension, \
258 IOCTL_SCSI_MINIPORT_IDENTIFY, \
400 if (srbControl !=
NULL)
451 if (srbControl !=
NULL)
524 ULONG availableBufferSize;
560 ULONG controlCode = 0;
645 NT_ASSERT(controlCode == SrbControlCode);
646 NT_ASSERT(availableBufferSize >= lengthNeeded);
657 SrbControl->Length = availableBufferSize;
658 SrbControl->ControlCode = SrbControlCode;
676 length = SrbControl->HeaderLength + SrbControl->Length;
715 srbEx->SrbLength =
sizeof(srbExBuffer);
728 srbEx->OriginalRequest =
irp;
734 srbEx->TimeOutValue = SrbControl->Timeout;
740 srbEx->DataBuffer = SrbControl;
741 srbEx->DataTransferLength =
length;
831 USHORT commandSetSupported = identifyData[82];
833 *SupportSmart = ((commandSetSupported != 0xffff) &&
834 (commandSetSupported != 0) &&
835 ((commandSetSupported & 1) == 1));
837 *SupportSmart =
FALSE;
840 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_IOCTL,
"DiskGetIdentifyInfo: SMART %s supported for device %p, status %lx\n",
841 *SupportSmart ?
"is" :
"is not",
900#if (NTDDI_VERSION >= NTDDI_WINBLUE)
917 if (ModeData ==
NULL ||
918 ModeDataSize ==
NULL ||
944 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_WMI,
"DiskGetModePage: Mode Sense for Page Mode %d with Page Control %d failed\n",
955 if (
size > (
ULONG) (ModeData->ModeDataLength + 1)) {
956 size = ModeData->ModeDataLength + 1;
959 *ModeDataSize =
size;
970 *PageData = pageData;
999 if (modeData ==
NULL) {
1001 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_WMI,
"DiskEnableInfoExceptions: Unable to allocate mode "
1017 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"DiskEnableInfoExceptions: does NOT support SMART for device %p\n",
1023 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"DiskEnableInfoExceptions: DOES support SMART for device %p\n",
1030 if (pageData->
Dexcpt == 0) {
1031 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"DiskEnableInfoExceptions: does NOT support DEXCPT bit for device %p\n",
1068 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"DiskEnableInfoExceptions: MRIE field is 0 and is not changeable for device %p\n",
1077 if (changeablePageData.
Perf) {
1196 ULONG PollTimeInSeconds
1298 DiskSmartStatus->
Reason = 0;
1300 (cmdOutParameters->
bBuffer[4] == 0x2c));
1361 ULONG outBufferSize;
1452 ULONG outBufferSize;
1521 if (reregRequest !=
NULL)
1549 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_GENERAL,
"DiskReregWorker: Reregistration failed %x\n",
1595 if (reregRequest !=
NULL)
1607 &reregRequest->
Next,
1637 TracePrint((
TRACE_LEVEL_ERROR, TRACE_FLAG_GENERAL,
"DiskPostReregisterRequest: could not allocate reregRequest for %p\n",
1661 ULONG retryInterval;
1669 UCHAR cdbLength8 = 0;
1670 ULONG cdbLength32 = 0;
1671 UCHAR senseBufferLength = 0;
1680 (srbEx->NumSrbExData > 0)) {
1744 srbEx->DataTransferLength =
Irp->MdlAddress->ByteCount;
1750 srbEx->SrbStatus = 0;
1752 (srbEx->NumSrbExData > 0)) {
1753 SetSrbScsiData(srbEx, cdbLength8, cdbLength32, 0, senseBuffer, senseBufferLength);
1824 ULONG modeDataLength;
1833 if (pageData !=
NULL)
1843 if (pageData->
Dexcpt == 0 &&
1858 freeLockAndIrp =
FALSE;
1861 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_WMI,
"DiskInfoExceptionComplete: %p is not enabled for SMART\n",
1867 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_WMI,
"DiskInfoExceptionComplete: %p does not supports SMART\n",
1883 if (senseBuffer != originalSenseInfoBuffer)
1908 if (
Irp->PendingReturned) {
1932 UCHAR senseInfoBufferLength = 0;
1942 if (modeData ==
NULL)
1944 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_WMI,
"DiskInfoExceptionCheck: Can't allocate mode data "
1960 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_WMI,
"DiskInfoExceptionCheck: Can't allocate srb "
1978 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_WMI,
"DiskInfoExceptionCheck: Can't allocate request sense "
1999 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_WMI,
"DiskInfoExceptionCheck: Can't allocate Irp\n"));
2012 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_WMI,
"DiskInfoExceptionCheck: RemoveLock says isRemoved\n"));
2063 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_WMI,
"DiskINfoExceptionCheck: Can't allocate MDL\n"));
2084 srbEx->SrbLength = srbSize;
2088 srbEx->NumSrbExData = 1;
2095 srbEx->DataBuffer = modeData;
2115 srbEx->OriginalRequest =
irp;
2135 srbExDataCdb16->CdbLength = 6;
2138 srbExDataCdb16->SenseInfoBufferLength = senseInfoBufferLength;
2141 cdb = (
PCDB)srbExDataCdb16->Cdb;
2151 TracePrint((
TRACE_LEVEL_WARNING, TRACE_FLAG_WMI,
"DiskINfoExceptionCheck: Insufficient extended SRB size\n"));
2290 if (ScsiAddressAvailable)
2338 sizeof(checkFailure),
2433 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"Disk: DeviceObject %p, Irp %p, GuidIndex %d %s for Collection\n",
2436 Enable ?
"Enabled" :
"Disabled"));
2439 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"Disk: DeviceObject %p, Irp %p, GuidIndex %d %s for Event Generation\n",
2442 Enable ?
"Enabled" :
"Disabled"));
2453 Enable ?
"DiskEnableSmartPolling" :
"DiskDisableSmartPolling",
2459 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"Disk: DeviceObject %p, Irp %p, GuidIndex %d %s for function %d\n",
2462 Enable ?
"Enabled" :
"Disabled",
2683 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"Disk: DiskQueryWmiDataBlock, Device %p, Irp %p, GuiIndex %d\n"
2684 " BufferAvail %lx Buffer %p\n",
2748 diskSmartStatus->
Reason = 0;
2780 diskSmartData->
Length = 512;
2801 diskSmartThresholds);
2854 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"Disk: DiskQueryWmiDataBlock Device %p, Irp %p returns %lx\n",
2912 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"Disk: DiskSetWmiDataBlock, Device %p, Irp %p, GuiIndex %d\n"
2913 " BufferSize %#x Buffer %p\n",
2940 if (modeInfo.
Perf == 1)
2960 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"Disk: DiskSetWmiDataBlock Device %p, Irp %p returns %lx\n",
3018 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"Disk: DiskSetWmiDataItem, Device %p, Irp %p, GuiIndex %d, DataId %d\n"
3019 " BufferSize %#x Buffer %p\n",
3030 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"Disk: DiskSetWmiDataItem Device %p, Irp %p returns %lx\n",
3092 ULONG sizeNeeded = 0;
3097 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"Disk: DiskExecuteWmiMethod, DeviceObject %p, Irp %p, Guid Id %d, MethodId %d\n"
3098 " InBufferSize %#x, OutBufferSize %#x, Buffer %p\n",
3142 modeInfo.
Perf = allowPerfHit ? 0 : 1;
3153 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"DiskFdoWmiExecuteMethod: AllowPerformanceHit %x for device %p --> %lx\n",
3191 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"DiskFdoWmiExecuteMethod: EnableDisableHardwareFailurePrediction: %x for device %p --> %lx\n",
3223 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"DiskFdoWmiExecuteMethod: EnableDisableFailurePredictionPolling: %x %x for device %p --> %lx\n",
3239 sizeNeeded =
sizeof(
ULONG);
3244 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"DiskFdoWmiExecuteMethod: GetFailurePredictionCapability: %x for device %p --> %lx\n",
3280 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"DiskFdoWmiExecuteMethod: EnableOfflineDiags for device %p --> %lx\n",
3310 LogSectors) + readSize;
3322 outParams->
Length = readSize;
3498 TracePrint((
TRACE_LEVEL_INFORMATION, TRACE_FLAG_WMI,
"Disk: DiskExecuteMethod Device %p, Irp %p returns %lx\n",
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define InterlockedIncrement
#define InterlockedDecrement
struct _SENDCMDINPARAMS SENDCMDINPARAMS
struct _SENDCMDOUTPARAMS * PSENDCMDOUTPARAMS
struct _SENDCMDOUTPARAMS SENDCMDOUTPARAMS
struct _SENDCMDINPARAMS * PSENDCMDINPARAMS
_In_ size_t _In_ UCHAR PageMode
#define FREE_POOL(_PoolPtr)
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
_In_ ULONG const _In_ FEATURE_NUMBER const Feature
#define TEST_FLAG(Flags, Bit)
#define CLEAR_FLAG(Flags, Bit)
#define SET_FLAG(Flags, Bit)
_In_ ULONG _In_ UCHAR _In_ UCHAR PageControl
#define IOCTL_SCSI_MINIPORT_SAVE_ATTRIBUTE_VALUES
#define IOCTL_SCSI_MINIPORT_READ_SMART_ATTRIBS
#define IOCTL_SCSI_MINIPORT_DISABLE_SMART
#define IOCTL_SCSI_MINIPORT_ENABLE_DISABLE_AUTOSAVE
#define IOCTL_SCSI_MINIPORT_IDENTIFY
#define IOCTL_SCSI_MINIPORT_EXECUTE_OFFLINE_DIAGS
#define IOCTL_SCSI_MINIPORT_READ_SMART_THRESHOLDS
#define IOCTL_SCSI_MINIPORT_ENABLE_SMART
#define SCSIOP_MODE_SENSE
#define IOCTL_SCSI_MINIPORT_RETURN_STATUS
#define CLASS_SRBEX_NO_SRBEX_DATA_BUFFER_SIZE
#define ClassAcquireRemoveLock(devobj, tag)
#define CLASS_SRBEX_SCSI_CDB16_BUFFER_SIZE
_In_ PIRP _In_ ULONG GuidIndex
enum FAILURE_PREDICTION_METHOD * PFAILURE_PREDICTION_METHOD
CLASSENABLEDISABLEFUNCTION
_In_ PIRP _In_ ULONG _In_ ULONG BufferAvail
SCSIPORT_API NTSTATUS NTAPI ClassWmiCompleteRequest(_In_ PDEVICE_OBJECT DeviceObject, _Inout_ PIRP Irp, _In_ NTSTATUS Status, _In_ ULONG BufferUsed, _In_ CCHAR PriorityBoost)
NTSTATUS DiskEnableDisableFailurePrediction(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, BOOLEAN Enable)
NTSTATUS NTAPI DiskFdoSetWmiDataItem(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN ULONG GuidIndex, IN ULONG DataItemId, IN ULONG BufferSize, IN PUCHAR Buffer)
NTSTATUS NTAPI DiskWmiFunctionControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN ULONG GuidIndex, IN CLASSENABLEDISABLEFUNCTION Function, IN BOOLEAN Enable)
GUIDREGINFO DiskWmiFdoGuidList[]
NTSTATUS DiskPerformSmartCommand(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN ULONG SrbControlCode, IN UCHAR Command, IN UCHAR Feature, IN UCHAR SectorCount, IN UCHAR SectorNumber, IN OUT PSRB_IO_CONTROL SrbControl, OUT PULONG BufferSize)
#define DiskReadSmartStatus(FdoExtension, SrbControl, BufferSize)
NTSTATUS DiskDetectFailurePrediction(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, PFAILURE_PREDICTION_METHOD FailurePredictCapability, BOOLEAN ScsiAddressAvailable)
NTSTATUS NTAPI DiskFdoQueryWmiRegInfoEx(IN PDEVICE_OBJECT DeviceObject, OUT ULONG *RegFlags, OUT PUNICODE_STRING InstanceName, OUT PUNICODE_STRING MofName)
#define ScsiInfoExceptionsGuid
#define DiskReadSmartData(FdoExtension, SrbControl, BufferSize)
SINGLE_LIST_ENTRY DiskReregHead
GUID DiskPredictFailureEventGuid
NTSTATUS NTAPI DiskFdoExecuteWmiMethod(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN ULONG GuidIndex, IN ULONG MethodId, IN ULONG InBufferSize, IN ULONG OutBufferSize, IN PUCHAR Buffer)
NTSTATUS DiskInitializeReregistration(VOID)
_inline NTSTATUS DiskEnableSmartAttributeAutosave(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
NTSTATUS DiskSendFailurePredictIoctl(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, PSTORAGE_PREDICT_FAILURE checkFailure)
#define SmartPerformFunction
NTSTATUS DiskEnableInfoExceptions(_In_ PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, _In_ BOOLEAN Enable)
_inline NTSTATUS DiskDisableSmartAttributeAutosave(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
static NTSTATUS DiskEnableSmart(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
NTSTATUS DiskWriteSmartLog(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN UCHAR SectorCount, IN UCHAR LogAddress, IN PUCHAR Buffer)
#define GetFailurePredictionCapability
NTSTATUS DiskInfoExceptionCheck(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
IO_COMPLETION_ROUTINE DiskInfoExceptionComplete
KSPIN_LOCK DiskReregSpinlock
NTSTATUS DiskGetIdentifyInfo(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, PBOOLEAN SupportSmart)
#define EnableDisableFailurePredictionPolling
#define EnableDisableHardwareFailurePrediction
IO_WORKITEM_ROUTINE DiskReregWorker
#define EnableOfflineDiags
NTSTATUS DiskReadFailurePredictThresholds(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, PSTORAGE_FAILURE_PREDICT_THRESHOLDS DiskSmartThresholds)
NTSTATUS DiskReadFailurePredictStatus(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, PSTORAGE_FAILURE_PREDICT_STATUS DiskSmartStatus)
NTSTATUS DiskPostReregisterRequest(PDEVICE_OBJECT DeviceObject, PIRP Irp)
NTSTATUS NTAPI DiskFdoQueryWmiDataBlock(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN ULONG GuidIndex, IN ULONG BufferAvail, OUT PUCHAR Buffer)
#define DiskReadSmartThresholds(FdoExtension, SrbControl, BufferSize)
static NTSTATUS DiskExecuteSmartDiagnostics(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, UCHAR Subcommand)
#define SmartThresholdsGuid
static NTSTATUS DiskDisableSmart(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension)
#define AllowDisallowPerformanceHit
NTSTATUS NTAPI DiskFdoQueryWmiRegInfo(IN PDEVICE_OBJECT DeviceObject, OUT ULONG *RegFlags, OUT PUNICODE_STRING InstanceName)
NTSTATUS DiskEnableDisableFailurePredictPolling(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, BOOLEAN Enable, ULONG PollTimeInSeconds)
NTSTATUS DiskReadFailurePredictData(PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, PSTORAGE_FAILURE_PREDICT_DATA DiskSmartData)
NTSTATUS DiskGetModePage(_In_ PDEVICE_OBJECT Fdo, _In_ UCHAR PageMode, _In_ UCHAR PageControl, _In_ PMODE_PARAMETER_HEADER ModeData, _Inout_ PULONG ModeDataSize, _Out_ PVOID *PageData)
NTSTATUS NTAPI DiskFdoSetWmiDataBlock(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN ULONG GuidIndex, IN ULONG BufferSize, IN PUCHAR Buffer)
#define DiskGetIdentifyData(FdoExtension, SrbControl, BufferSize)
NTSTATUS DiskReadSmartLog(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN UCHAR SectorCount, IN UCHAR LogAddress, OUT PUCHAR Buffer)
#define NT_SUCCESS(StatCode)
static const WCHAR Signature[]
struct _COMMON_DEVICE_EXTENSION * PCOMMON_DEVICE_EXTENSION
PVOID NTAPI ClassFindModePage(_In_reads_bytes_(Length) PCHAR ModeSenseBuffer, _In_ ULONG Length, _In_ UCHAR PageMode, _In_ BOOLEAN Use6Byte)
NTSTATUS NTAPI ClassModeSelect(_In_ PDEVICE_OBJECT Fdo, _In_reads_bytes_(Length) PCHAR ModeSelectBuffer, _In_ ULONG Length, _In_ BOOLEAN SavePages)
VOID NTAPI ClassReleaseQueue(_In_ PDEVICE_OBJECT Fdo)
ULONG NTAPI ClassModeSenseEx(_In_ PDEVICE_OBJECT Fdo, _In_reads_bytes_(Length) PCHAR ModeSenseBuffer, _In_ ULONG Length, _In_ UCHAR PageMode, _In_ UCHAR PageControl)
BOOLEAN NTAPI ClassInterpretSenseInfo(_In_ PDEVICE_OBJECT Fdo, _In_ PSCSI_REQUEST_BLOCK _Srb, _In_ UCHAR MajorFunctionCode, _In_ ULONG IoDeviceCode, _In_ ULONG RetryCount, _Out_ NTSTATUS *Status, _Out_opt_ _Deref_out_range_(0, 100) ULONG *RetryInterval)
VOID NTAPI ClassReleaseRemoveLock(_In_ PDEVICE_OBJECT DeviceObject, _In_opt_ PIRP Tag)
NTSTATUS DiskGetInfoExceptionInformation(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN PMODE_INFO_EXCEPTIONS ReturnPageData)
NTSTATUS DiskSetInfoExceptionInformation(IN PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, IN PMODE_INFO_EXCEPTIONS PageData)
#define DiskIsValidSmartSelfTest(Subcommand)
struct DISKREREGREQUEST * PDISKREREGREQUEST
FORCEINLINE VOID SetSrbScsiData(_In_ PSTORAGE_REQUEST_BLOCK SrbEx, _In_ UCHAR CdbLength8, _In_ ULONG CdbLength32, _In_ UCHAR ScsiStatus, _In_opt_ PVOID SenseInfoBuffer, _In_ UCHAR SenseInfoBufferLength)
#define DiskReadDriveCapacity(Fdo)
struct _DISK_DATA * PDISK_DATA
#define DISK_TAG_INFO_EXCEPTION
FORCEINLINE PCDB GetSrbScsiData(_In_ PSTORAGE_REQUEST_BLOCK SrbEx, _In_opt_ PUCHAR CdbLength8, _In_opt_ PULONG CdbLength32, _In_opt_ PUCHAR ScsiStatus, _In_opt_ PVOID *SenseInfoBuffer, _In_opt_ PUCHAR SenseInfoBufferLength)
#define IOCTL_SCSI_MINIPORT_WRITE_SMART_LOG
#define IOCTL_SCSI_MINIPORT_READ_SMART_LOG
struct _SCSI_REQUEST_BLOCK SCSI_REQUEST_BLOCK
#define SCSI_REQUEST_BLOCK_SIZE
#define SRB_FUNCTION_IO_CONTROL
#define SRB_FUNCTION_EXECUTE_SCSI
#define SRB_STATUS_DATA_OVERRUN
#define SRB_FLAGS_DISABLE_DISCONNECT
#define SRB_SIMPLE_TAG_REQUEST
#define SRB_FLAGS_QUEUE_ACTION_ENABLE
#define SRB_FLAGS_DATA_IN
#define SRB_FLAGS_NO_KEEP_AWAKE
#define SRB_FLAGS_DISABLE_SYNCH_TRANSFER
#define SRB_STATUS(Status)
#define SRB_STATUS_QUEUE_FROZEN
#define SRB_FLAGS_NO_QUEUE_FREEZE
#define SRB_STATUS_SUCCESS
#define ExAllocatePoolWithTag(hernya, size, tag)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeInitializeSpinLock(sl)
_Must_inspect_result_ _Inout_ PFLT_VOLUME _In_opt_ PCUNICODE_STRING InstanceName
MxDeviceObject deviceObject
GLuint GLsizei GLsizei * length
PSINGLE_LIST_ENTRY NTAPI ExInterlockedPopEntryList(IN OUT PSINGLE_LIST_ENTRY ListHead, IN OUT PKSPIN_LOCK Lock)
PSINGLE_LIST_ENTRY NTAPI ExInterlockedPushEntryList(IN OUT PSINGLE_LIST_ENTRY ListHead, IN OUT PSINGLE_LIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
VOID NTAPI IoQueueWorkItem(IN PIO_WORKITEM IoWorkItem, IN PIO_WORKITEM_ROUTINE WorkerRoutine, IN WORK_QUEUE_TYPE QueueType, IN PVOID Context)
VOID NTAPI IoFreeWorkItem(IN PIO_WORKITEM IoWorkItem)
PIO_WORKITEM NTAPI IoAllocateWorkItem(IN PDEVICE_OBJECT DeviceObject)
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
VOID NTAPI MmBuildMdlForNonPagedPool(IN PMDL Mdl)
#define _Analysis_assume_(expr)
#define FILE_REMOVABLE_MEDIA
#define UNREFERENCED_PARAMETER(P)
#define EXECUTE_OFFLINE_DIAGS
#define READ_ATTRIBUTE_BUFFER_SIZE
struct _DISK_GEOMETRY DISK_GEOMETRY
#define SAVE_ATTRIBUTE_VALUES
#define RETURN_SMART_STATUS
#define IDENTIFY_BUFFER_SIZE
#define SMART_LOG_SECTOR_SIZE
#define WMI_DISK_GEOMETRY_GUID
#define READ_THRESHOLD_BUFFER_SIZE
#define ENABLE_DISABLE_AUTOSAVE
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
#define IOCTL_STORAGE_PREDICT_FAILURE
struct _STORAGE_PREDICT_FAILURE * PSTORAGE_PREDICT_FAILURE
PDEVICE_OBJECT NTAPI IoGetAttachedDeviceReference(PDEVICE_OBJECT DeviceObject)
PIRP NTAPI IoBuildSynchronousFsdRequest(IN ULONG MajorFunction, IN PDEVICE_OBJECT DeviceObject, IN PVOID Buffer, IN ULONG Length, IN PLARGE_INTEGER StartingOffset, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
PIRP NTAPI IoAllocateIrp(IN CCHAR StackSize, IN BOOLEAN ChargeQuota)
PIRP NTAPI IoBuildDeviceIoControlRequest(IN ULONG IoControlCode, IN PDEVICE_OBJECT DeviceObject, IN PVOID InputBuffer, IN ULONG InputBufferLength, IN PVOID OutputBuffer, IN ULONG OutputBufferLength, IN BOOLEAN InternalDeviceIoControl, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
VOID NTAPI IoFreeIrp(IN PIRP Irp)
NTSTATUS NTAPI IoWMIRegistrationControl(IN PDEVICE_OBJECT DeviceObject, IN ULONG Action)
#define STATUS_INTERNAL_ERROR
#define STATUS_WMI_ITEMID_NOT_FOUND
#define STATUS_WMI_GUID_NOT_FOUND
#define STATUS_NOT_SUPPORTED
#define STATUS_WMI_READ_ONLY
#define STATUS_DEVICE_DOES_NOT_EXIST
struct _SRB_IO_CONTROL SRB_IO_CONTROL
struct STOR_ADDRESS_ALIGN _STOR_ADDR_BTL8 * PSTOR_ADDR_BTL8
#define MODE_PAGE_FAULT_REPORTING
struct _MODE_INFO_EXCEPTIONS MODE_INFO_EXCEPTIONS
#define STOR_ADDRESS_TYPE_BTL8
struct STOR_ADDRESS_ALIGN _STOR_ADDR_BTL8 STOR_ADDR_BTL8
PFIXED_SENSE_DATA senseInfoBuffer
#define SENSE_BUFFER_SIZE_EX
#define REVERSE_BYTES(Destination, Source)
PFIXED_SENSE_DATA outBuffer
#define STOR_ADDR_BTL8_ADDRESS_LENGTH
#define STORAGE_REQUEST_BLOCK_VERSION_1
struct SRB_ALIGN _SRBEX_DATA_SCSI_CDB16 SRBEX_DATA_SCSI_CDB16
#define SRB_TYPE_STORAGE_REQUEST_BLOCK
#define SRB_FUNCTION_STORAGE_REQUEST_BLOCK
struct SRB_ALIGN _SRBEX_DATA_SCSI_CDB16 * PSRBEX_DATA_SCSI_CDB16
#define SRBEX_DATA_SCSI_CDB16_LENGTH
#define KeFlushIoBuffers(_Mdl, _ReadOperation, _DmaOperation)
#define STATUS_MORE_PROCESSING_REQUIRED
#define STATUS_BUFFER_TOO_SMALL
#define TRACE_LEVEL_WARNING
#define TRACE_LEVEL_ERROR
#define TRACE_LEVEL_INFORMATION
PDEVICE_OBJECT DeviceObject
PDEVICE_OBJECT LowerDeviceObject
struct _FUNCTIONAL_DEVICE_EXTENSION * PartitionZeroExtension
BOOLEAN ScsiInfoExceptionsSupported
FAILURE_PREDICTION_METHOD FailurePredictionCapability
BOOLEAN FailurePredictionEnabled
PDEVICE_OBJECT DeviceObject
DISK_GEOMETRY DiskGeometry
PDEVICE_OBJECT DeviceObject
struct _IO_STACK_LOCATION::@3974::@3996 Scsi
union _IO_STACK_LOCATION::@1575 Parameters
struct _IO_STACK_LOCATION::@3974::@4013 Others
UCHAR SenseInfoBufferLength
UCHAR VendorSpecific[512]
UCHAR VendorSpecific[512]
UCHAR VendorSpecific[512]
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define RtlMoveMemory(Destination, Source, Length)
#define STATUS_IO_DEVICE_ERROR
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_INVALID_PARAMETER
#define STATUS_VERIFY_REQUIRED
#define STATUS_INSUFFICIENT_RESOURCES
struct _CDB::_MODE_SENSE MODE_SENSE
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ WDFDEVICE Fdo
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
struct _STORAGE_FAILURE_PREDICT_DATA * PSTORAGE_FAILURE_PREDICT_DATA
struct _STORAGE_FAILURE_PREDICT_STATUS * PSTORAGE_FAILURE_PREDICT_STATUS
#define WMI_STORAGE_FAILURE_PREDICT_FUNCTION_GUID
struct _STORAGE_SCSI_INFO_EXCEPTIONS * PSTORAGE_SCSI_INFO_EXCEPTIONS
#define WMI_STORAGE_FAILURE_PREDICT_THRESHOLDS_GUID
struct _EXECUTE_SELF_TEST_IN * PEXECUTE_SELF_TEST_IN
struct _WRITE_LOG_SECTORS_OUT WRITE_LOG_SECTORS_OUT
#define WMI_STORAGE_SCSI_INFO_EXCEPTIONS_GUID
struct _WRITE_LOG_SECTORS_IN * PWRITE_LOG_SECTORS_IN
struct _STORAGE_FAILURE_PREDICT_THRESHOLDS STORAGE_FAILURE_PREDICT_THRESHOLDS
#define WMI_STORAGE_FAILURE_PREDICT_STATUS_GUID
struct _READ_LOG_SECTORS_IN * PREAD_LOG_SECTORS_IN
struct _STORAGE_FAILURE_PREDICT_STATUS STORAGE_FAILURE_PREDICT_STATUS
struct _STORAGE_FAILURE_PREDICT_THRESHOLDS * PSTORAGE_FAILURE_PREDICT_THRESHOLDS
struct _STORAGE_FAILURE_PREDICT_DATA STORAGE_FAILURE_PREDICT_DATA
struct _STORAGE_SCSI_INFO_EXCEPTIONS STORAGE_SCSI_INFO_EXCEPTIONS
struct _EXECUTE_SELF_TEST_OUT * PEXECUTE_SELF_TEST_OUT
struct _EXECUTE_SELF_TEST_OUT EXECUTE_SELF_TEST_OUT
#define WMI_STORAGE_PREDICT_FAILURE_EVENT_GUID
struct _WRITE_LOG_SECTORS_OUT * PWRITE_LOG_SECTORS_OUT
#define WMI_STORAGE_FAILURE_PREDICT_DATA_GUID
struct _READ_LOG_SECTORS_OUT * PREAD_LOG_SECTORS_OUT
#define WMIREG_FLAG_INSTANCE_PDO
#define WMIREG_FLAG_REMOVE_GUID
#define WMIREG_FLAG_EVENT_ONLY_GUID
#define WMIREG_FLAG_EXPENSIVE
_Must_inspect_result_ _In_ ULONG Flags
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
NTKRNLVISTAAPI IO_PRIORITY_HINT NTAPI IoGetIoPriorityHint(_In_ PIRP Irp)
FORCEINLINE VOID IoSetNextIrpStackLocation(_Inout_ PIRP Irp)
#define SL_OVERRIDE_VERIFY_VOLUME
#define WMIREG_ACTION_UPDATE_GUIDS
#define MmGetMdlVirtualAddress(_Mdl)
#define ObDereferenceObject