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(
[in] RTFW_SCHEDULED_ID scheduledID,
[out] unsigned int * ProcessID
);
Parameters
[in] 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.
[out] ProcessID
Returns the last known or currently running PID of a scheduled process. Returns 0 if the Scheduled Process has never run.
Return Value
If the function succeeds, it returns TRUE. If the function fails, it returns FALSE. Call GetLastError to obtain an error code.
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 wRTOS 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.
If the Subsystem is running when the RtfwGetLocalMemoryConfiguration API is called, the values returned by this function may differ from the values currently in use by the Subsystem.
Requirements
| Minimum supported version | Header | Library |
|---|---|---|
|
wRTOS 1.0 SDK |
RtfwApi.h |
RtfwApi.lib |
See Also: