dll/win32/kernel32/winnls/string/format_msg.c | 30 ++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/dll/win32/kernel32/winnls/string/format_msg.c b/dll/win32/kernel32/winnls/string/format_msg.c index ff6f083703..b5618d7300 100644 --- a/dll/win32/kernel32/winnls/string/format_msg.c +++ b/dll/win32/kernel32/winnls/string/format_msg.c @@ -170,6 +170,8 @@ static LPCWSTR format_insert( BOOL unicode_caller, int insert, LPCWSTR format, WCHAR *wstring = NULL, *p, fmt[256]; ULONG_PTR arg; int size; + UINT64 arg64 = 0; + BOOL isI64 = FALSE; if (*format != '!') /* simple string */ { @@ -272,15 +274,37 @@ static LPCWSTR format_insert( BOOL unicode_caller, int insert, LPCWSTR format, { *p++ = 'c'; } - /* FIXME: handle I64 etc. */ - else while (*format && *format != '!') *p++ = *format++; + else + { + if (format[0] == 'I' && format[1] == '6' && format[2] == '4') + { + if (format[3] == 'u' || format[3] == 'd' || + format[3] == 'i' || format[3] == 'o' || + format[3] == 'x' || format[3] == 'X') + { + /* get second 32-bit value */ + arg64 = get_arg(insert + 1, flags, args); + arg64 = (arg64 << 32) | arg; + isI64 = TRUE; + } + } + while (*format && *format != '!') *p++ = *format++; + } *p = 0; size = 256; for (;;) { WCHAR *ret = HeapAlloc( GetProcessHeap(), 0, size * sizeof(WCHAR) ); - int needed = snprintfW( ret, size, fmt, arg ); + int needed; + if (!isI64) + { + needed = snprintfW( ret, size, fmt, arg ); + } + else + { + needed = snprintfW( ret, size, fmt, arg64 ); + } if (needed == -1 || needed >= size) { HeapFree( GetProcessHeap(), 0, ret );