3.2.4.4.1.29 IVolumeClient::GetVolumeMountName (Opnum 33)

The GetVolumeMountName method retrieves the mount name for a volume, partition, or logical drive.

 HRESULT GetVolumeMountName(
   [in] LdmObjectId volumeId,
   [out] unsigned long* cchMountName,
   [out, size_is(,*cchMountName)] WCHAR** mountName
 );

volumeId: Specifies the OID of the volume for which the mount name is being retrieved.

cchMountName: Pointer to the length of mountName, including the terminating null character.

mountName: Pointer to the null-terminated mount name of the volume, in Unicode characters, in the format \\?\Volume{guid}(note that the question mark is literal, not a wildcard). Memory for the string is allocated by the server and freed by the client.

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).

Upon receiving this message, the server MUST validate parameters:

  1. Verify that the volume, partition, or logical drive specified by volumeId is in the list of storage objects.

  2. Verify that cchMountName and mountName are not NULL.

If parameter validation fails, the server MUST fail the operation immediately, returning an appropriate error as its response to the client.

Otherwise, the server MUST compose a response to the client as follows:

  1. Retrieve the mount name of the volume, partition, or logical drive specified by volumeId in the format "\\?\Volume{guid}"(note that the question mark is literal, not a wildcard).

  2. Allocate a buffer large enough to contain the mount name, including the terminating null character.

  3. Populate the buffer with the mount name, including the terminating null character.

  4. The buffer MUST be returned to the client in the output parameter mountName.

  5. The number of characters in the buffer, including the terminating null character, MUST be returned in the output parameter cchMountName.

  6. Return the response that contains the preceding output parameters and the status of the operation.

The server MUST NOT change the list of storage objects as part of processing this message.