Commit d5385c71 authored by Santino Mazza's avatar Santino Mazza Committed by Alexandre Julliard

kernelbase: Implement GetGeoInfoEx.

parent 52ffd338
...@@ -5977,26 +5977,26 @@ static void test_GetGeoInfo(void) ...@@ -5977,26 +5977,26 @@ static void test_GetGeoInfo(void)
/* Test with ISO 3166-1 */ /* Test with ISO 3166-1 */
ret = pGetGeoInfoEx(L"AR", GEO_ISO3, buffW, ARRAYSIZE(buffW)); ret = pGetGeoInfoEx(L"AR", GEO_ISO3, buffW, ARRAYSIZE(buffW));
todo_wine ok(ret != 0, "GetGeoInfoEx failed %ld.\n", GetLastError()); 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(!wcscmp(buffW, L"ARG"), "expected string to be ARG, got %ls\n", buffW);
/* Test with UN M.49 */ /* Test with UN M.49 */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetGeoInfoEx(L"032", GEO_ISO3, buffW, ARRAYSIZE(buffW)); ret = pGetGeoInfoEx(L"032", GEO_ISO3, buffW, ARRAYSIZE(buffW));
ok(ret == 0, "expected GetGeoInfoEx to fail.\n"); 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()); "expected ERROR_INVALID_PARAMETER got %ld.\n", GetLastError());
/* Test GEO_ID */ /* Test GEO_ID */
ret = pGetGeoInfoEx(L"AR", GEO_ID, buffW, ARRAYSIZE(buffW)); ret = pGetGeoInfoEx(L"AR", GEO_ID, buffW, ARRAYSIZE(buffW));
todo_wine ok(ret != 0, "GetGeoInfoEx failed %ld.\n", GetLastError()); 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(!wcscmp(buffW, L"11"), "expected string to be 11, got %ls\n", buffW);
/* Test with invalid geo type */ /* Test with invalid geo type */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetGeoInfoEx(L"AR", GEO_LCID, buffW, ARRAYSIZE(buffW)); ret = pGetGeoInfoEx(L"AR", GEO_LCID, buffW, ARRAYSIZE(buffW));
ok(ret == 0, "expected GetGeoInfoEx to fail.\n"); 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()); "expected ERROR_INVALID_PARAMETER got %ld.\n", GetLastError());
} }
......
...@@ -5746,10 +5746,23 @@ INT WINAPI DECLSPEC_HOTPATCH GetGeoInfoW( GEOID id, GEOTYPE type, WCHAR *data, i ...@@ -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 ) 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 ); 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 0;
}
return get_geo_info( ptr, type, data, data_count, 0 );
} }
......
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