Поделиться через


IOCTL_DISK_FORMAT_VOLUME (Windows Embedded CE 6.0)

1/6/2010

This I/O control is issued to the FAT to be formatted to perform a high-level format of the volume.

Parameters

  • hDevice
    [in] Handle to the block device.
  • dwIoControlCode
    [in] Specifies this I\O control.
  • 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

TRUE indicates success. FALSE indicates failure.

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 FAT file system name for the root directory of the mounted volume.

  2. Call the DeviceIoControl function with the volume handle and this I/O control.
    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

Header diskio.h
Windows Embedded CE Windows CE 3.0 and later

See Also

Concepts

FAT File System I/O Controls

Other Resources

DeviceIoControl