3.2.5.4.3 SchRpcRetrieveTask (Opnum 2)

The SchRpcRetrieveTask method MUST return a task definition.

 HRESULT SchRpcRetrieveTask(
   [in, string] const wchar_t* path,
   [in, string] const wchar_t* lpcwszLanguagesBuffer,
   [in] unsigned long* pulNumLanguages,
   [out, string] wchar_t** pXml
 );

path: MUST contain the full path associated with an existing task as specified in section 2.3.11.

lpcwszLanguagesBuffer: If non-NULL, this parameter MUST contain a list of language names separated by the '\' character. The language names MUST be taken from the "String name" column of the table.

pulNumLanguages: The client SHOULD specify the number of language names in languagesBuffer. The server MUST ignore this parameter.

pXml: MUST contain the task definition in XML format, localized using the language names contained in the languagesBuffer parameter. For more information about XML localization, see section 2.5.8.

Return Values: For more information on return codes, see section 2.3.14, or Win32 Error Codes in [MS-ERREF] section 2.1.

Upon receipt of the SchRpcRetrieveTask call, the server MUST:

  • Return E_INVALIDARG if the path parameter is the root.

  • Return 0x80070003, the HRESULT value of the Win32 error ERROR_PATH_NOT_FOUND, if the path does not exist in XML task store.

  • Return the HRESULT value of the Win32 error ERROR_FILE_NOT_FOUND if the task does not exist in XML task store.

  • Return E_ACCESSDENIED if the caller does not have read access to the path in the XML task store.

  • Return 0x8007007B, the HRESULT value of the Win32 error ERROR_INVALID_NAME, if the specified path is not in the format specified in section 2.3.11.

  • Retrieve the task definition from the path in the XML task store. If the languagesBuffer parameter is non-NULL, the server MUST replace localizable strings in the task definition according to the language names contained in the languagesBuffer parameter, as specified in section 2.5.8. Multiple languages are used in order of preference. If no language can localize the string, the server default is used.

  • Return the task definition in the xmlTaskDefinition parameter and return S_OK.

If any errors are raised during the processing they are returned. For more information on return codes, see section 2.3.14 and Win32 Error Codes in [MS-ERREF] section 2.1.