3.1.4.3.4.4 Modify a Task Definition

To modify a task definition, the client MUST first know the path of the task. The path of the task is determined when the client creates the task or queries the server, as specified in section 3.1.4.3.6.

Next, the client MUST invoke SchRpcRetrieveTask with the following parameters:

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

  • An array of strings specifying the required localization languages, as specified in [RFC3066], in priority order in the languagesBuffer.

  • A pointer to an unsigned long containing the number of strings in the array in the pulNumLanguages parameter.

  • The location of a buffer to receive the localized task definition in the xmlTaskDefinition parameter.

After retrieving the task definition, the client MUST modify the task definition as required and MUST invoke SchRpcRegisterTask with the following parameters:

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

  • The modified task definition in the xmlTaskDefinition parameter.

  • The required flag bits (including TASK_UPDATE) in the flags parameter.

  • The required security description (or NULL) in the sddl parameter.

  • The required method of logging on in the logonType parameter, as specified in section 2.3.9.

  • The number of credentials in the cCreds parameter.

  • The credentials in the pCreds parameter.

  • The location of a buffer to receive the actual path (if required) in the pActualPath parameter.

  • The location of a buffer to receive the ErrorInfo (if required) in the pErrorInfo parameter.

Finally, the client MUST deallocate the actual path and ErrorInfo, as specified in [C706] section 5.1.1.1.