IOCTL_DISK_FORMAT_TRACKS - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
// ntdddisk.h

// CTL_CODE(0x0007, 0x006, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_FORMAT_TRACKS 0x0007C018

View the official Windows Driver Kit DDI reference
// winioctl.h

// CTL_CODE(0x0007, 0x006, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_DISK_FORMAT_TRACKS 0x0007C018

View the official Win32 API reference

NtDoc

No description available.

Windows Driver Kit DDI reference (ni-ntdddisk-ioctl_disk_format_tracks)

IOCTL_DISK_FORMAT_TRACKS IOCTL

Description

Formats the specified set of contiguous tracks on the disk.

Parameters

Major code

Input buffer

The buffer at Irp->AssociatedIrp.SystemBuffer contains the FORMAT_PARAMETERS data. Parameters.DeviceIoControl.InputBufferLength in the I/O stack location of the IRP indicates the size, in bytes, of the buffer.

Input buffer length

Parameters.DeviceIoControl.InputBufferLength in the I/O stack location of the IRP indicates the size, in bytes, of the buffer.

Output buffer

The device driver returns an array of BAD_TRACK_NUMBER values to the buffer at Irp->AssociatedIrp.SystemBuffer.

Output buffer length

Length of the buffer.

Input/output buffer

Input/output buffer length

Status block

The Information field is set to the size of the returned bad-track array when the Status field is set to STATUS_SUCCESS. Otherwise, the Information field is zero and the Status field possibly can be set to STATUS_INVALID_PARAMETER or STATUS_MEDIA_WRITE_PROTECTED if the media is removable.

See also

FORMAT_PARAMETERS


Win32 API reference (ni-winioctl-ioctl_disk_format_tracks)

IOCTL_DISK_FORMAT_TRACKS IOCTL

Description

Formats a specified, contiguous set of tracks on a floppy disk. To provide additional parameters, use IOCTL_DISK_FORMAT_TRACKS_EX instead.

To perform this operation, call the DeviceIoControl function with the following parameters.

BOOL DeviceIoControl(
  (HANDLE) hDevice,             // handle to device
  IOCTL_DISK_FORMAT_TRACKS,     // 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
);

Parameters

Input buffer

Input buffer length

Output buffer

Output buffer length

Input/output buffer

Input/output buffer length

Status block

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.

See also