Commit 08173737 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

kernel32: Get[*]PreferredUILanguages should return buffer size when setting…

kernel32: Get[*]PreferredUILanguages should return buffer size when setting ERROR_INSUFFICIENT_BUFFER. Signed-off-by: 's avatarDmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent cac04651
...@@ -112,6 +112,7 @@ static BOOL get_dummy_preferred_ui_language( DWORD flags, ULONG *count, WCHAR *b ...@@ -112,6 +112,7 @@ static BOOL get_dummy_preferred_ui_language( DWORD flags, ULONG *count, WCHAR *b
if (lsize > *size) if (lsize > *size)
{ {
*size = lsize;
SetLastError(ERROR_INSUFFICIENT_BUFFER); SetLastError(ERROR_INSUFFICIENT_BUFFER);
return FALSE; return FALSE;
} }
......
...@@ -5477,7 +5477,6 @@ todo_wine ...@@ -5477,7 +5477,6 @@ todo_wine
ok(!ret, "Expected GetSystemPreferredUILanguages to fail\n"); ok(!ret, "Expected GetSystemPreferredUILanguages to fail\n");
ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(),
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
todo_wine
ok(size == size_id, "expected %u, got %u\n", size_id, size); ok(size == size_id, "expected %u, got %u\n", size_id, size);
size = size_id -1; size = size_id -1;
...@@ -5487,7 +5486,6 @@ todo_wine ...@@ -5487,7 +5486,6 @@ todo_wine
ok(!ret, "Expected GetSystemPreferredUILanguages to fail\n"); ok(!ret, "Expected GetSystemPreferredUILanguages to fail\n");
ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(),
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
todo_wine
ok(size == size_id, "expected %u, got %u\n", size_id, size); ok(size == size_id, "expected %u, got %u\n", size_id, size);
size = size_id -2; size = size_id -2;
...@@ -5497,7 +5495,6 @@ todo_wine ...@@ -5497,7 +5495,6 @@ todo_wine
ok(!ret, "Expected GetSystemPreferredUILanguages to fail\n"); ok(!ret, "Expected GetSystemPreferredUILanguages to fail\n");
ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(),
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
todo_wine
ok(size == size_id + 2 || size == size_id + 1 /* before win10 1809 */, "expected %u, got %u\n", size_id + 2, size); ok(size == size_id + 2 || size == size_id + 1 /* before win10 1809 */, "expected %u, got %u\n", size_id + 2, size);
HeapFree(GetProcessHeap(), 0, buffer); HeapFree(GetProcessHeap(), 0, buffer);
...@@ -5550,7 +5547,6 @@ todo_wine ...@@ -5550,7 +5547,6 @@ todo_wine
ok(!ret, "Expected GetThreadPreferredUILanguages to fail\n"); ok(!ret, "Expected GetThreadPreferredUILanguages to fail\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
todo_wine
ok(size == size_id, "expected %u, got %u\n", size_id, size); ok(size == size_id, "expected %u, got %u\n", size_id, size);
size = size_id - 1; size = size_id - 1;
...@@ -5559,7 +5555,6 @@ todo_wine ...@@ -5559,7 +5555,6 @@ todo_wine
ok(!ret, "Expected GetThreadPreferredUILanguages to fail\n"); ok(!ret, "Expected GetThreadPreferredUILanguages to fail\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
todo_wine
ok(size == size_id, "expected %u, got %u\n", size_id, size); ok(size == size_id, "expected %u, got %u\n", size_id, size);
size = size_id - 2; size = size_id - 2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment