3.2.4.4.1.24 IVolumeClient::EnumVolumes (Opnum 28)

The EnumVolumes method enumerates the dynamic volumes of the server.

 HRESULT EnumVolumes(
   [in, out] unsigned long* volumeCount,
   [out, size_is(,*volumeCount)] VOLUME_INFO** LdmVolumeList
 );

volumeCount: Pointer to the number of elements returned in LdmVolumeList.

LdmVolumeList: Pointer to an array of VOLUME_INFO structures representing the dynamic volumes of the server. Memory for the array 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:

  • Verify that volumeCount and LdmVolumeList 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. Enumerate all dynamic volume objects from the list of storage objects.

  2. Allocate a buffer large enough to contain VOLUME_INFO structures that describe all enumerated dynamic volumes.

  3. Populate each VOLUME_INFO structure in the buffer with information about the dynamic volume.

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

  5. The number of VOLUME_INFO structures in the buffer MUST be returned in the output parameter volumeCount.

  6. Return a response containing 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.