3.2.5.4.11 SchRpcStopInstance (Opnum 10)

The SchRpcStopInstance method MUST stop a specified instance of a task.

 HRESULT SchRpcStopInstance(
   [in] GUID guid,
   [in] DWORD flags
 );

guid: MUST contain the task instance GUID.

flags: Unused. The client MUST send 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 SchRpcStopInstance call, the server MUST:

  • Return E_INVALIDARG if the flags parameter is non-zero.

  • Return SCHED_E_TASK_NOT_RUNNING if there is no entry in the running task list with an instance ID matching the guid parameter.

  • Return E_ACCESSDENIED if the caller does not have execute access to the task.

  • Stop the instance of the running task (section 3.2.5.1.3).

  • Return S_OK.