FormatVolume (Windows CE 5.0)

Send Feedback

This function formats a volume according to the options specified.

DWORD FormatVolume(
HANDLEhVolume,PDISK_INFOpdi,PFORMAT_OPTIONSpfo,PFN_PROGRESSpfnProgress,PFN_PROGRESSpfnMessage);

Parameters

  • hVolume
    [in] Handle to disk or partition. Call CreateFile to obtain a handle to the volume.
  • pdi
    [in] Not used.
  • pfo
    [in] Pointer to a FORMAT_OPTIONS structure. The following fields can be specified.
    Member Description
    dwClusSize Desired cluster size in bytes, which must be power of 2.
    dwRootEntries Desired number of root directory entries.
    dwFatVersion FAT Version, either 12, 16, or 32.
    dwNumFats Number of FATs to create.
    fFullFormat TRUE if full format requested.
  • pfnProgress
    [in] Callback function indicating progress.
  • pfnMessage
    [in] Callback function used to display a message to user.

Return Values

If the function succeeds, the return value is ERROR_SUCCESS. If it fails, the return valid is ERROR_GEN_FAILURE.

Remarks

For best results, use the correct type of handle. For example, if the store to be scanned is partitioned, use a handle to the partition. If the store is not partitioned, use a disk handle.

Requirements

OS Versions: Windows CE .NET 4.0 and later.

Header: Formatdisk.h.

Link Library: Fatutil.dll.

See Also

CreateFile | DeviceIoControl | DISK_INFO | FORMAT_OPTIONS

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.