-- v2: kernelbase: Implement GetGeoInfoEx.
From: Santino Mazza smazza@codeweavers.com
--- dlls/kernel32/kernel32.spec | 1 + dlls/kernelbase/kernelbase.spec | 1 + dlls/kernelbase/locale.c | 9 +++++++++ include/winnls.h | 1 + 4 files changed, 12 insertions(+)
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 89c2511c3cf..1b51b61a0f1 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -698,6 +698,7 @@ @ stdcall -import GetFullPathNameW(wstr long ptr ptr) @ stdcall GetGeoInfoA(long long ptr long long) @ stdcall -import GetGeoInfoW(long long ptr long long) +@ stdcall -import GetGeoInfoEx(ptr long ptr long) @ stdcall GetHandleContext(long) @ stdcall -import GetHandleInformation(long ptr) @ stub -i386 GetLSCallbackTarget diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index c51dbd6bc73..76a8792ca74 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -560,6 +560,7 @@ # @ stub GetGPOListInternalA # @ stub GetGPOListInternalW @ stdcall GetGeoInfoW(long long ptr long long) +@ stdcall GetGeoInfoEx(ptr long ptr long) @ stdcall GetHandleInformation(long ptr) # @ stub GetHivePath # @ stub GetIntegratedDisplaySize diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c index 0c20c858a7a..b745726f7c1 100644 --- a/dlls/kernelbase/locale.c +++ b/dlls/kernelbase/locale.c @@ -5744,6 +5744,15 @@ INT WINAPI DECLSPEC_HOTPATCH GetGeoInfoW( GEOID id, GEOTYPE type, WCHAR *data, i }
+INT WINAPI DECLSPEC_HOTPATCH GetGeoInfoEx( WCHAR *location, GEOTYPE type, WCHAR *data, int data_count ) +{ + FIXME( "stub: %s %lx %p %d\n", wine_dbgstr_w(location), type, data, data_count ); + + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return 0; +} + + /****************************************************************************** * GetLocaleInfoA (kernelbase.@) */ diff --git a/include/winnls.h b/include/winnls.h index d7d3d316509..872fdcc3406 100644 --- a/include/winnls.h +++ b/include/winnls.h @@ -924,6 +924,7 @@ WINBASEAPI BOOL WINAPI GetFileMUIPath(DWORD,PCWSTR,PWSTR,PULONG,PWSTR,PUL WINBASEAPI INT WINAPI GetGeoInfoA(GEOID,GEOTYPE,LPSTR,INT,LANGID); WINBASEAPI INT WINAPI GetGeoInfoW(GEOID,GEOTYPE,LPWSTR,INT,LANGID); #define GetGeoInfo WINELIB_NAME_AW(GetGeoInfo) +WINBASEAPI INT WINAPI GetGeoInfoEx(PWSTR,GEOTYPE,PWSTR,INT); WINBASEAPI INT WINAPI GetLocaleInfoA(LCID,LCTYPE,LPSTR,INT); WINBASEAPI INT WINAPI GetLocaleInfoW(LCID,LCTYPE,LPWSTR,INT); #define GetLocaleInfo WINELIB_NAME_AW(GetLocaleInfo)
From: Santino Mazza smazza@codeweavers.com
--- dlls/kernel32/tests/locale.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index a1e8ba44974..8dd9e12c91b 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -78,6 +78,7 @@ static INT (WINAPI *pCompareStringEx)(LPCWSTR, DWORD, LPCWSTR, INT, LPCWSTR, INT LPNLSVERSIONINFO, LPVOID, LPARAM); static INT (WINAPI *pGetGeoInfoA)(GEOID, GEOTYPE, LPSTR, INT, LANGID); static INT (WINAPI *pGetGeoInfoW)(GEOID, GEOTYPE, LPWSTR, INT, LANGID); +static INT (WINAPI *pGetGeoInfoEx)(const WCHAR *, GEOTYPE, PWSTR, INT); static INT (WINAPI *pGetUserDefaultGeoName)(LPWSTR, int); static BOOL (WINAPI *pSetUserGeoName)(PWSTR); static BOOL (WINAPI *pEnumSystemGeoID)(GEOCLASS, GEOID, GEO_ENUMPROC); @@ -132,6 +133,7 @@ static void InitFunctionPointers(void) X(CompareStringEx); X(GetGeoInfoA); X(GetGeoInfoW); + X(GetGeoInfoEx); X(GetUserDefaultGeoName); X(SetUserGeoName); X(EnumSystemGeoID); @@ -5856,6 +5858,7 @@ static void test_CompareStringOrdinal(void) static void test_GetGeoInfo(void) { char buffA[20]; + WCHAR buffW[20]; INT ret;
if (!pGetGeoInfoA) @@ -5964,6 +5967,37 @@ static void test_GetGeoInfo(void) ret = pGetGeoInfoA(203, GEO_ID + 1, NULL, 0, 0); ok(ret == 0, "got %d\n", ret); ok(GetLastError() == ERROR_INVALID_FLAGS, "got %ld\n", GetLastError()); + + /* Test for GetGeoInfoEx */ + if (!pGetGeoInfoEx) + { + win_skip("GetGeoInfoEx is not available\n"); + return; + } + + /* Test with ISO 3166-1 */ + ret = pGetGeoInfoEx(L"AR", GEO_ISO3, buffW, ARRAYSIZE(buffW)); + todo_wine ok(ret != 0, "GetGeoInfoEx failed %ld.\n", GetLastError()); + todo_wine ok(!wcscmp(buffW, L"ARG"), "expected string to be ARG, got %ls\n", buffW); + + /* Test with UN M.49 */ + SetLastError(0xdeadbeef); + ret = pGetGeoInfoEx(L"032", GEO_ISO3, buffW, ARRAYSIZE(buffW)); + ok(ret == 0, "expected GetGeoInfoEx to fail.\n"); + todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, + "expected ERROR_INVALID_PARAMETER got %ld.\n", GetLastError()); + + /* Test GEO_ID */ + ret = pGetGeoInfoEx(L"AR", GEO_ID, buffW, ARRAYSIZE(buffW)); + todo_wine ok(ret != 0, "GetGeoInfoEx failed %ld.\n", GetLastError()); + todo_wine ok(!wcscmp(buffW, L"11"), "expected string to be 11, got %ls\n", buffW); + + /* Test with invalid geo type */ + SetLastError(0xdeadbeef); + ret = pGetGeoInfoEx(L"AR", GEO_LCID, buffW, ARRAYSIZE(buffW)); + ok(ret == 0, "expected GetGeoInfoEx to fail.\n"); + todo_wine ok(GetLastError() == ERROR_INVALID_FLAGS, + "expected ERROR_INVALID_PARAMETER got %ld.\n", GetLastError()); }
static int geoidenum_count;
From: Santino Mazza smazza@codeweavers.com
--- dlls/kernel32/tests/locale.c | 12 ++++++------ dlls/kernelbase/locale.c | 19 ++++++++++++++++--- 2 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index 8dd9e12c91b..723c24873c6 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -5977,26 +5977,26 @@ static void test_GetGeoInfo(void)
/* Test with ISO 3166-1 */ ret = pGetGeoInfoEx(L"AR", GEO_ISO3, buffW, ARRAYSIZE(buffW)); - todo_wine ok(ret != 0, "GetGeoInfoEx failed %ld.\n", GetLastError()); - todo_wine ok(!wcscmp(buffW, L"ARG"), "expected string to be ARG, got %ls\n", buffW); + ok(ret != 0, "GetGeoInfoEx failed %ld.\n", GetLastError()); + ok(!wcscmp(buffW, L"ARG"), "expected string to be ARG, got %ls\n", buffW);
/* Test with UN M.49 */ SetLastError(0xdeadbeef); ret = pGetGeoInfoEx(L"032", GEO_ISO3, buffW, ARRAYSIZE(buffW)); ok(ret == 0, "expected GetGeoInfoEx to fail.\n"); - todo_wine ok(GetLastError() == ERROR_INVALID_PARAMETER, + ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got %ld.\n", GetLastError());
/* Test GEO_ID */ ret = pGetGeoInfoEx(L"AR", GEO_ID, buffW, ARRAYSIZE(buffW)); - todo_wine ok(ret != 0, "GetGeoInfoEx failed %ld.\n", GetLastError()); - todo_wine ok(!wcscmp(buffW, L"11"), "expected string to be 11, got %ls\n", buffW); + ok(ret != 0, "GetGeoInfoEx failed %ld.\n", GetLastError()); + ok(!wcscmp(buffW, L"11"), "expected string to be 11, got %ls\n", buffW);
/* Test with invalid geo type */ SetLastError(0xdeadbeef); ret = pGetGeoInfoEx(L"AR", GEO_LCID, buffW, ARRAYSIZE(buffW)); ok(ret == 0, "expected GetGeoInfoEx to fail.\n"); - todo_wine ok(GetLastError() == ERROR_INVALID_FLAGS, + ok(GetLastError() == ERROR_INVALID_FLAGS, "expected ERROR_INVALID_PARAMETER got %ld.\n", GetLastError()); }
diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c index b745726f7c1..5cc4152e491 100644 --- a/dlls/kernelbase/locale.c +++ b/dlls/kernelbase/locale.c @@ -5746,10 +5746,23 @@ INT WINAPI DECLSPEC_HOTPATCH GetGeoInfoW( GEOID id, GEOTYPE type, WCHAR *data, i
INT WINAPI DECLSPEC_HOTPATCH GetGeoInfoEx( WCHAR *location, GEOTYPE type, WCHAR *data, int data_count ) { - FIXME( "stub: %s %lx %p %d\n", wine_dbgstr_w(location), type, data, data_count ); + const struct geo_id *ptr = find_geo_name_entry( location );
- SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); - return 0; + TRACE( "%s %lx %p %d\n", wine_dbgstr_w(location), type, data, data_count ); + + if (!ptr) + { + SetLastError( ERROR_INVALID_PARAMETER ); + return 0; + } + + if (type == GEO_LCID || type == GEO_NATION || type == GEO_RFC1766) + { + SetLastError( ERROR_INVALID_FLAGS ); + return 0; + } + + return get_geo_info( ptr, type, data, data_count, 0 ); }
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=126575
Your paranoid android.
=== debian11 (32 bit report) ===
d3d8: stateblock: Timeout visual: Timeout
d3d9: d3d9ex: Timeout device: Timeout stateblock: Timeout visual: Timeout
d3dcompiler_43: asm: Timeout blob: Timeout hlsl_d3d11: Timeout hlsl_d3d9: Timeout reflection: Timeout
d3dcompiler_46: asm: Timeout blob: Timeout hlsl_d3d11: Timeout hlsl_d3d9: Timeout reflection: Timeout
d3dcompiler_47: asm: Timeout blob: Timeout hlsl_d3d11: Timeout hlsl_d3d9: Timeout reflection: Timeout
d3drm: d3drm: Timeout vector: Timeout
d3dx10_34: d3dx10: Timeout
d3dx10_35: d3dx10: Timeout
d3dx10_36: d3dx10: Timeout
d3dx10_37: d3dx10: Timeout
d3dx10_38: d3dx10: Timeout
d3dx10_39: d3dx10: Timeout
d3dx10_40: d3dx10: Timeout
d3dx10_41: d3dx10: Timeout
d3dx10_42: d3dx10: Timeout
d3dx10_43: d3dx10: Timeout
d3dx11_42: d3dx11: Timeout
d3dx11_43: d3dx11: Timeout
d3dx9_36: asm: Timeout core: Timeout effect: Timeout line: Timeout
Report validation errors: d3dx9_36:math timeout
=== debian11 (build log) ===
WineRunWineTest.pl:error: The task timed out