From 747b97539b5c0ae60046cdd037fc2c5577e5881a Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 22 Oct 2021 11:12:17 +0200 Subject: [PATCH] ntdll: Use the standard va_list instead of __ms_va_list. Signed-off-by: Alexandre Julliard --- dlls/ntdll/misc.c | 8 ++--- dlls/ntdll/ntdll_misc.h | 4 +-- dlls/ntdll/printf.c | 64 +++++++++++++++++++-------------------- dlls/ntdll/printf.h | 2 +- dlls/ntdll/rtl.c | 16 +++++----- dlls/ntdll/rtlstr.c | 6 ++-- dlls/ntdll/string.c | 8 ++--- dlls/ntdll/tests/rtl.c | 12 ++++---- dlls/ntdll/tests/rtlstr.c | 26 ++++++++-------- 9 files changed, 73 insertions(+), 73 deletions(-) diff --git a/dlls/ntdll/misc.c b/dlls/ntdll/misc.c index 4b590b76ce5..092900b289b 100644 --- a/dlls/ntdll/misc.c +++ b/dlls/ntdll/misc.c @@ -515,7 +515,7 @@ ULONG WINAPI EtwLogTraceEvent( TRACEHANDLE SessionHandle, PEVENT_TRACE_HEADER Ev * EtwTraceMessageVa (NTDLL.@) */ ULONG WINAPI EtwTraceMessageVa( TRACEHANDLE handle, ULONG flags, LPGUID guid, USHORT number, - __ms_va_list args ) + va_list args ) { FIXME("(%s %x %s %d) : stub\n", wine_dbgstr_longlong(handle), flags, debugstr_guid(guid), number); return ERROR_SUCCESS; @@ -526,12 +526,12 @@ ULONG WINAPI EtwTraceMessageVa( TRACEHANDLE handle, ULONG flags, LPGUID guid, US */ ULONG WINAPIV EtwTraceMessage( TRACEHANDLE handle, ULONG flags, LPGUID guid, /*USHORT*/ ULONG number, ... ) { - __ms_va_list valist; + va_list valist; ULONG ret; - __ms_va_start( valist, number ); + va_start( valist, number ); ret = EtwTraceMessageVa( handle, flags, guid, number, valist ); - __ms_va_end( valist ); + va_end( valist ); return ret; } diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index ab6fa5bc0ae..34af6b780cf 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -85,8 +85,8 @@ extern const struct unix_funcs *unix_funcs DECLSPEC_HIDDEN; extern struct _KUSER_SHARED_DATA *user_shared_data DECLSPEC_HIDDEN; -extern int CDECL NTDLL__vsnprintf( char *str, SIZE_T len, const char *format, __ms_va_list args ) DECLSPEC_HIDDEN; -extern int CDECL NTDLL__vsnwprintf( WCHAR *str, SIZE_T len, const WCHAR *format, __ms_va_list args ) DECLSPEC_HIDDEN; +extern int CDECL NTDLL__vsnprintf( char *str, SIZE_T len, const char *format, va_list args ) DECLSPEC_HIDDEN; +extern int CDECL NTDLL__vsnwprintf( WCHAR *str, SIZE_T len, const WCHAR *format, va_list args ) DECLSPEC_HIDDEN; struct dllredirect_data { diff --git a/dlls/ntdll/printf.c b/dlls/ntdll/printf.c index 9f14633a2ca..cb7c1ebcae4 100644 --- a/dlls/ntdll/printf.c +++ b/dlls/ntdll/printf.c @@ -52,7 +52,7 @@ typedef struct pf_flags_t /********************************************************************* * _vsnprintf (NTDLL.@) */ -int CDECL _vsnprintf( char *str, size_t len, const char *format, __ms_va_list args ) +int CDECL _vsnprintf( char *str, size_t len, const char *format, va_list args ) { pf_output_a out = { str, len }; int r = pf_vsnprintf_a( &out, format, args ); @@ -65,7 +65,7 @@ int CDECL _vsnprintf( char *str, size_t len, const char *format, __ms_va_list ar /*********************************************************************** * _vsnwprintf (NTDLL.@) */ -int CDECL _vsnwprintf( WCHAR *str, size_t len, const WCHAR *format, __ms_va_list args ) +int CDECL _vsnwprintf( WCHAR *str, size_t len, const WCHAR *format, va_list args ) { pf_output_w out = { str, len }; int r = pf_vsnprintf_w( &out, format, args ); @@ -81,11 +81,11 @@ int CDECL _vsnwprintf( WCHAR *str, size_t len, const WCHAR *format, __ms_va_list int WINAPIV NTDLL__snprintf( char *str, size_t len, const char *format, ... ) { int ret; - __ms_va_list valist; + va_list valist; - __ms_va_start( valist, format ); + va_start( valist, format ); ret = _vsnprintf( str, len, format, valist ); - __ms_va_end( valist ); + va_end( valist ); return ret; } @@ -96,11 +96,11 @@ int WINAPIV NTDLL__snprintf( char *str, size_t len, const char *format, ... ) int WINAPIV _snwprintf( WCHAR *str, size_t len, const WCHAR *format, ... ) { int ret; - __ms_va_list valist; + va_list valist; - __ms_va_start(valist, format); + va_start(valist, format); ret = _vsnwprintf( str, len, format, valist ); - __ms_va_end(valist); + va_end(valist); return ret; } @@ -108,7 +108,7 @@ int WINAPIV _snwprintf( WCHAR *str, size_t len, const WCHAR *format, ... ) /********************************************************************* * _vsnprintf_s (NTDLL.@) */ -int CDECL _vsnprintf_s( char *str, size_t size, size_t len, const char *format, __ms_va_list args ) +int CDECL _vsnprintf_s( char *str, size_t size, size_t len, const char *format, va_list args ) { pf_output_a out = { str, min( size, len ) }; int r = pf_vsnprintf_a( &out, format, args ); @@ -123,7 +123,7 @@ int CDECL _vsnprintf_s( char *str, size_t size, size_t len, const char *format, /*********************************************************************** * _vsnwprintf_s (NTDLL.@) */ -int CDECL _vsnwprintf_s( WCHAR *str, size_t size, size_t len, const WCHAR *format, __ms_va_list args ) +int CDECL _vsnwprintf_s( WCHAR *str, size_t size, size_t len, const WCHAR *format, va_list args ) { pf_output_w out = { str, min( size, len ) }; int r = pf_vsnprintf_w( &out, format, args ); @@ -141,11 +141,11 @@ int CDECL _vsnwprintf_s( WCHAR *str, size_t size, size_t len, const WCHAR *forma int WINAPIV _snprintf_s( char *str, size_t size, size_t len, const char *format, ... ) { int ret; - __ms_va_list valist; + va_list valist; - __ms_va_start( valist, format ); + va_start( valist, format ); ret = _vsnprintf_s( str, size, len, format, valist ); - __ms_va_end( valist ); + va_end( valist ); return ret; } @@ -156,11 +156,11 @@ int WINAPIV _snprintf_s( char *str, size_t size, size_t len, const char *format, int WINAPIV _snwprintf_s( WCHAR *str, size_t size, size_t len, const WCHAR *format, ... ) { int ret; - __ms_va_list valist; + va_list valist; - __ms_va_start( valist, format ); + va_start( valist, format ); ret = _vsnwprintf_s( str, size, len, format, valist ); - __ms_va_end( valist ); + va_end( valist ); return ret; } @@ -168,7 +168,7 @@ int WINAPIV _snwprintf_s( WCHAR *str, size_t size, size_t len, const WCHAR *form /********************************************************************* * vsprintf (NTDLL.@) */ -int CDECL vsprintf( char *str, const char *format, __ms_va_list args ) +int CDECL vsprintf( char *str, const char *format, va_list args ) { return _vsnprintf( str, size_max, format, args ); } @@ -177,7 +177,7 @@ int CDECL vsprintf( char *str, const char *format, __ms_va_list args ) /********************************************************************* * vsprintf_s (NTDLL.@) */ -int CDECL vsprintf_s( char *str, size_t size, const char *format, __ms_va_list args ) +int CDECL vsprintf_s( char *str, size_t size, const char *format, va_list args ) { return _vsnprintf_s( str, size, size, format, args ); } @@ -186,7 +186,7 @@ int CDECL vsprintf_s( char *str, size_t size, const char *format, __ms_va_list a /********************************************************************* * _vswprintf (NTDLL.@) */ -int CDECL _vswprintf( WCHAR *str, const WCHAR *format, __ms_va_list args ) +int CDECL _vswprintf( WCHAR *str, const WCHAR *format, va_list args ) { return _vsnwprintf( str, size_max, format, args ); } @@ -195,7 +195,7 @@ int CDECL _vswprintf( WCHAR *str, const WCHAR *format, __ms_va_list args ) /********************************************************************* * vswprintf_s (NTDLL.@) */ -int CDECL vswprintf_s( WCHAR *str, size_t size, const WCHAR *format, __ms_va_list args ) +int CDECL vswprintf_s( WCHAR *str, size_t size, const WCHAR *format, va_list args ) { return _vsnwprintf_s( str, size, size, format, args ); } @@ -207,11 +207,11 @@ int CDECL vswprintf_s( WCHAR *str, size_t size, const WCHAR *format, __ms_va_lis int WINAPIV NTDLL_sprintf( char *str, const char *format, ... ) { int ret; - __ms_va_list valist; + va_list valist; - __ms_va_start( valist, format ); + va_start( valist, format ); ret = _vsnprintf( str, size_max, format, valist ); - __ms_va_end( valist ); + va_end( valist ); return ret; } @@ -222,11 +222,11 @@ int WINAPIV NTDLL_sprintf( char *str, const char *format, ... ) int WINAPIV sprintf_s( char *str, size_t size, const char *format, ... ) { int ret; - __ms_va_list valist; + va_list valist; - __ms_va_start( valist, format ); + va_start( valist, format ); ret = vsprintf_s( str, size, format, valist ); - __ms_va_end( valist ); + va_end( valist ); return ret; } @@ -237,11 +237,11 @@ int WINAPIV sprintf_s( char *str, size_t size, const char *format, ... ) int WINAPIV NTDLL_swprintf( WCHAR *str, const WCHAR *format, ... ) { int ret; - __ms_va_list valist; + va_list valist; - __ms_va_start(valist, format); + va_start(valist, format); ret = _vsnwprintf( str, size_max, format, valist ); - __ms_va_end(valist); + va_end(valist); return ret; } @@ -252,10 +252,10 @@ int WINAPIV NTDLL_swprintf( WCHAR *str, const WCHAR *format, ... ) int WINAPIV swprintf_s( WCHAR *str, size_t size, const WCHAR *format, ... ) { int ret; - __ms_va_list valist; + va_list valist; - __ms_va_start(valist, format); + va_start(valist, format); ret = vswprintf_s( str, size, format, valist ); - __ms_va_end(valist); + va_end(valist); return ret; } diff --git a/dlls/ntdll/printf.h b/dlls/ntdll/printf.h index 9f7bad767f0..4fad5c0ddec 100644 --- a/dlls/ntdll/printf.h +++ b/dlls/ntdll/printf.h @@ -283,7 +283,7 @@ static void FUNC_NAME(pf_integer_conv)( APICHAR *buf, pf_flags *flags, LONGLONG } } -static int FUNC_NAME(pf_vsnprintf)( FUNC_NAME(pf_output) *out, const APICHAR *format, __ms_va_list valist ) +static int FUNC_NAME(pf_vsnprintf)( FUNC_NAME(pf_output) *out, const APICHAR *format, va_list valist ) { int r; const APICHAR *q, *p = format; diff --git a/dlls/ntdll/rtl.c b/dlls/ntdll/rtl.c index bb005d60807..1e359e4a043 100644 --- a/dlls/ntdll/rtl.c +++ b/dlls/ntdll/rtl.c @@ -311,11 +311,11 @@ static LONG WINAPI debug_exception_handler( EXCEPTION_POINTERS *eptr ) NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...) { NTSTATUS ret; - __ms_va_list args; + va_list args; - __ms_va_start(args, fmt); + va_start(args, fmt); ret = vDbgPrintEx(0, DPFLTR_ERROR_LEVEL, fmt, args); - __ms_va_end(args); + va_end(args); return ret; } @@ -326,18 +326,18 @@ NTSTATUS WINAPIV DbgPrint(LPCSTR fmt, ...) NTSTATUS WINAPIV DbgPrintEx(ULONG iComponentId, ULONG Level, LPCSTR fmt, ...) { NTSTATUS ret; - __ms_va_list args; + va_list args; - __ms_va_start(args, fmt); + va_start(args, fmt); ret = vDbgPrintEx(iComponentId, Level, fmt, args); - __ms_va_end(args); + va_end(args); return ret; } /****************************************************************************** * vDbgPrintEx [NTDLL.@] */ -NTSTATUS WINAPI vDbgPrintEx( ULONG id, ULONG level, LPCSTR fmt, __ms_va_list args ) +NTSTATUS WINAPI vDbgPrintEx( ULONG id, ULONG level, LPCSTR fmt, va_list args ) { return vDbgPrintExWithPrefix( "", id, level, fmt, args ); } @@ -345,7 +345,7 @@ NTSTATUS WINAPI vDbgPrintEx( ULONG id, ULONG level, LPCSTR fmt, __ms_va_list arg /****************************************************************************** * vDbgPrintExWithPrefix [NTDLL.@] */ -NTSTATUS WINAPI vDbgPrintExWithPrefix( LPCSTR prefix, ULONG id, ULONG level, LPCSTR fmt, __ms_va_list args ) +NTSTATUS WINAPI vDbgPrintExWithPrefix( LPCSTR prefix, ULONG id, ULONG level, LPCSTR fmt, va_list args ) { ULONG level_mask = level <= 31 ? (1 << level) : level; SIZE_T len = strlen( prefix ); diff --git a/dlls/ntdll/rtlstr.c b/dlls/ntdll/rtlstr.c index 90f32ceecf0..2260ecab2fd 100644 --- a/dlls/ntdll/rtlstr.c +++ b/dlls/ntdll/rtlstr.c @@ -1709,7 +1709,7 @@ struct format_message_args { int last; /* last used arg */ ULONG_PTR *array; /* args array */ - __ms_va_list *list; /* args va_list */ + va_list *list; /* args va_list */ UINT64 arglist[102]; /* arguments fetched from va_list */ }; @@ -1808,7 +1808,7 @@ static NTSTATUS add_format( WCHAR **buffer, WCHAR *end, const WCHAR **src, int i * RtlFormatMessage (NTDLL.@) */ NTSTATUS WINAPI RtlFormatMessage( const WCHAR *src, ULONG width, BOOLEAN ignore_inserts, - BOOLEAN ansi, BOOLEAN is_array, __ms_va_list *args, + BOOLEAN ansi, BOOLEAN is_array, va_list *args, WCHAR *buffer, ULONG size, ULONG *retsize ) { return RtlFormatMessageEx( src, width, ignore_inserts, ansi, is_array, args, buffer, size, retsize, 0 ); @@ -1819,7 +1819,7 @@ NTSTATUS WINAPI RtlFormatMessage( const WCHAR *src, ULONG width, BOOLEAN ignore_ * RtlFormatMessageEx (NTDLL.@) */ NTSTATUS WINAPI RtlFormatMessageEx( const WCHAR *src, ULONG width, BOOLEAN ignore_inserts, - BOOLEAN ansi, BOOLEAN is_array, __ms_va_list *args, + BOOLEAN ansi, BOOLEAN is_array, va_list *args, WCHAR *buffer, ULONG size, ULONG *retsize, ULONG flags ) { static const WCHAR spaceW = ' '; diff --git a/dlls/ntdll/string.c b/dlls/ntdll/string.c index f1cea6caa83..fe484426bcb 100644 --- a/dlls/ntdll/string.c +++ b/dlls/ntdll/string.c @@ -1007,7 +1007,7 @@ static int char2digit( char c, int base ) } -static int vsscanf( const char *str, const char *format, __ms_va_list ap) +static int vsscanf( const char *str, const char *format, va_list ap) { int rd = 0, consumed = 0; int nch; @@ -1445,10 +1445,10 @@ static int vsscanf( const char *str, const char *format, __ms_va_list ap) int WINAPIV sscanf( const char *str, const char *format, ... ) { int ret; - __ms_va_list valist; - __ms_va_start( valist, format ); + va_list valist; + va_start( valist, format ); ret = vsscanf( str, format, valist ); - __ms_va_end( valist ); + va_end( valist ); return ret; } diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c index 28dd02fd118..c0168884a0a 100644 --- a/dlls/ntdll/tests/rtl.c +++ b/dlls/ntdll/tests/rtl.c @@ -3524,20 +3524,20 @@ static LONG CALLBACK test_dbg_print_except_handler( EXCEPTION_POINTERS *eptrs ) static NTSTATUS WINAPIV test_vDbgPrintEx( ULONG id, ULONG level, const char *fmt, ... ) { NTSTATUS status; - __ms_va_list args; - __ms_va_start( args, fmt ); + va_list args; + va_start( args, fmt ); status = vDbgPrintEx( id, level, fmt, args ); - __ms_va_end( args ); + va_end( args ); return status; } static NTSTATUS WINAPIV test_vDbgPrintExWithPrefix( const char *prefix, ULONG id, ULONG level, const char *fmt, ... ) { NTSTATUS status; - __ms_va_list args; - __ms_va_start( args, fmt ); + va_list args; + va_start( args, fmt ); status = vDbgPrintExWithPrefix( prefix, id, level, fmt, args ); - __ms_va_end( args ); + va_end( args ); return status; } diff --git a/dlls/ntdll/tests/rtlstr.c b/dlls/ntdll/tests/rtlstr.c index 614a09acd49..9f7e5df9f67 100644 --- a/dlls/ntdll/tests/rtlstr.c +++ b/dlls/ntdll/tests/rtlstr.c @@ -72,7 +72,7 @@ static BOOLEAN (WINAPI *pRtlIsTextUnicode)(LPVOID, INT, INT *); static NTSTATUS (WINAPI *pRtlHashUnicodeString)(PCUNICODE_STRING,BOOLEAN,ULONG,ULONG*); static NTSTATUS (WINAPI *pRtlUnicodeToUTF8N)(CHAR *, ULONG, ULONG *, const WCHAR *, ULONG); static NTSTATUS (WINAPI *pRtlUTF8ToUnicodeN)(WCHAR *, ULONG, ULONG *, const CHAR *, ULONG); -static NTSTATUS (WINAPI *pRtlFormatMessage)(const WCHAR*,ULONG,BOOLEAN,BOOLEAN,BOOLEAN,__ms_va_list*,LPWSTR,ULONG,ULONG*); +static NTSTATUS (WINAPI *pRtlFormatMessage)(const WCHAR*,ULONG,BOOLEAN,BOOLEAN,BOOLEAN,va_list*,LPWSTR,ULONG,ULONG*); /*static VOID (WINAPI *pRtlFreeOemString)(PSTRING);*/ /*static VOID (WINAPI *pRtlCopyUnicodeString)(UNICODE_STRING *, const UNICODE_STRING *);*/ @@ -2614,27 +2614,27 @@ static void test_RtlUTF8ToUnicodeN(void) static NTSTATUS WINAPIV fmt( const WCHAR *src, ULONG width, BOOLEAN ignore_inserts, BOOLEAN ansi, WCHAR *buffer, ULONG size, ULONG *retsize, ... ) { - __ms_va_list args; + va_list args; NTSTATUS status; *retsize = 0xdeadbeef; - __ms_va_start( args, retsize ); + va_start( args, retsize ); status = pRtlFormatMessage( src, width, ignore_inserts, ansi, FALSE, &args, buffer, size, retsize ); - __ms_va_end( args ); + va_end( args ); return status; } static void WINAPIV testfmt( const WCHAR *src, const WCHAR *expect, ULONG width, BOOL ansi, ... ) { - __ms_va_list args; + va_list args; NTSTATUS status; WCHAR buffer[128]; ULONG size = 0xdeadbeef; memset( buffer, 0xcc, sizeof(buffer) ); - __ms_va_start( args, ansi ); + va_start( args, ansi ); status = pRtlFormatMessage( src, width, FALSE, ansi, FALSE, &args, buffer, sizeof(buffer), &size ); - __ms_va_end( args ); + va_end( args ); ok( !status, "%s: failed %x\n", debugstr_w(src), status ); ok( !lstrcmpW( buffer, expect ), "%s: got %s expected %s\n", debugstr_w(src), debugstr_w(buffer), debugstr_w(expect) ); @@ -2689,11 +2689,11 @@ static void test_RtlFormatMessage(void) ULONG_PTR args[] = { 19, 17, 15, 13, 11, 9, 7 }; memset( buffer, 0xcc, sizeof(buffer) ); status = pRtlFormatMessage( L"%2!*.*I64x! %1!u! %4!u! %2!u!", 0, FALSE, FALSE, TRUE, - (__ms_va_list *)args, buffer, sizeof(buffer), &size ); + (va_list *)args, buffer, sizeof(buffer), &size ); ok( !lstrcmpW( buffer, L" 00000000000000d 19 13 17" ), "got %s\n", wine_dbgstr_w(buffer) ); memset( buffer, 0xcc, sizeof(buffer) ); status = pRtlFormatMessage( L"%1!I64u! %2!u! %4!.*I64x! %5!I64u!", 0, FALSE, FALSE, TRUE, - (__ms_va_list *)args, buffer, sizeof(buffer), &size ); + (va_list *)args, buffer, sizeof(buffer), &size ); ok( !lstrcmpW( buffer, L"19 17 000000000000b 11" ), "got %s\n", wine_dbgstr_w(buffer) ); } #else @@ -2712,11 +2712,11 @@ static void test_RtlFormatMessage(void) ULONG_PTR args[] = { 19, 17, 15, 13, 11, 9, 7 }; memset( buffer, 0xcc, sizeof(buffer) ); status = pRtlFormatMessage( L"%2!*.*I64x! %1!u! %4!u! %2!u!", 0, FALSE, FALSE, TRUE, - (__ms_va_list *)args, buffer, sizeof(buffer), &size ); + (va_list *)args, buffer, sizeof(buffer), &size ); ok( !lstrcmpW( buffer, L" d0000000f 19 13 17" ), "got %s\n", wine_dbgstr_w(buffer) ); memset( buffer, 0xcc, sizeof(buffer) ); status = pRtlFormatMessage( L"%1!I64u! %2!u! %4!.*I64x! %5!I64u!", 0, FALSE, FALSE, TRUE, - (__ms_va_list *)args, buffer, sizeof(buffer), &size ); + (va_list *)args, buffer, sizeof(buffer), &size ); ok( !lstrcmpW( buffer, L"19 17 0000b00000000 11" ), "got %s\n", wine_dbgstr_w(buffer) ); } } @@ -2775,11 +2775,11 @@ static void test_RtlFormatMessage(void) { ULONG_PTR args[] = { 6, 4, 2, 5, 3, 1 }; memset( buffer, 0xcc, sizeof(buffer) ); - status = pRtlFormatMessage( L"%1!*.*u!,%1!*.*u!", 0, FALSE, FALSE, TRUE, (__ms_va_list *)args, + status = pRtlFormatMessage( L"%1!*.*u!,%1!*.*u!", 0, FALSE, FALSE, TRUE, (va_list *)args, buffer, sizeof(buffer), &size ); ok( !lstrcmpW( buffer, L" 0002, 00003" ), "got %s\n", wine_dbgstr_w(buffer) ); memset( buffer, 0xcc, sizeof(buffer) ); - status = pRtlFormatMessage( L"%1!*.*u!,%4!*.*u!", 0, FALSE, FALSE, TRUE, (__ms_va_list *)args, + status = pRtlFormatMessage( L"%1!*.*u!,%4!*.*u!", 0, FALSE, FALSE, TRUE, (va_list *)args, buffer, sizeof(buffer), &size ); ok( !lstrcmpW( buffer, L" 0002, 001" ), "got %s\n", wine_dbgstr_w(buffer) ); }