// storport.h
ULONG StorPortMarkDeviceFailedEx(
PVOID HwDeviceExtension,
PSTOR_ADDRESS StorAddress,
ULONG Flags,
USHORT FaultCode,
PWSTR FaultDescription,
USHORT AdditionalDataSize,
PUCHAR AdditionalData,
USHORT CriticalDataSize,
PUCHAR CriticalData
);
View the official Windows Driver Kit DDI referenceNo description available.
The StorPortMarkDeviceFailedEx routine marks a device with failed status and provides data that might be needed for diagnosis.
HwDeviceExtensionPointer to the hardware device extension for the host bus adapter (HBA).
StorAddressStorage unit device address. This parameter is NULL for adapter devices.
FlagsIndicates the behavior being requested by the miniport. Flags can be set to one of the following values.
| Flag | Meaning |
|---|---|
| STORPORT_MARK_DEVICE_FAILED_FLAG_REMOVE_DEVICE | Remove the failed device. |
| STORPORT_MARK_DEVICE_FAILED_FLAG_PREDICTED_FAILURE | Indicates that this is a predicted device failure. |
FaultCodeMiniport-specific fault code.
FaultDescriptionHuman-readable string that describes the fault.
AdditionalDataSizeSize in bytes of the buffer that AdditionalData points to.
AdditionalDataPointer to a buffer containing additional data associated with the fault condition.
CriticalDataSizeSize in bytes of the buffer that CriticalData points to.
CriticalDataPointer to a buffer containing critical data associated with the fault condition.
StorPortMarkDeviceFailedEx returns a valid STOR_STATUS code.
A miniport driver can call this function to mark a failed device or to indicate that the device has potentially failed.
If no flags are set in Flags, Storport will only log the event.
The PnP manager will send an IRP to query the failed device's PnP state. If Flags is set to STORPORT_MARK_DEVICE_FAILED_FLAG_REMOVE_DEVICE and not set to STORPORT_MARK_DEVICE_FAILED_FLAG_PREDICTED_FAILURE, the PnP manager will then try to remove the failed device.