[BOOT][SDK:RTL] Compile a reduced RTL library for FreeLdr / NT bootloader...

... as it should have always been done (and must be done for NTDLL
and NTOS kernel as well). This allows using the RTL with the correct
definitions and the reduced functionality available at boot-time.

+ Make the RTL main header compatible.

In addition, this will permit re-using existing code that already
uses the RTL (mostly string conversions).

See commits 427c90af3 (r36761) and b46e8cc18 (r36980) for some
background.
This commit is contained in:
Hermès Bélusca-Maïto 2022-03-21 21:06:52 +01:00
parent 2ac49f0824
commit 24cb57fdea
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
8 changed files with 422 additions and 15 deletions

View file

@ -9,13 +9,15 @@
#ifndef RTL_H
#define RTL_H
/* We're a core NT DLL, we don't import syscalls */
/* We are a core NT DLL, we don't import syscalls */
#define _INC_SWPRINTF_INL_
#undef __MSVCRT__
/* C Headers */
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#ifndef _BLDR_
/* PSDK/NDK Headers */
#define WIN32_NO_STATUS
@ -43,6 +45,12 @@
/* SEH support with PSEH */
#include <pseh/pseh2.h>
#else
#include <ndk/rtlfuncs.h>
#endif /* _BLDR_ */
/* Internal RTL header */
#include "rtlp.h"