IOCTL_DISK_FORMAT_VOLUME
This IOCTL is issued to FAT to format to perform a high level format of the volume.
Parameters
- hDevice
[in] Handle to the block device. - dwIoControlCode
[in] Specifies this IOCTL. - lpInBuffer
Not used. - nInBufferSize
Not used. - lpOutBuffer
Not used. - nOutBufferSize
Not used. - lpBytesReturned
[out] Pointer to a DWORD to receive the total number of bytes returned. - lpOverlapped
Not used.
Return Values
If returns TRUE, then the input/output control was successfully processed; otherwise, returns FALSE.
Remarks
To format a drive
Open a handle to the volume.
The name of the volume to open has the format \FolderName\Vol:, where FolderName is the name that FATFS uses for the root directory name of the mounted volume.
Call DeviceIoControl with the volume handle and IOCTL_DISK_FORMAT_VOLUME.
The following code example shows this procedure.
hVolume = CreateFile(TEXT("\Storage Card\Vol:"), GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); DeviceIoControl(hVolume, IOCTL_DISK_FORMAT_VOLUME, NULL, 0, NULL, 0, NULL, NULL);
Requirements
OS Versions: Windows CE 3.0 and later.
Header: Diskio.h.
See Also
Last updated on Wednesday, April 13, 2005
© 2005 Microsoft Corporation. All rights reserved.