Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ioevent.h:
- //
- // This notification may be sent by storage drivers to
- // alert other components of changes in the health status
- // of a device. A component that registers for this
- // custom PNP notification should query for the
- // StorageDeviceManagementStatus property to learn
- // more about the device's health status.
- //
- // {0F1BD644-3916-49C5-B063-991940118FB2}
- DEFINE_GUID( GUID_IO_DISK_HEALTH_NOTIFICATION, 0xf1bd644, 0x3916, 0x49c5, 0xb0, 0x63, 0x99, 0x19, 0x40, 0x11, 0x8f, 0xb2);
- typedef struct _DISK_HEALTH_NOTIFICATION_DATA {
- //
- // The GUID of the device reporting the health change.
- // This is the same GUID returned by IOCTL_STORAGE_GET_DEVICE_NUMBER_EX.
- //
- GUID DeviceGuid;
- } DISK_HEALTH_NOTIFICATION_DATA, *PDISK_HEALTH_NOTIFICATION_DATA;
- ntddstor.h:
- //
- // Constants for StorageDeviceManagementStatus
- //
- typedef enum _STORAGE_DISK_HEALTH_STATUS {
- DiskHealthUnknown = 0,
- DiskHealthUnhealthy,
- DiskHealthWarning,
- DiskHealthHealthy,
- DiskHealthMax
- } STORAGE_DISK_HEALTH_STATUS, *PSTORAGE_DISK_HEALTH_STATUS;
- //
- // Operational States
- //
- typedef enum _STORAGE_DISK_OPERATIONAL_STATUS {
- DiskOpStatusNone = 0,
- DiskOpStatusUnknown,
- DiskOpStatusOk,
- DiskOpStatusPredictingFailure,
- DiskOpStatusInService,
- DiskOpStatusHardwareError,
- DiskOpStatusNotUsable,
- DiskOpStatusTransientError,
- DiskOpStatusMissing,
- } STORAGE_DISK_OPERATIONAL_STATUS, *PSTORAGE_DISK_OPERATIONAL_STATUS;
- //
- // Operational Reasons
- //
- typedef enum _STORAGE_OPERATIONAL_STATUS_REASON {
- DiskOpReasonUnknown = 0,
- DiskOpReasonScsiSenseCode,
- DiskOpReasonMedia,
- DiskOpReasonIo,
- DiskOpReasonThresholdExceeded,
- DiskOpReasonLostData,
- DiskOpReasonEnergySource,
- DiskOpReasonConfiguration,
- DiskOpReasonDeviceController,
- DiskOpReasonMediaController,
- DiskOpReasonComponent,
- DiskOpReasonNVDIMM_N,
- DiskOpReasonBackgroundOperation,
- DiskOpReasonInvalidFirmware
- } STORAGE_OPERATIONAL_STATUS_REASON, *PSTORAGE_OPERATIONAL_STATUS_REASON;
- typedef struct _STORAGE_OPERATIONAL_REASON {
- ULONG Version;
- ULONG Size;
- STORAGE_OPERATIONAL_STATUS_REASON Reason;
- union {
- //
- // This is the format if Reason == DiskOpReasonScsiSenseCode.
- //
- struct {
- UCHAR SenseKey;
- UCHAR ASC;
- UCHAR ASCQ;
- UCHAR Reserved;
- } ScsiSenseKey;
- //
- // This is the format if Reason == DiskOpReasonNVDIMM_N.
- //
- struct {
- UCHAR CriticalHealth;
- UCHAR ModuleHealth[2];
- UCHAR ErrorThresholdStatus;
- } NVDIMM_N;
- ULONG AsUlong;
- } RawBytes;
- } STORAGE_OPERATIONAL_REASON, *PSTORAGE_OPERATIONAL_REASON;
- //
- // Output buffer for StorageDeviceManagementStatus & PropertyStandardQuery
- //
- #define STORAGE_DEVICE_MAX_OPERATIONAL_STATUS 16
- typedef _Struct_size_bytes_(Size) struct _STORAGE_DEVICE_MANAGEMENT_STATUS {
- //
- // Sizeof() of this structure serves
- // as the version.
- //
- ULONG Version;
- //
- // The total size of the structure, including operational status reasons
- // that didn't fit in the caller's array. Callers should use this field to learn
- // how big the input buffer should be to contain all the available information.
- //
- ULONG Size;
- //
- // Health status.
- //
- STORAGE_DISK_HEALTH_STATUS Health;
- //
- // The number of operational status returned.
- //
- ULONG NumberOfOperationalStatus;
- //
- // The number of additional reasons returned.
- //
- ULONG NumberOfAdditionalReasons;
- //
- // Operational statuses. The primary operational status is the first element
- // in the array. There are NumberOfOperationalStatus valid elements in the array.
- //
- STORAGE_DISK_OPERATIONAL_STATUS OperationalStatus[STORAGE_DEVICE_MAX_OPERATIONAL_STATUS];
- //
- // Additional reasons. There are NumberOfAdditionalReasons valid elements in the array.
- //
- _Field_size_(NumberOfAdditionalReasons) STORAGE_OPERATIONAL_REASON AdditionalReasons[ANYSIZE_ARRAY];
- } STORAGE_DEVICE_MANAGEMENT_STATUS, *PSTORAGE_DEVICE_MANAGEMENT_STATUS;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement