kernel32: Implement SetUserGeoName().

Signed-off-by: Paul Gofman <pgofman@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Paul Gofman 2021-03-08 19:34:39 +03:00 committed by Alexandre Julliard
parent e610a56734
commit a430a69f8b
4 changed files with 49 additions and 0 deletions

View File

@ -1482,6 +1482,7 @@
@ stdcall -arch=x86_64 SetUmsThreadInformation(ptr long ptr long)
@ stdcall -import SetUnhandledExceptionFilter(ptr)
@ stdcall -import SetUserGeoID(long)
@ stdcall -import SetUserGeoName(wstr)
@ stub SetVDMCurrentDirectories
@ stdcall SetVolumeLabelA(str str)
@ stdcall SetVolumeLabelW(wstr wstr)

View File

@ -1509,6 +1509,7 @@
@ stdcall SetTokenInformation(long long ptr long)
@ stdcall SetUnhandledExceptionFilter(ptr)
@ stdcall SetUserGeoID(long)
@ stdcall SetUserGeoName(wstr)
@ stdcall SetWaitableTimer(long ptr long ptr ptr long)
@ stdcall SetWaitableTimerEx(long ptr long ptr ptr ptr long)
@ stdcall -arch=i386,x86_64 SetXStateFeaturesMask(ptr int64)

View File

@ -5927,3 +5927,49 @@ INT WINAPI GetUserDefaultGeoName(LPWSTR geo_name, int count)
lstrcpyW( geo_name, buffer );
return size;
}
/***********************************************************************
* SetUserDefaultGeoName (kernelbase.@)
*/
BOOL WINAPI SetUserGeoName(PWSTR geo_name)
{
unsigned int i;
WCHAR *endptr;
int uncode;
TRACE( "geo_name %s.\n", debugstr_w( geo_name ));
if (!geo_name)
{
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
if (lstrlenW( geo_name ) == 3)
{
uncode = wcstol( geo_name, &endptr, 10 );
if (!uncode || endptr != geo_name + 3)
{
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
for (i = 0; i < ARRAY_SIZE(geoinfodata); ++i)
if (geoinfodata[i].uncode == uncode)
break;
}
else
{
if (!lstrcmpiW( geo_name, L"XX" ))
return SetUserGeoID( 39070 );
for (i = 0; i < ARRAY_SIZE(geoinfodata); ++i)
if (!lstrcmpiW( geo_name, geoinfodata[i].iso2W ))
break;
}
if (i == ARRAY_SIZE(geoinfodata))
{
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
return SetUserGeoID( geoinfodata[i].id );
}

View File

@ -983,6 +983,7 @@ WINBASEAPI BOOL WINAPI SetThreadLocale(LCID);
WINBASEAPI BOOL WINAPI SetThreadPreferredUILanguages(DWORD,PCZZWSTR,PULONG);
WINBASEAPI LANGID WINAPI SetThreadUILanguage(LANGID);
WINBASEAPI BOOL WINAPI SetUserGeoID(GEOID);
WINBASEAPI BOOL WINAPI SetUserGeoName(PWSTR);
WINBASEAPI INT WINAPI WideCharToMultiByte(UINT,DWORD,LPCWSTR,INT,LPSTR,INT,LPCSTR,LPBOOL);
WINBASEAPI INT WINAPI FindNLSStringEx(const WCHAR *,DWORD,const WCHAR *,INT,const WCHAR *,INT,INT *,NLSVERSIONINFO *,void *,LPARAM);