Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntdll/tests/string.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/tests/string.c b/dlls/ntdll/tests/string.c index 12027e88999..d771b0f1932 100644 --- a/dlls/ntdll/tests/string.c +++ b/dlls/ntdll/tests/string.c @@ -1349,7 +1349,32 @@ static void test__snprintf(void) memset(buffer, 0x7c, sizeof(buffer)); res = p__snprintf(buffer, 3, "test"); ok(res == -1, "res = %d\n", res); - } + + res = p__snprintf(buffer, sizeof(buffer), "%I64x %d", (ULONGLONG)0x1234567890, 1); + ok(res == strlen(buffer), "wrong size %d\n", res); + ok(!strcmp(buffer, "1234567890 1"), "got %s\n", debugstr_a(buffer)); + + res = p__snprintf(buffer, sizeof(buffer), "%I32x %d", 0x123456, 1); + ok(res == strlen(buffer), "wrong size %d\n", res); + ok(!strcmp(buffer, "123456 1"), "got %s\n", debugstr_a(buffer)); + + if (sizeof(void *) == 8) + { + res = p__snprintf(buffer, sizeof(buffer), "%Ix %d", (ULONG_PTR)0x1234567890, 1); + ok(res == strlen(buffer), "wrong size %d\n", res); + todo_wine ok(!strcmp(buffer, "1234567890 1"), "got %s\n", debugstr_a(buffer)); + } + else + { + res = p__snprintf(buffer, sizeof(buffer), "%Ix %d", (ULONG_PTR)0x123456, 1); + ok(res == strlen(buffer), "wrong size %d\n", res); + ok(!strcmp(buffer, "123456 1"), "got %s\n", debugstr_a(buffer)); + } + + res = p__snprintf(buffer, sizeof(buffer), "%llx %d", (ULONGLONG)0x1234567890, 1); + ok(res == strlen(buffer), "wrong size %d\n", res); + todo_wine ok(!strcmp(buffer, "1234567890 1"), "got %s\n", debugstr_a(buffer)); +}
static void test__snprintf_s(void) {
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntdll/printf.c | 6 ++++++ dlls/ntdll/tests/string.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/printf.c b/dlls/ntdll/printf.c index f61441b36b4..d5b197396ad 100644 --- a/dlls/ntdll/printf.c +++ b/dlls/ntdll/printf.c @@ -561,6 +561,12 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, __ms_va_list valis } else if( *(p+1) == '3' && *(p+2) == '2' ) p += 3; + else if( p[1] && strchr( "diouxX", p[1] ) ) + { + if( sizeof(void *) == 8 ) + flags.IntegerDouble = *p; + p++; + } else if( isDigit(*(p+1)) || *(p+1) == 0 ) break; else diff --git a/dlls/ntdll/tests/string.c b/dlls/ntdll/tests/string.c index d771b0f1932..b82235ae371 100644 --- a/dlls/ntdll/tests/string.c +++ b/dlls/ntdll/tests/string.c @@ -1362,7 +1362,7 @@ static void test__snprintf(void) { res = p__snprintf(buffer, sizeof(buffer), "%Ix %d", (ULONG_PTR)0x1234567890, 1); ok(res == strlen(buffer), "wrong size %d\n", res); - todo_wine ok(!strcmp(buffer, "1234567890 1"), "got %s\n", debugstr_a(buffer)); + ok(!strcmp(buffer, "1234567890 1"), "got %s\n", debugstr_a(buffer)); } else {
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64212
Your paranoid android.
=== wxppro (32 bit report) ===
ntdll: string.c:1376: Test failed: got "34567890 18"
=== w2003std (32 bit report) ===
ntdll: string.c:1376: Test failed: got "34567890 18"
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/kernelbase/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/kernelbase/process.c b/dlls/kernelbase/process.c index a07dddb1fc2..b125f100f6e 100644 --- a/dlls/kernelbase/process.c +++ b/dlls/kernelbase/process.c @@ -514,7 +514,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessInternalW( HANDLE token, const WCHAR } break; default: - FIXME("Unsupported attribute %#lx.\n", attrs->attrs[i].attr); + FIXME("Unsupported attribute %#Ix.\n", attrs->attrs[i].attr); break; } }
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/ntdll/printf.c | 5 +++++ dlls/ntdll/tests/string.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/printf.c b/dlls/ntdll/printf.c index d5b197396ad..7597f765e7c 100644 --- a/dlls/ntdll/printf.c +++ b/dlls/ntdll/printf.c @@ -547,6 +547,11 @@ static int pf_vsnprintf( pf_output *out, const WCHAR *format, __ms_va_list valis /* deal with integer width modifier */ while( *p ) { + if( *p == 'l' && *(p+1) == 'l' ) + { + flags.IntegerDouble = TRUE; + p += 2; + } if( *p == 'h' || *p == 'l' || *p == 'L' ) { flags.IntegerLength = *p; diff --git a/dlls/ntdll/tests/string.c b/dlls/ntdll/tests/string.c index b82235ae371..d31711625d4 100644 --- a/dlls/ntdll/tests/string.c +++ b/dlls/ntdll/tests/string.c @@ -1373,7 +1373,7 @@ static void test__snprintf(void)
res = p__snprintf(buffer, sizeof(buffer), "%llx %d", (ULONGLONG)0x1234567890, 1); ok(res == strlen(buffer), "wrong size %d\n", res); - todo_wine ok(!strcmp(buffer, "1234567890 1"), "got %s\n", debugstr_a(buffer)); + ok(!strcmp(buffer, "1234567890 1"), "got %s\n", debugstr_a(buffer)); }
static void test__snprintf_s(void)
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64214
Your paranoid android.
=== wxppro (32 bit report) ===
ntdll: string.c:1376: Test failed: got "34567890 18"
=== w2003std (32 bit report) ===
ntdll: string.c:1376: Test failed: got "34567890 18"
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=64211
Your paranoid android.
=== wxppro (32 bit report) ===
ntdll: string.c:1376: Test failed: got "34567890 18"
=== w2003std (32 bit report) ===
ntdll: string.c:1376: Test failed: got "34567890 18"