ucrtbase: Implement _get_narrow_winmain_command_line/_get_wide_winmain_command_line.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Piotr Caban <piotr@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-07-28 12:24:24 +02:00 committed by Alexandre Julliard
parent 5118d1312c
commit 1411d800ee
3 changed files with 58 additions and 4 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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()