INtime SDK Help
LoadRtLibrary
INtime SDK v7.1 > About INtime > INtime Kernel > RSLs (real-time shared libraries) > LoadRtLibrary

Dynamically loads a Real-time Shared Library module. When successfully loaded, the operating system calls the module's RslMain entry function with a reason code of RSL_PROCESS_ATTACH. If a module with the same name is already loaded into memory, that module is remapped into the calling process without reloading the file.

If the RslMain function returns a value of FALSE, then the call to LoadRtLibrary fails.

If the process has been created with the PROC_STRICTRSL flag set, then if a module is being loaded with a full pathname, a test is made against the full pathname of any loaded module rather than just the filename before deciding to load the module. This allows a process to choose to load an RSL of a different version compared to an already-loaded module of the same name.

RTHANDLE LoadRtLibrary(
    char *lpModuleName
);

Parameters

lpModuleName
String containing the filename of the module. The filename in this case may be only the filename without path information. In this case a search is performed in the following directories:
  • The directory where the original .RTA file was loaded from
  • The process's current directory.
  • INtime for Windows:
    • The path given by the registry value HKLM\SOFTWARE\TenAsys\INtime\RTAppLoader\RSLPath, if it exists. This value may be of type REG_SZ or REG_MULTI_SZ. If it is of type REG_MULTI_SZ then it may contain multiple paths which are searched in the order of appearance.
    • The directory %INTIME%\rt\lib
    • The directory %INTIME%\bin
  • INtime Distributed RTOS:
    • The paths given by the PATH environment variable. The value is a colon-separated list of paths, defined in the [CLIB] section of the configuration file for the node.

If a full path is given in lpModuleName, then no search is performed.

Return Values

The handle associated with the loaded module.
Success.
NULL_RTHANDLE
Failure. To determine the status, call GetLastRtError.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/rt/include/rtbase.h rt.h rt.lib
See Also