3.2.4.4.1.1 IVolumeClient::EnumDisks (Opnum 3)

The EnumDisks method enumerates the server's mass storage devices.

 HRESULT EnumDisks(
   [out] unsigned long* diskCount,
   [out, size_is(,*diskCount)] DISK_INFO** diskList
 );

diskCount: Number of pointers in diskList.

diskList: Pointer to an array of DISK_INFO structures.

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] section 2.1; 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 diskCount and diskList 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 disk objects from the list of storage objects.

  2. Allocate a buffer large enough to contain DISK_INFO structures that describe all enumerated disks.

  3. Populate each DISK_INFO structure in the buffer with information about the disk.

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

  5. The number of DISK_INFO structures in the buffer MUST be returned in the output parameter diskCount.

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