From: Paul Gofman pgofman@codeweavers.com
--- dlls/ntdll/printf.h | 6 +++++- dlls/ntdll/tests/string.c | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/printf.h b/dlls/ntdll/printf.h index e57cb01338b..6e0c7832d05 100644 --- a/dlls/ntdll/printf.h +++ b/dlls/ntdll/printf.h @@ -372,7 +372,11 @@ static int FUNC_NAME(pf_vsnprintf)( FUNC_NAME(pf_output) *out, const APICHAR *fo } else if( *p == 'l' ) { - flags.IntegerLength = LEN_LONG; + if (flags.IntegerLength != LEN_SHORT) + { + flags.IntegerLength = LEN_LONG; + flags.WideString = TRUE; + } flags.WideString = TRUE; p++; } diff --git a/dlls/ntdll/tests/string.c b/dlls/ntdll/tests/string.c index c9901c10883..3d975d12a10 100644 --- a/dlls/ntdll/tests/string.c +++ b/dlls/ntdll/tests/string.c @@ -1838,6 +1838,7 @@ static void test_printf_format(void) { "%#llx", sizeof(ULONG64), "0x1000000000", NULL, 0x1000000000 }, { "%#lllx", sizeof(ULONG64), "0x1000000000", NULL, 0x1000000000 }, { "%hu", sizeof(ULONG), "1", NULL, 65537 }, + { "%hlu", sizeof(ULONG), "1", NULL, 65537 }, { "%hllx", sizeof(ULONG64), "100000010", NULL, 0x100000010 }, { "%hlllx", sizeof(ULONG64), "100000010", NULL, 0x100000010 }, { "%llhx", sizeof(ULONG64), "100000010", NULL, 0x100000010 }, @@ -1873,7 +1874,9 @@ static void test_printf_format(void) { "%hwS", sizeof(ULONG_PTR), "str", NULL, (ULONG_PTR)L"str", "str" }, { "%whs", sizeof(ULONG_PTR), "str", NULL, (ULONG_PTR)L"str", "str" }, { "%whS", sizeof(ULONG_PTR), "str", NULL, (ULONG_PTR)L"str", "str" }, + { "%hwls", sizeof(ULONG_PTR), "str", NULL, (ULONG_PTR)L"str", "str" }, { "%hwlls", sizeof(ULONG_PTR), "str", NULL, (ULONG_PTR)L"str", "str" }, + { "%hwlS", sizeof(ULONG_PTR), "str", NULL, (ULONG_PTR)L"str", "str" }, { "%hwllS", sizeof(ULONG_PTR), "str", NULL, (ULONG_PTR)L"str", "str" }, { "%lhws", sizeof(ULONG_PTR), "str", NULL, (ULONG_PTR)L"str", "str" }, { "%llhws", sizeof(ULONG_PTR), "str", NULL, (ULONG_PTR)L"str", "str" },