Commit a430a69f authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

kernel32: Implement SetUserGeoName().

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