// ntdddisk.h
// CTL_CODE(0x0007, 0x00b, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_FORMAT_TRACKS_EX 0x0007C02C
View the official Windows Driver Kit DDI reference
// winioctl.h
// CTL_CODE(0x0007, 0x00b, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_FORMAT_TRACKS_EX 0x0007C02C
View the official Win32 API reference
No description available.
Is similar to IOCTL_DISK_FORMAT_TRACKS, except that it allows the caller to specify several more parameters. The additional extended parameters are the format gap length, the number of sectors per track, and an array whose element size is equal to the number of sectors per track. This array represents the track layout.
The buffer at Irp->AssociatedIrp.SystemBuffer contains the FORMAT_EX_PARAMETERS data.
Parameters.DeviceIoControl.InputBufferLength in the I/O stack location of the IRP indicates the size, in bytes, of the buffer.
The device driver returns an array of BAD_TRACK_NUMBER values to the buffer at Irp->AssociatedIrp.SystemBuffer. BAD_TRACK_NUMBER is currently defined as a WORD on 32-bit systems.
Length of the buffer.
The driver sets the Status field to STATUS_SUCCESS. Otherwise, the driver sets the Status field to STATUS_INVALID_PARAMETER if the input buffer length is < sizeof(FORMAT_EX_PARAMETERS) or if the format parameters supplied by the caller will not work on the drive to be formatted.
Formats a specified, contiguous set of tracks on a floppy disk.
To perform this operation, call the DeviceIoControl function with the following parameters.
BOOL DeviceIoControl(
(HANDLE) hDevice, // handle to device
IOCTL_DISK_FORMAT_TRACKS_EX, // dwIoControlCode
(LPVOID) lpInBuffer, // input buffer
(DWORD) nInBufferSize, // size of input buffer
(LPVOID) lpOutBuffer, // output buffer
(DWORD) nOutBufferSize, // size of output buffer
(LPDWORD) lpBytesReturned, // number of bytes returned
(LPOVERLAPPED) lpOverlapped // OVERLAPPED structure
);
Irp->IoStatus.Status is set to STATUS_SUCCESS if the request is successful.
Otherwise, Status to the appropriate error condition as a NTSTATUS code.
For more information, see NTSTATUS Values.
This device I/O control operation is for floppy disk devices only.
It is impossible to determine how many bad track numbers will be returned by this control code, so you should set the size of the array pointed to by the lpOutBuffer parameter to the following:
(total number of tracks on the floppy disk) * sizeof(BAD_TRACK_NUMBER)