19 lines
535 B
C
19 lines
535 B
C
// Native process startup. This file owns process-local native runtime initialization before main runs.
|
|
|
|
#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) {
|
|
uint32_t status = NtlInitializeExceptionRuntime();
|
|
if (status != NTLSTATUS_SUCCESS) {
|
|
while (true) SysExitProcess((int32_t)status);
|
|
}
|
|
|
|
int exitCode = main();
|
|
while (true) SysExitProcess(exitCode);
|
|
}
|