KasperskyOS Community Edition 1.1
[Topic libkos_tasks]

EntityConnect()

This function is declared in the header file coresrv/entity/entity_api.h.

Retcode EntityConnect(Entity *cl, Entity *sr);

This function connects processes with an IPC channel. To do so, the function creates IPC handles for the client process cl and the server process sr, and then binds the handles to each other. The created channel will be included into the default group of channels (the name of this group matches the name of the server process). The connected processes must be in the stopped state.

If successful, the function returns rcOk.

Page top
[Topic entity_connect]

EntityConnectToService()

This function is declared in the header file coresrv/entity/entity_api.h.

Retcode EntityConnectToService(Entity *cl, Entity *sr, const char *name);

This function connects processes with an IPC channel. To do so, the function creates IPC handles for the client process cl and the server process sr, and then binds the handles to each other. The created channel will be added to the group of channels with the specified name. The connected processes must be in the stopped state.

If successful, the function returns rcOk.

Page top
[Topic entity_connect_to_service]

EntityInfo

The EntityInfo structure describing the process is declared in the file named if_connection.h.

typedef struct EntityInfo {

/* process class name */

const char *eiid;

/* maximum number of endpoints */

nk_iid_t max_endpoints;

/* information about the process endpoints */

const EndpointInfo *endpoints;

/* arguments to be passed to the process when it is started */

const char *args[ENTITY_ARGS_MAX + 1];

/* environment variables to be passed to the process when it is started */

const char *envs[ENTITY_ENV_MAX + 1];

/* process flags */

EntityFlags flags;

/* process components tree */

const struct nk_component_node *componentTree;

} EntityInfo;

typedef struct EndpointInfo {

char *name; /* fully qualified name of the endpoint */

nk_iid_t riid; /* endpoint ID */

char *iface_name; /* name of the interface implemented by the endpoint */

} EndpointInfo;

typedef enum {

ENTITY_FLAGS_NONE = 0,

/* the process is reset if an unhandled exception occurs */

ENTITY_FLAG_DUMPABLE = 1,

} EntityFlags;

Page top
[Topic entity_info]

EntityInit()

This function is declared in the header file coresrv/entity/entity_api.h.

Entity *EntityInit(const EntityInfo *info);

This function creates a process. The info parameter defines the name of the process class and (optionally) its endpoints, arguments and environment variables.

The created process will have the default name (matching the process class name), and the default name for the executable file (also matching the process class name).

If successful, the function returns the structure describing the new process. The created process is in the stopped state.

If an error occurs, the function returns RTL_NULL.

Page top
[Topic entity_init]

EntityInitEx()

This function is declared in the header file coresrv/entity/entity_api.h.

Entity *EntityInitEx(const EntityInfo *info, const char *name,

const char *path);

This function creates a process.

The info parameter defines the name of the process class and (optionally) its endpoints, arguments and environment variables.

The name parameter defines the name of the process. If it has the RTL_NULL value, the process class name from the info parameter will be used as the process name.

The path parameter defines the name of the executable file in the solution's ROMFS image. If it has the RTL_NULL value, the process class name from the info parameter will be used as the file name.

If successful, the function returns the structure describing the new process. The created process is in the stopped state.

If an error occurs, the function returns RTL_NULL.

Page top
[Topic entity_init_ex]

EntityRun()

This function is declared in the header file coresrv/entity/entity_api.h.

Retcode EntityRun(Entity *entity);

This function starts a process that is in the stopped state. The process is described by the entity structure.

If successful, the function returns rcOk.

Page top
[Topic entity_run]