diff --git a/src/msvc_crt/msvc_crt.c b/src/msvc_crt/msvc_crt.c index c251a7b7..aa2c54bc 100644 --- a/src/msvc_crt/msvc_crt.c +++ b/src/msvc_crt/msvc_crt.c @@ -1,6 +1,22 @@ // Copyright (c) Epic Games Tools // Licensed under the MIT license (https://opensource.org/license/mit/) +internal String8 +msvcrt_ctr_entry_from_user_entry(String8 user_entry) +{ + String8 crt_entry = {0}; + if (str8_match_lit("wmain", user_entry, 0)) { + crt_entry = str8_lit("wmainCRTStartup"); + } else if (str8_match_lit("main", user_entry, 0)) { + crt_entry = str8_lit("mainCRTStartup"); + } else if (str8_match_lit("WinMain", user_entry, 0)) { + crt_entry = str8_lit("WinMainCRTStartup"); + } else if (str8_match_lit("wWinMain", user_entry, 0)) { + crt_entry = str8_lit("wWinMainCRTStartup"); + } + return crt_entry; +} + internal String8 mscrt_delay_load_helper_name_from_machine(COFF_MachineType machine) { diff --git a/src/msvc_crt/msvc_crt.h b/src/msvc_crt/msvc_crt.h index 11000af2..4ad6354c 100644 --- a/src/msvc_crt/msvc_crt.h +++ b/src/msvc_crt/msvc_crt.h @@ -343,6 +343,10 @@ typedef struct MSCRT_ParsedFuncInfoV4 MSCRT_IP2State32V4 ip2state_map; } MSCRT_ParsedFuncInfoV4; +//- Entry Point + +internal String8 msvcrt_ctr_entry_from_user_entry(String8 user_entry_point); + //- Delay Load Helper internal String8 mscrt_delay_load_helper_name_from_machine(COFF_MachineType machine);