kernel32: Implement GetUserDefaultGeoName().
Fixes crash on launch in Outriders demo. Signed-off-by: Paul Gofman <pgofman@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5c86b9f1dc
commit
e610a56734
|
@ -763,6 +763,7 @@
|
|||
@ stdcall -import GetOEMCP()
|
||||
@ stdcall -import GetOverlappedResult(long ptr ptr long)
|
||||
@ stdcall -import GetOverlappedResultEx(long ptr ptr long long)
|
||||
@ stdcall -import GetUserDefaultGeoName(ptr long)
|
||||
@ stdcall -import GetUserPreferredUILanguages(long ptr ptr ptr)
|
||||
@ stdcall GetPackageFamilyName(long ptr ptr) kernelbase.GetPackageFamilyName
|
||||
@ stdcall GetPackageFullName(long ptr ptr) kernelbase.GetPackageFullName
|
||||
|
|
|
@ -741,6 +741,7 @@
|
|||
@ stub GetUILanguageInfo
|
||||
# @ stub GetUnicodeStringToEightBitSizeRoutine
|
||||
# @ stub GetUnicodeStringToEightBitStringRoutine
|
||||
@ stdcall GetUserDefaultGeoName(ptr long)
|
||||
@ stdcall GetUserDefaultLCID()
|
||||
@ stdcall GetUserDefaultLangID()
|
||||
@ stdcall GetUserDefaultLocaleName(ptr long)
|
||||
|
|
|
@ -5740,6 +5740,12 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetUserGeoID( GEOID id )
|
|||
const WCHAR *name = geoinfo->kind == LOCATION_NATION ? L"Nation" : L"Region";
|
||||
swprintf( bufferW, ARRAY_SIZE(bufferW), L"%u", geoinfo->id );
|
||||
RegSetValueExW( hkey, name, 0, REG_SZ, (BYTE *)bufferW, (lstrlenW(bufferW) + 1) * sizeof(WCHAR) );
|
||||
|
||||
if (geoinfo->kind == LOCATION_NATION || geoinfo->kind == LOCATION_BOTH)
|
||||
lstrcpyW( bufferW, geoinfo->iso2W );
|
||||
else
|
||||
swprintf( bufferW, ARRAY_SIZE(bufferW), L"%03u", geoinfo->uncode );
|
||||
RegSetValueExW( hkey, L"Name", 0, REG_SZ, (BYTE *)bufferW, (lstrlenW(bufferW) + 1) * sizeof(WCHAR) );
|
||||
RegCloseKey( hkey );
|
||||
}
|
||||
return TRUE;
|
||||
|
@ -5877,3 +5883,47 @@ INT WINAPI DECLSPEC_HOTPATCH WideCharToMultiByte( UINT codepage, DWORD flags, LP
|
|||
TRACE( "cp %d %s -> %s, ret = %d\n", codepage, debugstr_wn(src, srclen), debugstr_an(dst, ret), ret );
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* GetUserDefaultGeoName (kernelbase.@)
|
||||
*/
|
||||
INT WINAPI GetUserDefaultGeoName(LPWSTR geo_name, int count)
|
||||
{
|
||||
const struct geoinfo *geoinfo;
|
||||
WCHAR buffer[32];
|
||||
LSTATUS status;
|
||||
DWORD size;
|
||||
HKEY key;
|
||||
|
||||
TRACE( "geo_name %p, count %d.\n", geo_name, count );
|
||||
|
||||
if (count && !geo_name)
|
||||
{
|
||||
SetLastError( ERROR_INVALID_PARAMETER );
|
||||
return 0;
|
||||
}
|
||||
if (!(status = RegOpenKeyExW( intl_key, L"Geo", 0, KEY_ALL_ACCESS, &key )))
|
||||
{
|
||||
size = sizeof(buffer);
|
||||
status = RegQueryValueExW( key, L"Name", NULL, NULL, (BYTE *)buffer, &size );
|
||||
RegCloseKey( key );
|
||||
}
|
||||
if (status)
|
||||
{
|
||||
if ((geoinfo = get_geoinfo_ptr( GetUserGeoID( GEOCLASS_NATION ))) && geoinfo->id != 39070)
|
||||
lstrcpyW( buffer, geoinfo->iso2W );
|
||||
else
|
||||
lstrcpyW( buffer, L"001" );
|
||||
}
|
||||
size = lstrlenW( buffer ) + 1;
|
||||
if (count < size)
|
||||
{
|
||||
if (!count)
|
||||
return size;
|
||||
SetLastError( ERROR_INSUFFICIENT_BUFFER );
|
||||
return 0;
|
||||
}
|
||||
lstrcpyW( geo_name, buffer );
|
||||
return size;
|
||||
}
|
||||
|
|
|
@ -946,6 +946,7 @@ WINBASEAPI INT WINAPI GetTimeFormatA(LCID,DWORD,const SYSTEMTIME*,LPCSTR
|
|||
WINBASEAPI INT WINAPI GetTimeFormatEx(LPCWSTR,DWORD,const SYSTEMTIME*,LPCWSTR,LPWSTR,INT);
|
||||
WINBASEAPI INT WINAPI GetTimeFormatW(LCID,DWORD,const SYSTEMTIME*,LPCWSTR,LPWSTR,INT);
|
||||
#define GetTimeFormat WINELIB_NAME_AW(GetTimeFormat)
|
||||
WINBASEAPI INT WINAPI GetUserDefaultGeoName(LPWSTR,int);
|
||||
WINBASEAPI LANGID WINAPI GetUserDefaultLangID(void);
|
||||
WINBASEAPI LCID WINAPI GetUserDefaultLCID(void);
|
||||
WINBASEAPI INT WINAPI GetUserDefaultLocaleName(LPWSTR,int);
|
||||
|
|
Loading…
Reference in New Issue