3.1.4.1.2 Drive Letters

AssignDriveLetter: Before invoking AssignDriveLetter, the client MUST invoke FTEnumVolumes, EnumDiskRegions, or EnumVolumes to retrieve the volume ID and the volume's last known state. The client MUST pass these returned values as the storageId and storageLastKnownState input parameters to the AssignDriveLetter method. The EnumDiskRegions method returns these values as the REGION_INFO::volId and REGION_INFO::lastKnownState structure members. For volumes on basic disks, the region's lastKnownState is the same as the volume's lastKnownState. FTEnumVolumes and EnumVolumes return these parameters as the VOLUME_INFO::id and VOLUME_INFO::lastKnownState structure members.

Before invoking AssignDriveLetter, the client MUST also invoke EnumDriveLetters. The EnumDriveLetters method returns the drive letter's last known state as DRIVE_LETTER_INFO::lastKnownState. The client MUST pass this returned value as the letterLastKnownState input parameter to the AssignDriveLetter method. The EnumDriveLetters method also returns the status of the drive letter (in use or free) as the DRIVE_LETTER_INFO::inUse structure member; and this value can be used to determine whether the drive letter is already in use by some other volume.

FreeDriveLetter: The client MUST use the preceding call sequence description for AssignDriveLetter, except that in the final step the client MUST use FreeDriveLetter, rather than AssignDriveLetter, to free the drive letter.