3.2.5.4.12 SchRpcStop (Opnum 11)

The SchRpcStop MUST stop all currently running instances of a task specified by a path.

 HRESULT SchRpcStop(
   [in, string, unique] const wchar_t* path,
   [in] DWORD flags
 );

path: MUST contain the full path to a task using the format specified in section 2.3.11.

flags: Unused. The client MUST set 0, and the server MUST return an error if nonzero.

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 SchRpcStop call, the server MUST:

  • Return E_INVALIDARG if the flags parameter is nonzero or the path parameter is NULL.

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

  • Return the value 0x80070002, the HRESULT form of the Win32 error ERROR_FILE_NOT_FOUND if the task specified in the path parameter does not exist in the Task Schedule store on the server or the file specified by the path parameter does not exist in the XML task store.<74>

  • Examine the running task list for all entries whose path matches the path parameter, and stop them (section 3.2.5.1.3) if the caller has execute access to the task.

  • Not stop the task and return S_OK when the task is a hidden task.<75>

  • Return S_FALSE if no running task instances were stopped, otherwise S_OK.

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