Partager via


IOCTL_DISK_FORMAT_VOLUME (Windows CE 5.0)

Send Feedback

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

The following steps describe how to format a drive,

  1. 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.

  2. 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

DeviceIoControl

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.