3.2.4.4.3.19 IVolumeClient3::AssignDriveLetter (Opnum 22)
The AssignDriveLetter method assigns the specified drive letter to a volume, partition, or logical drive.
-
HRESULT AssignDriveLetter( [in] wchar_t letter, [in] unsigned long forceOption, [in] hyper letterLastKnownState, [in] LdmObjectId storageId, [in] hyper storageLastKnownState, [out] TASK_INFO* tinfo );
letter: Drive letter to assign, specified as a single case-insensitive Unicode character.
forceOption: Value that indicates if drive letter assignment is forced when it fails. This method call will fail if the force flag is not set and some other application has a lock on the volume.
-
Value
Meaning
NO_FORCE_OPERATION
0x00000000
If the volume, partition, or logical drive specified by storageId already has a drive letter assigned, and freeing it fails because the object is in use, assignment fails and the old drive letter is retained.
FORCE_OPERATION
0x00000001
If the volume, partition, or logical drive specified by storageId already has a drive letter assigned, and freeing it fails because the volume is in use, its removal is forced and assignment of the new drive letter succeeds.
letterLastKnownState: Drive letter's last known modification sequence number.
storageId: Specifies the object identifier of the volume, partition, or logical drive to which the drive letter is being assigned.
storageLastKnownState: Last known modification sequence number of the volume, partition, or logical drive to which the drive letter is being assigned.
tinfo: Pointer to a TASK_INFO structure that the client can use to track the request's progress.
Return Values: The method MUST return 0 or a nonerror HRESULT on success, or an implementation-specific nonzero error code on failure (as specified in [MS-ERREF]; see also section 2.2.1 for HRESULT values predefined by the Disk Management Remote Protocol).
When the server receives an IVolumeClient3::AssignDriveLetter message, it MUST process that message as specified in Section IVolumeClient::AssignDriveLetter (section 3.2.4.4.1.19).