3.1.4.3.6.3 Enumerate a Task's Running Instances

To enumerate a task's running instances the client MUST first know the task's path. The task's path is obtained when adding the task (section 3.1.4.3.1) and when enumerating tasks (section 3.1.4.3.6).

The client MUST then invoke the SchRpcEnumInstances method with the following parameters:

  • The path of the existing task in the path parameter.

  • TASK_ENUM_HIDDEN in the flags parameter to include hidden tasks in the enumeration or 0 to skip them.

  • A pointer to a DWORD to receive the number of instance identifiers in the pcGuids parameter.

  • A pointer to a buffer to receive the array of instance identifiers in the pGuids parameter.

The client MUST deallocate the pNames after successful execution of the method, as specified in [C706] section 5.1.1.1.