diff --git a/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec b/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec index 17b98619fff..cbda9cead06 100644 --- a/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec +++ b/dlls/api-ms-win-crt-runtime-l1-1-0/api-ms-win-crt-runtime-l1-1-0.spec @@ -43,11 +43,11 @@ @ cdecl _get_initial_narrow_environment() ucrtbase._get_initial_narrow_environment @ cdecl _get_initial_wide_environment() ucrtbase._get_initial_wide_environment @ cdecl _get_invalid_parameter_handler() ucrtbase._get_invalid_parameter_handler -@ stub _get_narrow_winmain_command_line +@ cdecl _get_narrow_winmain_command_line() ucrtbase._get_narrow_winmain_command_line @ cdecl _get_pgmptr(ptr) ucrtbase._get_pgmptr @ cdecl _get_terminate() ucrtbase._get_terminate @ cdecl _get_thread_local_invalid_parameter_handler() ucrtbase._get_thread_local_invalid_parameter_handler -@ stub _get_wide_winmain_command_line +@ cdecl _get_wide_winmain_command_line() ucrtbase._get_wide_winmain_command_line @ cdecl _get_wpgmptr(ptr) ucrtbase._get_wpgmptr @ cdecl _getdllprocaddr(long str long) ucrtbase._getdllprocaddr @ cdecl _getpid() ucrtbase._getpid diff --git a/dlls/msvcrt/data.c b/dlls/msvcrt/data.c index fafbc387d04..5de80f419a8 100644 --- a/dlls/msvcrt/data.c +++ b/dlls/msvcrt/data.c @@ -692,3 +692,57 @@ int CDECL _initialize_wide_environment(void) FIXME("stub\n"); return 0; } + +/********************************************************************* + * _get_narrow_winmain_command_line (UCRTBASE.@) + */ +char* CDECL _get_narrow_winmain_command_line(void) +{ + static char *narrow_command_line; + char *s; + + if (narrow_command_line) + return narrow_command_line; + + s = GetCommandLineA(); + while (*s && *s != ' ' && *s != '\t') + { + if (*s++ == '"') + { + while (*s && *s++ != '"') + ; + } + } + + while (*s == ' ' || *s == '\t') + s++; + + return narrow_command_line = s; +} + +/********************************************************************* + * _get_wide_winmain_command_line (UCRTBASE.@) + */ +MSVCRT_wchar_t* CDECL _get_wide_winmain_command_line(void) +{ + static MSVCRT_wchar_t *wide_command_line; + MSVCRT_wchar_t *s; + + if (wide_command_line) + return wide_command_line; + + s = GetCommandLineW(); + while (*s && *s != ' ' && *s != '\t') + { + if (*s++ == '"') + { + while (*s && *s++ != '"') + ; + } + } + + while (*s == ' ' || *s == '\t') + s++; + + return wide_command_line = s; +} diff --git a/dlls/ucrtbase/ucrtbase.spec b/dlls/ucrtbase/ucrtbase.spec index 90639a21638..2a34404632e 100644 --- a/dlls/ucrtbase/ucrtbase.spec +++ b/dlls/ucrtbase/ucrtbase.spec @@ -368,7 +368,7 @@ @ cdecl _get_initial_narrow_environment() @ cdecl _get_initial_wide_environment() @ cdecl _get_invalid_parameter_handler() -@ stub _get_narrow_winmain_command_line +@ cdecl _get_narrow_winmain_command_line() @ cdecl _get_osfhandle(long) MSVCRT__get_osfhandle @ cdecl _get_pgmptr(ptr) @ cdecl _get_printf_count_output() MSVCRT__get_printf_count_output @@ -379,7 +379,7 @@ @ cdecl _get_timezone(ptr) @ cdecl _get_tzname(ptr str long long) MSVCRT__get_tzname @ cdecl _get_unexpected() MSVCRT__get_unexpected -@ stub _get_wide_winmain_command_line +@ cdecl _get_wide_winmain_command_line() @ cdecl _get_wpgmptr(ptr) @ cdecl _getc_nolock(ptr) MSVCRT__fgetc_nolock @ cdecl _getch()