kernelbase: Implement GetGeoInfoEx.

This commit is contained in:
Santino Mazza 2022-11-21 11:06:09 -03:00 committed by Alexandre Julliard
parent 52ffd338fa
commit d5385c7177
2 changed files with 22 additions and 9 deletions

View file

@ -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());
}

View file

@ -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 );
}