ucrtbase: Add exe entry points implementation.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2020-02-28 15:25:23 +01:00 committed by Alexandre Julliard
parent 82a4e72036
commit 78eca96887
3 changed files with 35 additions and 2 deletions

View File

@ -24,7 +24,12 @@
#ifdef __MINGW32__
#if _MSVCR_VER >= 140
#define _UCRT
#endif
#include <stdarg.h>
#include <stdlib.h>
#include <process.h>
#include "windef.h"
@ -40,10 +45,19 @@ static const IMAGE_NT_HEADERS *get_nt_header( void )
int __cdecl mainCRTStartup(void)
{
int argc, new_mode = 0, ret;
int argc, ret;
char **argv, **env;
#ifdef _UCRT
_configure_narrow_argv(_crt_argv_unexpanded_arguments);
_initialize_narrow_environment();
argc = *__p___argc();
argv = *__p___argv();
env = _get_initial_narrow_environment();
#else
int new_mode = 0;
__getmainargs(&argc, &argv, &env, 0, &new_mode);
#endif
_set_app_type(get_nt_header()->OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI ? _crt_gui_app : _crt_console_app);
ret = main(argc, argv, env);

View File

@ -24,7 +24,12 @@
#ifdef __MINGW32__
#if _MSVCR_VER >= 140
#define _UCRT
#endif
#include <stdarg.h>
#include <stdlib.h>
#include <process.h>
#include "windef.h"
@ -40,10 +45,19 @@ static const IMAGE_NT_HEADERS *get_nt_header( void )
int __cdecl wmainCRTStartup(void)
{
int argc, new_mode = 0, ret;
int argc, ret;
WCHAR **argv, **env;
#ifdef _UCRT
_configure_wide_argv(_crt_argv_unexpanded_arguments);
_initialize_wide_environment();
argc = *__p___argc();
argv = *__p___wargv();
env = _get_initial_wide_environment();
#else
int new_mode = 0;
__wgetmainargs(&argc, &argv, &env, 0, &new_mode);
#endif
_set_app_type(get_nt_header()->OptionalHeader.Subsystem == IMAGE_SUBSYSTEM_WINDOWS_GUI ? _crt_gui_app : _crt_console_app);
ret = wmain(argc, argv, env);

View File

@ -7,6 +7,11 @@ PARENTSRC = ../msvcrt
C_SRCS = \
console.c \
cpp.c \
crt_gccmain.c \
crt_main.c \
crt_winmain.c \
crt_wmain.c \
crt_wwinmain.c \
ctype.c \
data.c \
dir.c \