20 lines
555 B
C
20 lines
555 B
C
// Native process startup. This file owns process-local native runtime initialization before main runs.
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include <ntlite/exception.h>
|
|
#include <ntlite/syscall.h>
|
|
|
|
extern int main(void);
|
|
|
|
// Initializes native process state and exits with main's return value.
|
|
void NtlNativeStart(void) {
|
|
KSTATUS status = NtlInitializeExceptionRuntime();
|
|
if (status != NTLSTATUS_SUCCESS) {
|
|
while (true) SysExitProcess((int32_t)status);
|
|
}
|
|
|
|
int exitCode = main();
|
|
while (true) SysExitProcess(exitCode);
|
|
}
|