Commit 78eca968 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

ucrtbase: Add exe entry points implementation.

parent 82a4e720
......@@ -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);
......
......@@ -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);
......
......@@ -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 \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment