INtime SDK Help
ntxCreateRtProcess, ntxCreateRtProcessFromResource
INtime SDK v7.1 > About INtime > INtime Kernel > Processes > ntxCreateRtProcess, ntxCreateRtProcessFromResource

ntxCreateRtPrcess(W) loads an RT executable file (RTA) and runs it in a new process.

ntxCreateRtProcessFromResource(W) loads the RTA from a binary resource in the Windows application instead of from a file.

NTXHANDLE ntxCreateRtProcess(
    NTXLOCATION hLoc,
    LPSTR pExecutableFile,
    LPSTR pProcessArguments,
    PNTXPROCATTRIBS pProcessAttributes,
    DWORD dwFlags
);
        
NTXHANDLE ntxCreateRtProcessW(
    NTXLOCATION hLoc,
    LPCWSTR pExecutableFile,
    LPCWSTR pProcessArguments,
    PNTXPROCATTRIBS pProcessAttributes,
    DWORD dwFlags
);
        
NTXHANDLE ntxCreateRtProcessFromResource(
    NTXLOCATION hLoc,
    HGLOBAL hResource,
    DWORD dwRtaSize,
    LPSTR pProcessArguments,
    PNTXPROCATTRIBS pProcessAttributes,
    DWORD dwFlags
);

NTXHANDLE ntxCreateRtProcessFromResourceW(
    NTXLOCATION hLoc,
    HGLOBAL hResource,
    DWORD dwRtaSize,
    LPCWSTR pProcessArguments,
    PNTXPROCATTRIBS pProcessAttributes,
    DWORD dwFlags
);

Parameters

hLoc
The location of the RT nucleus on which the process will be created. This can be any valid NTXLOCATION value, for example as returned from calls such as ntxGetLocationByName.
pExecutableFile
The path name to the RTA file which will be loaded and started as a new process.
hResource
A handle to the binary resource containing the RTA.
dwRtaSize
Size of the binary resource in bytes.
pProcessArguments
A pointer to a string that contains the process' arguments, or NULL if there are none.
pProcessAttributes
A pointer to an NTXPROCATTRIBS structure, or NULL if the Application Loader defaults are to be used.
dwFlags
Controls certain attributes of the new process. Undefined flag bits must be zero. Currently defined flag bits include:
NTX_PROC_DEBUG Causes the process to start in a halted state for debugging. (Identical to the RT Application Loader's -debug switch.)
NTX_PROC_EXECUTABLE_DS Marks the process' data segment executable. (Identical to the RT Application Loader's -odseg switch.)
NTX_PROC_SHOW_PROGRESS Causes the RT Application Loader's progress bar to display during the ntxCreateRtProcess call.
NTX_PROC_WAIT_FOR_INIT

Causes the RT Application Loader to wait for the loaded process to complete its initialization phase. The loader waits until an object (it can be any object) is cataloged as "R?END_INIT" in the loaded process's object directory, or the internal timeout period elapses.

To catalog an object as R?END_INIT the following API call can be used when the INtime Process has finished its initialization phase: CatalogRtHandle(NULL_RTHANDLE, GetRtThreadHandles(THIS_PROCESS), static_cast("R?END_INIT"));

NTX_PROC_XM Causes the loader to load the target process in XM mode, with an extended VSEG. This flag overrides the default value in the RTA file PEX header as set by the linker.
NTX_PROC_NOTXM Causes the loader to load the target process in standard mode, with a standard VSEG. This flag overrides the default value in the RTA file PEX header as set by the linker.
NTX_PROC_SUSPEND Causes the loader to load the target process and then to suspend it, pending a call to ntxStartRtProcess.

Return Values

The handle to the new process.
Success.
NTX_BAD_NTXHANDLE if the process was not created. Call ntxGetLastRtError to obtain extended status.
Failure.

Remarks

There is limited UNICODE support for some NTX calls. By defining the macro _UNICODE_NTX_MINI_ the standard calls are mapped to their wide-character equivalents.

Status

E_LOCATION
Invalid location value.
E_BAD_ADDR
A pointer parameter conatined an invalid address.
E_FNEXIST
The filename in the pExecutableFile parameter does not exist.
E_NTX_COMM_FAILURE
The link died while creating the process.
E_NTX_INTERNAL_ERROR
The NTX DLL code encountered an internal error.

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/nt/include/ntx.h ntx.h ntx.lib
INtime 4.01 (for 64-bit Windows) intime/nt/include/ntx.h ntx.h ntx64.lib
See Also