// ntddstor.h
// CTL_CODE(0x002d, 0x590, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_REINITIALIZE_MEDIA 0x002D9640
View the official Windows Driver Kit DDI reference// winioctl.h
// CTL_CODE(0x002d, 0x590, METHOD_BUFFERED, FILE_WRITE_ACCESS)
#define IOCTL_STORAGE_REINITIALIZE_MEDIA 0x002D9640
View the official Win32 API referenceNo description available.
A driver can issue a IOCTL_STORAGE_REINITIALIZE_MEDIA control code to offload the erasure process to the storage device.
For Windows Server 2022 and later, contains an optional STORAGE_REINITIALIZE_MEDIA structure with sanitize options, or NULL. For earlier OS versions, the input buffer is NULL.
For Windows 10 release 21H1 and later, Parameters.DeviceIoControl.InputBufferLength indicates the size, in bytes, of the parameter buffer at Irp->AssociatedIrp.SystemBuffer, which must be >= sizeof(STORAGE_REINITIALIZE_MEDIA) if Parameters.DeviceIoControl.InputBuffer != NULL; otherwise zero. For earlier OS versions, the input buffer length is zero.
None.
None.
n/a
n/a
The Information field is set to zero if the call completes successfully; otherwise, it is set to a non-zero value.
IOCTL_STORAGE_REINITIALIZE_MEDIA offloads the erasure to the storage device. There is no guarantee as to the successful deletion or recoverability of the data of the storage device after the command completes.
This IOCTL is limited to data disks on devices in the desktop device family. In Windows Preinstallation Environment (WinPE), this IOCTL is supported for both boot and data disks.
In earlier OS versions, the implementation requires no input and returns no output other than status.
Callers should first call FSCTL_LOCK_VOLUME before calling this IOCTL to flush out cached data in upper layers. No waiting of outstanding request completion is done before issuing the command to the device.
How to Complete an IRP in a Dispatch Routine
This IOCTL offloads the erasure process to the storage device.
There is no guarantee as to the successful deletion or recoverability of the data on the storage device after command completion. This IOCTL is limited to data disks in regular Windows. In WinPE, this IOCTL is supported for both boot and data disks.
There may be cached data from the storage device in the system. To ensure there is no cached data from the storage device before erasure, call FSCTL_LOCK_VOLUME. The operating system does not ensure all outstanding requests to the storage device are completed before issuing the erasure command to the device.