RtfwGetPIDByScheduledID

RtfwGetPIDByScheduledID retrieves the last known PID of a scheduled process that is either currently running or has run in the past.

Syntax

bool RtfwGetPIDByScheduledID(
	RTFW_SCHEDULED_ID scheduledID,
	unsigned int * ProcessID
);

Parameters

scheduledID

Identifies a configured scheduled process by its scheduled launch order, which is returned to the client by RtfwCreateScheduledProcess in field ScheduledID of structure RTFW_SCHEDULED_PROCESS.

ProcessID

Returns the last known or currently running PID of a scheduled process. Returns 0 if the Scheduled Process has never run.

Return Value

The function returns true if it succeeds. Otherwise, it returns false. Call GetLastError for additional error information.

Possible error codes:

Error Code Meaning
ERROR_INVALID_PARAMETER One of the parameters of this function is NULL, or a field within the structure is invalid.
RT_ERROR_REGISTRY_MISSING Could not find a PID value. This indicates the scheduled process has never been run.
RT_ERROR_SCHEDULED_PROCESS_NOT_FOUND Could not find a scheduled process that matches the specified scheduledID.
RT_ERROR_SCHEDULED_PROCESS_LOCK_FAILURE Failed to obtain the lock to serialize starting/stopping the RTX64 Subsystem.
RT_ERROR_SUBSYSTEM_NOT_STARTED The Subsystem is not running. The PID is invalid.
   

Remarks

This function has locking to allow for thread safety. It shares a lock with all other scheduled process functions.

Requirements

Minimum Required Version RTX64 3.5
Header RtfwAPI.h
Library RtfwAPI.lib

See Also:

RtfwCreateScheduledProcess

RtfwDeleteAllScheduledProcesses

RtfwDeleteScheduledProcessByID

RtfwGetCurrentScheduledProcessCount

RtfwGetScheduledProcess

RtfwModifyScheduledProcess

PRTFW_SCHEDULED_PROCESS