Contents
ExecutionManager component
The API is defined in the header files located in the directory sysroot-*-kos/include/component/execution_manager/
from the KasperskyOS SDK.
The ExecutionManager component usage scenario is described in the article titled Starting a processes using the ExecutionManager system program.
execution_manager_proxy.h interface
The API is defined in the header file sysroot-*-kos/include/component/execution_manager/kos_ipc/execution_manager_proxy.h
from the KasperskyOS SDK.
The interface contains the CreateExecutionManager()
function for getting the pointer to the instance of the IExecutionManager
interface that is required for working with the ExecutionManager component. Using the cfg
input parameter, this function accepts configuration parameters in the ExecutionManagerConfig
structure. All fields of this structure are optional.
execution_manager_proxy.h functions
Function |
Information about the function |
---|---|
|
Purpose Gets the pointer to the instance of the Parameters
Returned values If successful, the function returns |
Usage example:
client.cpp
IExecutionManager interface
The API is defined in the header file sysroot-*-kos/include/component/execution_manager/i_execution_manager.h
from the KasperskyOS SDK.
The IExecutionManager
interface lets you access pointers to the following interfaces:
IProcessControl
– interface that lets you start a process from an executable file installed by the PackageManager component from the KPA package in a KasperskyOS-based solution, and lets you receive information about the process (including information about its completion) and stop this process.IApplicationController
– interface that lets you start a process from any executable file whose location in the file system is known, and lets you stop this process.IStateProvider
– interface for receiving information about a process that was started using theIApplicationController
interface.ISystemController
– interface for managing the system.
Usage example:
client.cpp
IProcessControl interface
The API is defined in the header file sysroot-*-kos/include/alm/execution_manager/i_process_control.h
from the KasperskyOS SDK.
The API lets you do the following:
- Start a process from an executable file installed by the PackageManager component from the KPA package in a KasperskyOS-based solution.
- Get information about process, including information about its termination.
- Stop a process.
Information about API functions is provided in the table below.
Starting a process
To start the process, call the StartProcess()
function. Using the opts
input parameter, this function accepts process startup parameters in the StartOptions
structure. All fields of this structure are optional for initialization.
During initialization of the StartOptions
structure, the parent
handle transport container is populated with the default values, which indicate the absence of a parent process. You can create a process hierarchy by passing the handle of a parent process in this parameter to a started child process.
The userHandles
vector is a component of the StartOptions
structure and contains a list of custom handles that will be transferred to the process when it is started. Items of this list are pairs that are defined in the UserHandleItem
structure. These pairs consist of a handle and its name. After a process is started, the handles transferred to this process can be found by using the KosTaskLookupResource()
function based on the names of these handles.
The input parameters pkgId
and runConfigId
of the StartProcess()
function are defined in the KPA package manifest. Their values may be received by using functions from the IPackageManifest interface of the PackageManager component.
Stopping a process
To stop the process, call the StopProcess()
function. Using the stopPolicy
input parameter, this function receives the process stop policy from the StopPolicy
enumeration.
Receiving information about a process
To request information about a process, call the GetProcessState()
function. Using the state
output parameter, this function returns information about a process in the ProcessContext
structure.
The state
enumeration is a component of the ProcessContext
structure and describes the state of a process.
The exitStatus
enumeration is a component of the ProcessContext
structure and describes the reason for stopping a process. The ExecutableExitStatus
enumeration is defined in the header file sysroot-*-kos/include/alm/execution_manager/execution_manager_types.h
from the KasperskyOS SDK.
The numeric exitCode
parameter is a component of the ProcessContext
structure and contains the return code for a process that stopped on its own, including after receiving a stop signal. The values for this return code are defined by the developer of the KasperskyOS-based solution.
The numeric exitReason
parameter is a component of the ProcessContext
structure and contains the return code that specifies the reason for an unsuccessful attempt to start the process, or rcOk
if the startup was successful. Parameter is defined in the header file sysroot-*-kos/include/rtl_cpp/retcode.h
from the KasperskyOS SDK. This file contains return codes that are common for the APIs of all solution components and their constituent parts (see Return codes).
i_process_control.h functions
Function |
Information about the function |
---|---|
|
Purpose Starts a process. Parameters
Returned values If successful, the function returns |
|
Purpose Stops a process. Parameters
Returned values If successful, the function returns |
|
Purpose Requests information about a process. Parameters
Returned values If successful, the function returns |
Usage example:
client.cpp
IApplicationController interface
This API is defined in the header file sysroot-*-kos/include/component/execution_manager/i_application_control.h
from the KasperskyOS SDK.
The API lets you start a process from an executable file and stop this process.
Information about API functions is provided in the table below.
To start the process, call the StartEntity()
function. Using the info
input parameter, this function accepts process startup parameters in the StartEntityInfo
structure. All fields of this structure are optional for initialization. Using the resInfo
output parameter, this function returns the link to the StartEntityResultInfo
structure containing the process startup results.
To stop a process, call the ShutdownEntity()
or StopEntity()
function. The entId
input parameter is used by these functions to receive the handle that identifies the started process.
i_application_control.h functions
Function |
Information about the function |
---|---|
|
Purpose Starts a process. Parameters
Returned values If successful, the function returns |
|
Purpose Sends a termination signal to a process. Parameters
Returned values If successful, the function returns |
|
Purpose Immediately stops the execution of a process. Parameters
Returned values If successful, the function returns |
Usage example:
client.cpp
IStateProvider interface
This API is defined in the header file sysroot-*-kos/include/component/execution_manager/i_state_control.h
from the KasperskyOS SDK.
The API lets you receive information about a process that was started by using the StartEntity()
function from the IApplicationController API (see IApplicationController interface), including information about the reason for its termination.
Information about API functions is provided in the table below.
To get information about the process, call the GetApplicationState()
function. The entityId
input parameter is used by this function to receive the EntityId
-type value that identifies the running process. Using the appState
output parameter, this function returns information about a process in the AppContext
structure. AppContext
structure is defined in the header file sysroot-*-kos/include/component/execution_manager/types.h
from the KasperskyOS SDK.
The state
enumeration is a component of the AppContext
structure and describes the state of a process. State
enumeration is defined in the header file sysroot-*-kos/include/component/execution_manager/types.h
from the KasperskyOS SDK.
The exitStatus
enumeration is a component of the AppContext
structure and describes the reason for stopping a process. The ExecutableExitStatus
enumeration is defined in the header file sysroot-*-kos/include/alm/execution_manager/execution_manager_types.h
from the KasperskyOS SDK.
The numeric exitCode
parameter is a component of the AppContext
structure and contains the return code for a process that stopped on its own, including after receiving a stop signal. The values for this return code are defined by the developer of the KasperskyOS-based solution.
The numeric exitReason
parameter is a component of the AppContext
structure and contains the return code that specifies the reason for an unsuccessful attempt to start the process, or rcOk
if the process started successfully. Parameter is defined in the header file sysroot-*-kos/include/rtl_cpp/retcode.h
from the KasperskyOS SDK. This file contains return codes that are common for the APIs of all solution components and their constituent parts (see Return codes).
i_state_control functions
Function |
Information about the function |
---|---|
|
Purpose Requests information about a process. Parameters
Returned values If successful, the function returns |
Usage example:
client.cpp
ISystemController interface
The API is defined in the header file sysroot-*-kos/include/component/execution_manager/i_system_control.h
from the KasperskyOS SDK.
The API lets you terminate the system.
Information about API functions is provided in the table below.
i_system_control.h functions
Function |
Information about the function |
---|---|
|
Purpose Stops all running processes, then terminates the ExecutionManager process, then sends a device shutdown request to the kernel. Parameters N/A Returned values If successful, the function returns |
Usage example:
client.cpp