3.1.4.3.6.1 Enumerate All Tasks in a Folder
To enumerate all tasks in a folder, the client MUST invoke the SchRpcEnumTasks method with the following parameters:
The path of the existing folder in the path parameter.
TASK_ENUM_HIDDEN in the flags parameter to include hidden tasks in the enumeration (or 0 to skip them).
The location of the starting index of the enumeration in the pStartIndex parameter, the number of task names to be returned in the cRequested parameter.
A pointer to a DWORD to receive the number of names returned in the pcNames parameter.
A pointer to a buffer to receive the array of names in the pNames parameter.
The client MUST deallocate the pNames after successful execution of the method as specified in [C706] section 5.1.1.1.
If the SchRpcEnumTasks method returns S_FALSE, the client MUST continue to invoke SchRpcEnumTasks until a call to SchRpcEnumTasks returns S_OK. In subsequent calls to SchRpcEnumTasks, the client MUST pass the parameter values as specified earlier, except the client MUST NOT modify the pStartIndex parameter because the previous call to SchRpcEnumTasks returned the index of the next task to be enumerated.