3.2.4.4.1.50 IVolumeClient::EnumTasks (Opnum 67)

The EnumTasks method enumerates the tasks currently running on the server.

 HRESULT EnumTasks(
   [in, out] unsigned long* taskCount,
   [out, size_is(,*taskCount)] TASK_INFO** taskList
 );

taskCount: Number of elements returned in the taskList array. The client SHOULD set the value of this parameter as zero.

taskList: Array of TASK_INFO structures that describe the tasks running on 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 taskCount and taskList 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 task objects from the list of tasks currently running on the server.

  2. Allocate a buffer large enough to contain TASK_INFO structures that describe all enumerated tasks.

  3. Populate each TASK_INFO structure in the buffer with information about the task.

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

  5. The number of TASK_INFO structures in the buffer MUST be returned in the output parameter taskCount.

  6. Return a response containing the output parameters mentioned previously and the status of the operation.

The server MUST NOT change the list of tasks currently running on the server as part of processing this message.<176>