3.2.4.4.2.1 IVolumeClient2::GetMaxAdjustedFreeSpace (Opnum 3)

The GetMaxAdjustedFreeSpace method retrieves the maximum amount of free space on a disk, after adjusting for partition boundaries.

 HRESULT GetMaxAdjustedFreeSpace(
   [in] LdmObjectId diskId,
   [out] LONGLONG* maxAdjustedFreeSpace
 );

diskId: Specifies the OID of the disk to query.

maxAdjustedFreeSpace: Pointer to the maximum free space on the disk, adjusted for partition boundaries.

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 disk specified by diskId is in the list of storage objects.<188>

  2. Verify that maxAdjustedFreeSpace is 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. Compute the maximum amount of free space in bytes that is available for allocation to new partitions and volumes. The computation MUST take into account any partition alignment rules enforced by the server.

  2.  The maximum amount of free space MUST be returned to the client in the output parameter maxAdjustedFreeSpace.

  3.  Return a response that contains the output parameters mentioned previously and the status of the operation.

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