Expand Minimize

IoSetHardErrorOrVerifyDevice routine

Lower-level drivers call the IoSetHardErrorOrVerifyDevice routine to identify a removable media device that has encountered an error, so that a file system driver can prompt the user to verify that the medium is valid.

Syntax


VOID IoSetHardErrorOrVerifyDevice(
  _In_  PIRP Irp,
  _In_  PDEVICE_OBJECT DeviceObject
);

Parameters

Irp [in]

Pointer to the IRP for which the driver encountered a user-induced error.

DeviceObject [in]

Pointer to the target device to be verified for the I/O operation.

Return value

None

Remarks

Lower-level drivers for removal media devices must call IoSetHardErrorOrVerifyDevice before completing an IRP, if a call to IoIsErrorUserInduced returns TRUE. For more information, see Supporting Removable Media.

Subsequently, a file system driver will use information supplied in the specified device object to send a dialog box to the user, who can correct the error and retry the operation or cancel it.

The IRP passed to IoSetHardErrorOrVerifyDevice must be associated with a thread. Therefore, before a driver calls IoSetHardErrorOrVerifyDevice, it must verify that irp->Tail.Overlay.Thread is not NULL. If the value is NULL, IoSetHardErrorOrVerifyDevice must not be called using the current IRP. Instead, the driver should check all IRPs subsequently received and processed, until one is received for which irp->Tail.Overlay.Thread is not NULL. At that point, IoSetHardErrorOrVerifyDevice can be called.

Requirements

Version

Available starting with Windows 2000.

Header

Ntddk.h (include Ntddk.h)

Library

Ntoskrnl.lib

IRQL

<=DISPATCH_LEVEL

See also

IoIsErrorUserInduced
IoRaiseHardError
IoRaiseInformationalHardError

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft. All rights reserved.