This function rebuilds the device parameters (including the Volume Parameter Block (VPB) used by the operating system to identify the volume), simulates a close on the current device handle, and forces a mount on the volume.

Function 02h dismounts the volume from the current file system drive (FSD), attaches the new FSD, and reattaches the current handle to the volume's new FSD. It is typically called after a new boot sector has been written to a volume (after a format has been done). The caller must have the disk or diskette locked when calling this function; otherwise, the function fails with the error ERROR_LOCK_VIOLATION.

The caller can have only one file open to refer to the disk or diskette. If other processes have the volume open or the calling process has opened the volume multiple times, the call fails and ERROR_DRIVE_BUSY is returned.


[Back] [Next]