kernel32: Move the *PreferredUILanguages functions to kernelbase and ntdll.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2020-05-22 12:42:14 +02:00
parent 4ccc3e5285
commit 6bed2b427b
9 changed files with 245 additions and 150 deletions

View File

@ -761,7 +761,7 @@
@ stdcall -import GetOEMCP() @ stdcall -import GetOEMCP()
@ stdcall -import GetOverlappedResult(long ptr ptr long) @ stdcall -import GetOverlappedResult(long ptr ptr long)
@ stdcall -import GetOverlappedResultEx(long ptr ptr long long) @ stdcall -import GetOverlappedResultEx(long ptr ptr long long)
@ stdcall GetUserPreferredUILanguages(long ptr ptr ptr) @ stdcall -import GetUserPreferredUILanguages(long ptr ptr ptr)
@ stdcall GetPackageFullName(long ptr ptr) kernelbase.GetPackageFullName @ stdcall GetPackageFullName(long ptr ptr) kernelbase.GetPackageFullName
@ stdcall -import GetPhysicallyInstalledSystemMemory(ptr) @ stdcall -import GetPhysicallyInstalledSystemMemory(ptr)
@ stdcall -import GetPriorityClass(long) @ stdcall -import GetPriorityClass(long)
@ -787,7 +787,7 @@
@ stdcall -import GetProcessIdOfThread(long) @ stdcall -import GetProcessIdOfThread(long)
@ stdcall GetProcessIoCounters(long ptr) @ stdcall GetProcessIoCounters(long ptr)
@ stdcall -import GetProcessMitigationPolicy(long long ptr long) @ stdcall -import GetProcessMitigationPolicy(long long ptr long)
@ stdcall GetProcessPreferredUILanguages(long ptr ptr ptr) @ stdcall -import GetProcessPreferredUILanguages(long ptr ptr ptr)
@ stdcall -import GetProcessPriorityBoost(long ptr) @ stdcall -import GetProcessPriorityBoost(long ptr)
@ stdcall -import GetProcessShutdownParameters(ptr ptr) @ stdcall -import GetProcessShutdownParameters(ptr ptr)
# @ stub GetProcessorSystemCycleTime # @ stub GetProcessorSystemCycleTime
@ -829,7 +829,7 @@
@ stdcall -import GetSystemFirmwareTable(long long ptr long) @ stdcall -import GetSystemFirmwareTable(long long ptr long)
@ stdcall -import GetSystemInfo(ptr) @ stdcall -import GetSystemInfo(ptr)
@ stdcall GetSystemPowerStatus(ptr) @ stdcall GetSystemPowerStatus(ptr)
@ stdcall GetSystemPreferredUILanguages(long ptr ptr ptr) @ stdcall -import GetSystemPreferredUILanguages(long ptr ptr ptr)
@ stdcall GetSystemRegistryQuota(ptr ptr) @ stdcall GetSystemRegistryQuota(ptr ptr)
@ stdcall -import GetSystemTime(ptr) @ stdcall -import GetSystemTime(ptr)
@ stdcall -import GetSystemTimeAdjustment(ptr ptr ptr) @ stdcall -import GetSystemTimeAdjustment(ptr ptr ptr)
@ -855,7 +855,7 @@
@ stdcall -import GetThreadId(ptr) @ stdcall -import GetThreadId(ptr)
@ stdcall -import GetThreadIdealProcessorEx(long ptr) @ stdcall -import GetThreadIdealProcessorEx(long ptr)
@ stdcall -import GetThreadLocale() @ stdcall -import GetThreadLocale()
@ stdcall GetThreadPreferredUILanguages(long ptr ptr ptr) @ stdcall -import GetThreadPreferredUILanguages(long ptr ptr ptr)
@ stdcall -import GetThreadPriority(long) @ stdcall -import GetThreadPriority(long)
@ stdcall -import GetThreadPriorityBoost(long ptr) @ stdcall -import GetThreadPriorityBoost(long ptr)
@ stdcall GetThreadSelectorEntry(long long ptr) @ stdcall GetThreadSelectorEntry(long long ptr)
@ -1433,7 +1433,7 @@
@ stdcall -import SetProcessAffinityUpdateMode(long long) @ stdcall -import SetProcessAffinityUpdateMode(long long)
@ stdcall SetProcessDEPPolicy(long) @ stdcall SetProcessDEPPolicy(long)
@ stdcall -import SetProcessMitigationPolicy(long ptr long) @ stdcall -import SetProcessMitigationPolicy(long ptr long)
@ stdcall SetProcessPreferredUILanguages(long ptr ptr) @ stdcall -import SetProcessPreferredUILanguages(long ptr ptr)
@ stdcall -import SetProcessPriorityBoost(long long) @ stdcall -import SetProcessPriorityBoost(long long)
@ stdcall -import SetProcessShutdownParameters(long long) @ stdcall -import SetProcessShutdownParameters(long long)
# @ stub SetProcessUserModeExceptionPolicy # @ stub SetProcessUserModeExceptionPolicy
@ -1458,7 +1458,7 @@
@ stdcall -import SetThreadIdealProcessor(long long) @ stdcall -import SetThreadIdealProcessor(long long)
@ stdcall -import SetThreadIdealProcessorEx(long ptr ptr) @ stdcall -import SetThreadIdealProcessorEx(long ptr ptr)
@ stdcall -import SetThreadLocale(long) @ stdcall -import SetThreadLocale(long)
@ stdcall SetThreadPreferredUILanguages(long ptr ptr) @ stdcall -import SetThreadPreferredUILanguages(long ptr ptr)
@ stdcall -import SetThreadPriority(long long) @ stdcall -import SetThreadPriority(long long)
@ stdcall -import SetThreadPriorityBoost(long long) @ stdcall -import SetThreadPriorityBoost(long long)
@ stdcall -import SetThreadStackGuarantee(ptr) @ stdcall -import SetThreadStackGuarantee(ptr)

View File

@ -76,139 +76,6 @@ static inline UINT get_lcid_codepage( LCID lcid )
} }
static BOOL get_dummy_preferred_ui_language( DWORD flags, ULONG *count, WCHAR *buffer, ULONG *size )
{
LCTYPE type;
int lsize;
FIXME("(0x%x %p %p %p) returning a dummy value (current locale)\n", flags, count, buffer, size);
if (flags & MUI_LANGUAGE_ID)
type = LOCALE_ILANGUAGE;
else
type = LOCALE_SNAME;
lsize = GetLocaleInfoW(LOCALE_SYSTEM_DEFAULT, type, NULL, 0);
if (!lsize)
{
/* keep last error from callee */
return FALSE;
}
lsize++;
if (!*size)
{
*size = lsize;
*count = 1;
return TRUE;
}
if (lsize > *size)
{
*size = lsize;
SetLastError(ERROR_INSUFFICIENT_BUFFER);
return FALSE;
}
if (!GetLocaleInfoW(LOCALE_SYSTEM_DEFAULT, type, buffer, *size))
{
/* keep last error from callee */
return FALSE;
}
buffer[lsize-1] = 0;
*size = lsize;
*count = 1;
TRACE("returned variable content: %d, \"%s\", %d\n", *count, debugstr_w(buffer), *size);
return TRUE;
}
/***********************************************************************
* GetProcessPreferredUILanguages (KERNEL32.@)
*/
BOOL WINAPI GetProcessPreferredUILanguages( DWORD flags, ULONG *count, WCHAR *buf, ULONG *size )
{
FIXME( "%08x, %p, %p %p\n", flags, count, buf, size );
return get_dummy_preferred_ui_language( flags, count, buf, size );
}
/***********************************************************************
* GetSystemPreferredUILanguages (KERNEL32.@)
*/
BOOL WINAPI GetSystemPreferredUILanguages(DWORD flags, ULONG* count, WCHAR* buffer, ULONG* size)
{
if (flags & ~(MUI_LANGUAGE_NAME | MUI_LANGUAGE_ID | MUI_MACHINE_LANGUAGE_SETTINGS))
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
if ((flags & MUI_LANGUAGE_NAME) && (flags & MUI_LANGUAGE_ID))
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
if (*size && !buffer)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
return get_dummy_preferred_ui_language( flags, count, buffer, size );
}
/***********************************************************************
* SetProcessPreferredUILanguages (KERNEL32.@)
*/
BOOL WINAPI SetProcessPreferredUILanguages( DWORD flags, PCZZWSTR buffer, PULONG count )
{
FIXME("%u, %p, %p\n", flags, buffer, count );
return TRUE;
}
/***********************************************************************
* SetThreadPreferredUILanguages (KERNEL32.@)
*/
BOOL WINAPI SetThreadPreferredUILanguages( DWORD flags, PCZZWSTR buffer, PULONG count )
{
FIXME( "%u, %p, %p\n", flags, buffer, count );
return TRUE;
}
/***********************************************************************
* GetThreadPreferredUILanguages (KERNEL32.@)
*/
BOOL WINAPI GetThreadPreferredUILanguages( DWORD flags, ULONG *count, WCHAR *buf, ULONG *size )
{
FIXME( "%08x, %p, %p %p\n", flags, count, buf, size );
return get_dummy_preferred_ui_language( flags, count, buf, size );
}
/******************************************************************************
* GetUserPreferredUILanguages (KERNEL32.@)
*/
BOOL WINAPI GetUserPreferredUILanguages( DWORD flags, ULONG *count, WCHAR *buffer, ULONG *size )
{
TRACE( "%u %p %p %p\n", flags, count, buffer, size );
if (flags & ~(MUI_LANGUAGE_NAME | MUI_LANGUAGE_ID))
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
if ((flags & MUI_LANGUAGE_NAME) && (flags & MUI_LANGUAGE_ID))
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
if (*size && !buffer)
{
SetLastError(ERROR_INVALID_PARAMETER);
return FALSE;
}
return get_dummy_preferred_ui_language( flags, count, buffer, size );
}
/****************************************************************************** /******************************************************************************
* SetLocaleInfoA [KERNEL32.@] * SetLocaleInfoA [KERNEL32.@]
* *

View File

@ -93,6 +93,9 @@ static NTSTATUS (WINAPI *pRtlIsNormalizedString)(ULONG, LPCWSTR, INT, BOOLEAN*);
static NTSTATUS (WINAPI *pNtGetNlsSectionPtr)(ULONG,ULONG,void*,void**,SIZE_T*); static NTSTATUS (WINAPI *pNtGetNlsSectionPtr)(ULONG,ULONG,void*,void**,SIZE_T*);
static void (WINAPI *pRtlInitCodePageTable)(USHORT*,CPTABLEINFO*); static void (WINAPI *pRtlInitCodePageTable)(USHORT*,CPTABLEINFO*);
static NTSTATUS (WINAPI *pRtlCustomCPToUnicodeN)(CPTABLEINFO*,WCHAR*,DWORD,DWORD*,const char*,DWORD); static NTSTATUS (WINAPI *pRtlCustomCPToUnicodeN)(CPTABLEINFO*,WCHAR*,DWORD,DWORD*,const char*,DWORD);
static NTSTATUS (WINAPI *pRtlGetSystemPreferredUILanguages)(DWORD,ULONG,ULONG*,WCHAR*,ULONG*);
static NTSTATUS (WINAPI *pRtlGetThreadPreferredUILanguages)(DWORD,ULONG*,WCHAR*,ULONG*);
static NTSTATUS (WINAPI *pRtlGetUserPreferredUILanguages)(DWORD,ULONG,ULONG*,WCHAR*,ULONG*);
static void InitFunctionPointers(void) static void InitFunctionPointers(void)
{ {
@ -140,6 +143,9 @@ static void InitFunctionPointers(void)
X(NtGetNlsSectionPtr); X(NtGetNlsSectionPtr);
X(RtlInitCodePageTable); X(RtlInitCodePageTable);
X(RtlCustomCPToUnicodeN); X(RtlCustomCPToUnicodeN);
X(RtlGetSystemPreferredUILanguages);
X(RtlGetThreadPreferredUILanguages);
X(RtlGetUserPreferredUILanguages);
#undef X #undef X
} }
@ -5328,10 +5334,10 @@ static void test_invariant(void)
static void test_GetSystemPreferredUILanguages(void) static void test_GetSystemPreferredUILanguages(void)
{ {
BOOL ret; BOOL ret;
NTSTATUS status;
ULONG count, size, size_id, size_name, size_buffer; ULONG count, size, size_id, size_name, size_buffer;
WCHAR *buffer; WCHAR *buffer;
if (!pGetSystemPreferredUILanguages) if (!pGetSystemPreferredUILanguages)
{ {
win_skip("GetSystemPreferredUILanguages is not available.\n"); win_skip("GetSystemPreferredUILanguages is not available.\n");
@ -5482,12 +5488,45 @@ static void test_GetSystemPreferredUILanguages(void)
"Expected last two WCHARs being empty, got 0x%x 0x%x\n", "Expected last two WCHARs being empty, got 0x%x 0x%x\n",
buffer[size -2], buffer[size -1]); buffer[size -2], buffer[size -1]);
/* ntdll version is the same, but apparently takes an extra second parameter */
count = 0;
size = size_buffer;
memset(buffer, 0x5a, size_buffer * sizeof(WCHAR));
status = pRtlGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, 0, &count, buffer, &size);
ok(!status, "got %x\n", status);
ok(count, "Expected count > 0\n");
ok(size % 5 == 1, "Expected size (%d) %% 5 == 1\n", size);
if (ret && size % 5 == 1)
ok(!buffer[size -2] && !buffer[size -1],
"Expected last two WCHARs being empty, got 0x%x 0x%x\n",
buffer[size -2], buffer[size -1]);
count = 0;
size = size_buffer;
status = pRtlGetSystemPreferredUILanguages(MUI_LANGUAGE_NAME, 0, &count, buffer, &size);
ok(!status, "got %x\n", status);
ok(count, "Expected count > 0\n");
ok(size % 6 == 1, "Expected size (%d) %% 6 == 1\n", size);
if (ret && size % 5 == 1)
ok(!buffer[size -2] && !buffer[size -1],
"Expected last two WCHARs being empty, got 0x%x 0x%x\n",
buffer[size -2], buffer[size -1]);
count = 0;
size = 0;
status = pRtlGetSystemPreferredUILanguages(MUI_MACHINE_LANGUAGE_SETTINGS, 0, &count, NULL, &size);
ok(!status, "got %x\n", status);
ok(count, "Expected count > 0\n");
ok(size % 6 == 1, "Expected size (%d) %% 6 == 1\n", size);
if (ret && size % 6 == 1)
ok(!buffer[size -2] && !buffer[size -1],
"Expected last two WCHARs being empty, got 0x%x 0x%x\n",
buffer[size -2], buffer[size -1]);
size = 0; size = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &count, buffer, &size); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &count, buffer, &size);
todo_wine
ok(!ret, "Expected GetSystemPreferredUILanguages to fail\n"); ok(!ret, "Expected GetSystemPreferredUILanguages to fail\n");
todo_wine
ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(),
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
ok(size == size_id, "expected %u, got %u\n", size_id, size); ok(size == size_id, "expected %u, got %u\n", size_id, size);
@ -5524,6 +5563,7 @@ todo_wine
static void test_GetThreadPreferredUILanguages(void) static void test_GetThreadPreferredUILanguages(void)
{ {
BOOL ret; BOOL ret;
NTSTATUS status;
ULONG count, size, size_id; ULONG count, size, size_id;
WCHAR *buf; WCHAR *buf;
@ -5552,12 +5592,18 @@ static void test_GetThreadPreferredUILanguages(void)
ok(size_id, "expected size > 0\n"); ok(size_id, "expected size > 0\n");
ok(size_id <= size, "expected size > 0\n"); ok(size_id <= size, "expected size > 0\n");
/* ntdll function is the same */
size_id = count = 0;
status = pRtlGetThreadPreferredUILanguages(MUI_LANGUAGE_ID, &count, NULL, &size_id);
ok(!status, "got %x\n", status);
ok(count, "expected count > 0\n");
ok(size_id, "expected size > 0\n");
ok(size_id <= size, "expected size > 0\n");
size = 0; size = 0;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pGetThreadPreferredUILanguages(MUI_LANGUAGE_ID, &count, buf, &size); ret = pGetThreadPreferredUILanguages(MUI_LANGUAGE_ID, &count, buf, &size);
todo_wine
ok(!ret, "Expected GetThreadPreferredUILanguages to fail\n"); ok(!ret, "Expected GetThreadPreferredUILanguages to fail\n");
todo_wine
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
ok(size == size_id, "expected %u, got %u\n", size_id, size); ok(size == size_id, "expected %u, got %u\n", size_id, size);
@ -5593,6 +5639,7 @@ todo_wine
static void test_GetUserPreferredUILanguages(void) static void test_GetUserPreferredUILanguages(void)
{ {
BOOL ret; BOOL ret;
NTSTATUS status;
ULONG count, size, size_id, size_name, size_buffer; ULONG count, size, size_id, size_name, size_buffer;
WCHAR *buffer; WCHAR *buffer;
@ -5653,6 +5700,15 @@ static void test_GetUserPreferredUILanguages(void)
return; return;
} }
/* ntdll version is the same, but apparently takes an extra second parameter */
count = 0;
size_id = 0;
SetLastError(0xdeadbeef);
status = pRtlGetUserPreferredUILanguages(MUI_LANGUAGE_ID, 0, &count, NULL, &size_id);
ok(!status, "got %x\n", status);
ok(count, "Expected count > 0\n");
ok(size_id % 5 == 1, "Expected size (%d) %% 5 == 1\n", size_id);
buffer = HeapAlloc(GetProcessHeap(), 0, size_buffer * sizeof(WCHAR)); buffer = HeapAlloc(GetProcessHeap(), 0, size_buffer * sizeof(WCHAR));
count = 0; count = 0;

View File

@ -632,7 +632,7 @@
# @ stub GetProcessInformation # @ stub GetProcessInformation
# @ stub GetProcessMemoryInfo # @ stub GetProcessMemoryInfo
@ stdcall GetProcessMitigationPolicy(long long ptr long) @ stdcall GetProcessMitigationPolicy(long long ptr long)
@ stdcall GetProcessPreferredUILanguages(long ptr ptr ptr) kernel32.GetProcessPreferredUILanguages @ stdcall GetProcessPreferredUILanguages(long ptr ptr ptr)
@ stdcall GetProcessPriorityBoost(long ptr) @ stdcall GetProcessPriorityBoost(long ptr)
@ stdcall GetProcessShutdownParameters(ptr ptr) @ stdcall GetProcessShutdownParameters(ptr ptr)
@ stdcall GetProcessTimes(long ptr ptr ptr ptr) @ stdcall GetProcessTimes(long ptr ptr ptr ptr)
@ -692,7 +692,7 @@
# @ stub GetSystemMetadataPath # @ stub GetSystemMetadataPath
# @ stub GetSystemMetadataPathForPackage # @ stub GetSystemMetadataPathForPackage
# @ stub GetSystemMetadataPathForPackageFamily # @ stub GetSystemMetadataPathForPackageFamily
@ stdcall GetSystemPreferredUILanguages(long ptr ptr ptr) kernel32.GetSystemPreferredUILanguages @ stdcall GetSystemPreferredUILanguages(long ptr ptr ptr)
# @ stub GetSystemStateRootFolder # @ stub GetSystemStateRootFolder
@ stdcall GetSystemTime(ptr) @ stdcall GetSystemTime(ptr)
@ stdcall GetSystemTimeAdjustment(ptr ptr ptr) @ stdcall GetSystemTimeAdjustment(ptr ptr ptr)
@ -719,7 +719,7 @@
@ stdcall GetThreadIdealProcessorEx(long ptr) @ stdcall GetThreadIdealProcessorEx(long ptr)
# @ stub GetThreadInformation # @ stub GetThreadInformation
@ stdcall GetThreadLocale() @ stdcall GetThreadLocale()
@ stdcall GetThreadPreferredUILanguages(long ptr ptr ptr) kernel32.GetThreadPreferredUILanguages @ stdcall GetThreadPreferredUILanguages(long ptr ptr ptr)
@ stdcall GetThreadPriority(long) @ stdcall GetThreadPriority(long)
@ stdcall GetThreadPriorityBoost(long ptr) @ stdcall GetThreadPriorityBoost(long ptr)
# @ stub GetThreadSelectedCpuSets # @ stub GetThreadSelectedCpuSets
@ -748,7 +748,7 @@
@ stub GetUserInfoWord @ stub GetUserInfoWord
# @ stub GetUserOverrideString # @ stub GetUserOverrideString
# @ stub GetUserOverrideWord # @ stub GetUserOverrideWord
@ stdcall GetUserPreferredUILanguages(long ptr ptr ptr) kernel32.GetUserPreferredUILanguages @ stdcall GetUserPreferredUILanguages(long ptr ptr ptr)
@ stdcall GetVersion() @ stdcall GetVersion()
@ stdcall GetVersionExA(ptr) @ stdcall GetVersionExA(ptr)
@ stdcall GetVersionExW(ptr) @ stdcall GetVersionExW(ptr)
@ -1458,7 +1458,7 @@
# @ stub SetProcessGroupAffinity # @ stub SetProcessGroupAffinity
# @ stub SetProcessInformation # @ stub SetProcessInformation
@ stdcall SetProcessMitigationPolicy(long ptr long) @ stdcall SetProcessMitigationPolicy(long ptr long)
@ stdcall SetProcessPreferredUILanguages(long ptr ptr) kernel32.SetProcessPreferredUILanguages @ stdcall SetProcessPreferredUILanguages(long ptr ptr)
@ stdcall SetProcessPriorityBoost(long long) @ stdcall SetProcessPriorityBoost(long long)
@ stdcall SetProcessShutdownParameters(long long) @ stdcall SetProcessShutdownParameters(long long)
# @ stub SetProcessValidCallTargets # @ stub SetProcessValidCallTargets
@ -1486,7 +1486,7 @@
@ stdcall SetThreadIdealProcessorEx(long ptr ptr) @ stdcall SetThreadIdealProcessorEx(long ptr ptr)
# @ stub SetThreadInformation # @ stub SetThreadInformation
@ stdcall SetThreadLocale(long) @ stdcall SetThreadLocale(long)
@ stdcall SetThreadPreferredUILanguages(long ptr ptr) kernel32.SetThreadPreferredUILanguages @ stdcall SetThreadPreferredUILanguages(long ptr ptr)
@ stdcall SetThreadPriority(long long) @ stdcall SetThreadPriority(long long)
@ stdcall SetThreadPriorityBoost(long long) @ stdcall SetThreadPriorityBoost(long long)
# @ stub SetThreadSelectedCpuSets # @ stub SetThreadSelectedCpuSets

View File

@ -4541,6 +4541,16 @@ UINT WINAPI GetOEMCP(void)
} }
/***********************************************************************
* GetProcessPreferredUILanguages (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH GetProcessPreferredUILanguages( DWORD flags, ULONG *count,
WCHAR *buffer, ULONG *size )
{
return set_ntstatus( RtlGetProcessPreferredUILanguages( flags, count, buffer, size ));
}
/*********************************************************************** /***********************************************************************
* GetStringTypeA (kernelbase.@) * GetStringTypeA (kernelbase.@)
*/ */
@ -4646,6 +4656,26 @@ LANGID WINAPI DECLSPEC_HOTPATCH GetSystemDefaultUILanguage(void)
} }
/***********************************************************************
* GetSystemPreferredUILanguages (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH GetSystemPreferredUILanguages( DWORD flags, ULONG *count,
WCHAR *buffer, ULONG *size )
{
return set_ntstatus( RtlGetSystemPreferredUILanguages( flags, 0, count, buffer, size ));
}
/***********************************************************************
* GetThreadPreferredUILanguages (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH GetThreadPreferredUILanguages( DWORD flags, ULONG *count,
WCHAR *buffer, ULONG *size )
{
return set_ntstatus( RtlGetThreadPreferredUILanguages( flags, count, buffer, size ));
}
/*********************************************************************** /***********************************************************************
* GetTimeZoneInformation (kernelbase.@) * GetTimeZoneInformation (kernelbase.@)
*/ */
@ -4808,6 +4838,16 @@ GEOID WINAPI DECLSPEC_HOTPATCH GetUserGeoID( GEOCLASS geoclass )
} }
/******************************************************************************
* GetUserPreferredUILanguages (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH GetUserPreferredUILanguages( DWORD flags, ULONG *count,
WCHAR *buffer, ULONG *size )
{
return set_ntstatus( RtlGetUserPreferredUILanguages( flags, 0, count, buffer, size ));
}
/****************************************************************************** /******************************************************************************
* IdnToAscii (kernelbase.@) * IdnToAscii (kernelbase.@)
*/ */
@ -5584,6 +5624,24 @@ INT WINAPI /* DECLSPEC_HOTPATCH */ SetCalendarInfoW( LCID lcid, CALID calendar,
} }
/***********************************************************************
* SetProcessPreferredUILanguages (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH SetProcessPreferredUILanguages( DWORD flags, PCZZWSTR buffer, ULONG *count )
{
return set_ntstatus( RtlSetProcessPreferredUILanguages( flags, buffer, count ));
}
/***********************************************************************
* SetThreadPreferredUILanguages (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH SetThreadPreferredUILanguages( DWORD flags, PCZZWSTR buffer, ULONG *count )
{
return set_ntstatus( RtlSetThreadPreferredUILanguages( flags, buffer, count ));
}
/*********************************************************************** /***********************************************************************
* SetTimeZoneInformation (kernelbase.@) * SetTimeZoneInformation (kernelbase.@)
*/ */

View File

@ -1005,6 +1005,105 @@ NTSTATUS WINAPI NtQueryInstallUILanguage( LANGID *lang )
} }
static NTSTATUS get_dummy_preferred_ui_language( DWORD flags, LANGID lang, ULONG *count,
WCHAR *buffer, ULONG *size )
{
WCHAR name[LOCALE_NAME_MAX_LENGTH + 2];
NTSTATUS status;
ULONG len;
FIXME("(0x%x %p %p %p) returning a dummy value (current locale)\n", flags, count, buffer, size);
status = load_string( (flags & MUI_LANGUAGE_ID) ? LOCALE_ILANGUAGE : LOCALE_SNAME,
lang, name, ARRAY_SIZE(name) );
if (status) return status;
len = wcslen( name ) + 2;
name[len - 1] = 0;
if (buffer)
{
if (len > *size)
{
*size = len;
return STATUS_BUFFER_TOO_SMALL;
}
memcpy( buffer, name, len * sizeof(WCHAR) );
}
*size = len;
*count = 1;
TRACE("returned variable content: %d, \"%s\", %d\n", *count, debugstr_w(buffer), *size);
return STATUS_SUCCESS;
}
/**************************************************************************
* RtlGetProcessPreferredUILanguages (NTDLL.@)
*/
NTSTATUS WINAPI RtlGetProcessPreferredUILanguages( DWORD flags, ULONG *count, WCHAR *buffer, ULONG *size )
{
FIXME( "%08x, %p, %p %p\n", flags, count, buffer, size );
return get_dummy_preferred_ui_language( flags, user_ui_language, count, buffer, size );
}
/**************************************************************************
* RtlGetSystemPreferredUILanguages (NTDLL.@)
*/
NTSTATUS WINAPI RtlGetSystemPreferredUILanguages( DWORD flags, ULONG unknown, ULONG *count,
WCHAR *buffer, ULONG *size )
{
if (flags & ~(MUI_LANGUAGE_NAME | MUI_LANGUAGE_ID | MUI_MACHINE_LANGUAGE_SETTINGS)) return STATUS_INVALID_PARAMETER;
if ((flags & MUI_LANGUAGE_NAME) && (flags & MUI_LANGUAGE_ID)) return STATUS_INVALID_PARAMETER;
if (*size && !buffer) return STATUS_INVALID_PARAMETER;
return get_dummy_preferred_ui_language( flags, system_ui_language, count, buffer, size );
}
/**************************************************************************
* RtlGetThreadPreferredUILanguages (NTDLL.@)
*/
NTSTATUS WINAPI RtlGetThreadPreferredUILanguages( DWORD flags, ULONG *count, WCHAR *buffer, ULONG *size )
{
FIXME( "%08x, %p, %p %p\n", flags, count, buffer, size );
return get_dummy_preferred_ui_language( flags, user_ui_language, count, buffer, size );
}
/**************************************************************************
* RtlGetUserPreferredUILanguages (NTDLL.@)
*/
NTSTATUS WINAPI RtlGetUserPreferredUILanguages( DWORD flags, ULONG unknown, ULONG *count,
WCHAR *buffer, ULONG *size )
{
if (flags & ~(MUI_LANGUAGE_NAME | MUI_LANGUAGE_ID)) return STATUS_INVALID_PARAMETER;
if ((flags & MUI_LANGUAGE_NAME) && (flags & MUI_LANGUAGE_ID)) return STATUS_INVALID_PARAMETER;
if (*size && !buffer) return STATUS_INVALID_PARAMETER;
return get_dummy_preferred_ui_language( flags, user_ui_language, count, buffer, size );
}
/**************************************************************************
* RtlSetProcessPreferredUILanguages (NTDLL.@)
*/
NTSTATUS WINAPI RtlSetProcessPreferredUILanguages( DWORD flags, PCZZWSTR buffer, ULONG *count )
{
FIXME( "%u, %p, %p\n", flags, buffer, count );
return STATUS_SUCCESS;
}
/**************************************************************************
* RtlSetThreadPreferredUILanguages (NTDLL.@)
*/
NTSTATUS WINAPI RtlSetThreadPreferredUILanguages( DWORD flags, PCZZWSTR buffer, ULONG *count )
{
FIXME( "%u, %p, %p\n", flags, buffer, count );
return STATUS_SUCCESS;
}
/************************************************************************** /**************************************************************************
* NtGetNlsSectionPtr (NTDLL.@) * NtGetNlsSectionPtr (NTDLL.@)
*/ */

View File

@ -711,15 +711,19 @@
@ stdcall RtlGetOwnerSecurityDescriptor(ptr ptr ptr) @ stdcall RtlGetOwnerSecurityDescriptor(ptr ptr ptr)
@ stdcall RtlGetProductInfo(long long long long ptr) @ stdcall RtlGetProductInfo(long long long long ptr)
@ stdcall RtlGetProcessHeaps(long ptr) @ stdcall RtlGetProcessHeaps(long ptr)
@ stdcall RtlGetProcessPreferredUILanguages(long ptr ptr ptr)
@ stdcall RtlGetSaclSecurityDescriptor(ptr ptr ptr ptr) @ stdcall RtlGetSaclSecurityDescriptor(ptr ptr ptr ptr)
@ stdcall RtlGetSearchPath(ptr) @ stdcall RtlGetSearchPath(ptr)
# @ stub RtlGetSecurityDescriptorRMControl # @ stub RtlGetSecurityDescriptorRMControl
# @ stub RtlGetSetBootStatusData # @ stub RtlGetSetBootStatusData
@ stdcall RtlGetSystemPreferredUILanguages(long long ptr ptr ptr)
@ stdcall -ret64 RtlGetSystemTimePrecise() @ stdcall -ret64 RtlGetSystemTimePrecise()
@ stdcall RtlGetThreadErrorMode() @ stdcall RtlGetThreadErrorMode()
@ stdcall RtlGetThreadPreferredUILanguages(long ptr ptr ptr)
@ stdcall RtlGetUnloadEventTrace() @ stdcall RtlGetUnloadEventTrace()
@ stdcall RtlGetUnloadEventTraceEx(ptr ptr ptr) @ stdcall RtlGetUnloadEventTraceEx(ptr ptr ptr)
@ stub RtlGetUserInfoHeap @ stub RtlGetUserInfoHeap
@ stdcall RtlGetUserPreferredUILanguages(long long ptr ptr ptr)
@ stdcall RtlGetVersion(ptr) @ stdcall RtlGetVersion(ptr)
@ stdcall -arch=arm,arm64,x86_64 RtlGrowFunctionTable(ptr long) @ stdcall -arch=arm,arm64,x86_64 RtlGrowFunctionTable(ptr long)
@ stub RtlGuidToPropertySetName @ stub RtlGuidToPropertySetName
@ -942,6 +946,7 @@
# @ stub RtlSetMemoryStreamSize # @ stub RtlSetMemoryStreamSize
@ stdcall RtlSetOwnerSecurityDescriptor(ptr ptr long) @ stdcall RtlSetOwnerSecurityDescriptor(ptr ptr long)
# @ stub RtlSetProcessIsCritical # @ stub RtlSetProcessIsCritical
@ stdcall RtlSetProcessPreferredUILanguages(long ptr ptr)
@ stub RtlSetProperties @ stub RtlSetProperties
@ stub RtlSetPropertyClassId @ stub RtlSetPropertyClassId
@ stub RtlSetPropertyNames @ stub RtlSetPropertyNames
@ -953,6 +958,7 @@
# @ stub RtlSetSecurityObjectEx # @ stub RtlSetSecurityObjectEx
@ stdcall RtlSetThreadErrorMode(long ptr) @ stdcall RtlSetThreadErrorMode(long ptr)
# @ stub RtlSetThreadIsCritical # @ stub RtlSetThreadIsCritical
@ stdcall RtlSetThreadPreferredUILanguages(long ptr ptr)
# @ stub RtlSetThreadPoolStartFunc # @ stub RtlSetThreadPoolStartFunc
@ stdcall RtlSetTimeZoneInformation(ptr) @ stdcall RtlSetTimeZoneInformation(ptr)
# @ stub RtlSetTimer # @ stub RtlSetTimer

View File

@ -938,6 +938,7 @@ WINBASEAPI BOOL WINAPI GetSystemPreferredUILanguages(DWORD,ULONG*,WCHAR*,
WINBASEAPI LCID WINAPI GetThreadLocale(void); WINBASEAPI LCID WINAPI GetThreadLocale(void);
WINBASEAPI BOOL WINAPI GetThreadPreferredUILanguages(DWORD,ULONG*,WCHAR*,ULONG*); WINBASEAPI BOOL WINAPI GetThreadPreferredUILanguages(DWORD,ULONG*,WCHAR*,ULONG*);
WINBASEAPI LANGID WINAPI GetThreadUILanguage(void); WINBASEAPI LANGID WINAPI GetThreadUILanguage(void);
WINBASEAPI BOOL WINAPI GetUserPreferredUILanguages(DWORD,ULONG*,WCHAR*,ULONG*);
WINBASEAPI INT WINAPI GetTimeFormatA(LCID,DWORD,const SYSTEMTIME*,LPCSTR,LPSTR,INT); WINBASEAPI INT WINAPI GetTimeFormatA(LCID,DWORD,const SYSTEMTIME*,LPCSTR,LPSTR,INT);
WINBASEAPI INT WINAPI GetTimeFormatEx(LPCWSTR,DWORD,const SYSTEMTIME*,LPCWSTR,LPWSTR,INT); WINBASEAPI INT WINAPI GetTimeFormatEx(LPCWSTR,DWORD,const SYSTEMTIME*,LPCWSTR,LPWSTR,INT);
WINBASEAPI INT WINAPI GetTimeFormatW(LCID,DWORD,const SYSTEMTIME*,LPCWSTR,LPWSTR,INT); WINBASEAPI INT WINAPI GetTimeFormatW(LCID,DWORD,const SYSTEMTIME*,LPCWSTR,LPWSTR,INT);
@ -973,7 +974,9 @@ WINBASEAPI INT WINAPI SetCalendarInfoW(LCID,CALID,CALTYPE,LPCWSTR);
WINBASEAPI BOOL WINAPI SetLocaleInfoA(LCID,LCTYPE,LPCSTR); WINBASEAPI BOOL WINAPI SetLocaleInfoA(LCID,LCTYPE,LPCSTR);
WINBASEAPI BOOL WINAPI SetLocaleInfoW(LCID,LCTYPE,LPCWSTR); WINBASEAPI BOOL WINAPI SetLocaleInfoW(LCID,LCTYPE,LPCWSTR);
#define SetLocaleInfo WINELIB_NAME_AW(SetLocaleInfo) #define SetLocaleInfo WINELIB_NAME_AW(SetLocaleInfo)
WINBASEAPI BOOL WINAPI SetProcessPreferredUILanguages(DWORD,PCZZWSTR,PULONG);
WINBASEAPI BOOL WINAPI SetThreadLocale(LCID); WINBASEAPI BOOL WINAPI SetThreadLocale(LCID);
WINBASEAPI BOOL WINAPI SetThreadPreferredUILanguages(DWORD,PCZZWSTR,PULONG);
WINBASEAPI LANGID WINAPI SetThreadUILanguage(LANGID); WINBASEAPI LANGID WINAPI SetThreadUILanguage(LANGID);
WINBASEAPI BOOL WINAPI SetUserGeoID(GEOID); WINBASEAPI BOOL WINAPI SetUserGeoID(GEOID);
WINBASEAPI INT WINAPI WideCharToMultiByte(UINT,DWORD,LPCWSTR,INT,LPSTR,INT,LPCSTR,LPBOOL); WINBASEAPI INT WINAPI WideCharToMultiByte(UINT,DWORD,LPCWSTR,INT,LPSTR,INT,LPCSTR,LPBOOL);

View File

@ -2890,10 +2890,14 @@ NTSYSAPI ULONG WINAPI RtlGetNtGlobalFlags(void);
NTSYSAPI BOOLEAN WINAPI RtlGetNtProductType(LPDWORD); NTSYSAPI BOOLEAN WINAPI RtlGetNtProductType(LPDWORD);
NTSYSAPI NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN); NTSYSAPI NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN);
NTSYSAPI ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*); NTSYSAPI ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
NTSYSAPI NTSTATUS WINAPI RtlGetProcessPreferredUILanguages(DWORD,ULONG*,WCHAR*,ULONG*);
NTSYSAPI NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN); NTSYSAPI NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,PBOOLEAN,PACL *,PBOOLEAN);
NTSYSAPI NTSTATUS WINAPI RtlGetSearchPath(PWSTR*); NTSYSAPI NTSTATUS WINAPI RtlGetSearchPath(PWSTR*);
NTSYSAPI NTSTATUS WINAPI RtlGetSystemPreferredUILanguages(DWORD,ULONG,ULONG*,WCHAR*,ULONG*);
NTSYSAPI LONGLONG WINAPI RtlGetSystemTimePrecise(void); NTSYSAPI LONGLONG WINAPI RtlGetSystemTimePrecise(void);
NTSYSAPI DWORD WINAPI RtlGetThreadErrorMode(void); NTSYSAPI DWORD WINAPI RtlGetThreadErrorMode(void);
NTSYSAPI NTSTATUS WINAPI RtlGetThreadPreferredUILanguages(DWORD,ULONG*,WCHAR*,ULONG*);
NTSYSAPI NTSTATUS WINAPI RtlGetUserPreferredUILanguages(DWORD,ULONG,ULONG*,WCHAR*,ULONG*);
NTSYSAPI NTSTATUS WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*); NTSYSAPI NTSTATUS WINAPI RtlGetVersion(RTL_OSVERSIONINFOEXW*);
NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING,GUID*); NTSYSAPI NTSTATUS WINAPI RtlGUIDFromString(PUNICODE_STRING,GUID*);
NTSYSAPI PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID); NTSYSAPI PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(PSID);
@ -3009,9 +3013,11 @@ NTSYSAPI NTSTATUS WINAPI RtlSetGroupSecurityDescriptor(PSECURITY_DESCRIPTOR,PSI
NTSYSAPI NTSTATUS WINAPI RtlSetIoCompletionCallback(HANDLE,PRTL_OVERLAPPED_COMPLETION_ROUTINE,ULONG); NTSYSAPI NTSTATUS WINAPI RtlSetIoCompletionCallback(HANDLE,PRTL_OVERLAPPED_COMPLETION_ROUTINE,ULONG);
NTSYSAPI void WINAPI RtlSetLastWin32Error(DWORD); NTSYSAPI void WINAPI RtlSetLastWin32Error(DWORD);
NTSYSAPI void WINAPI RtlSetLastWin32ErrorAndNtStatusFromNtStatus(NTSTATUS); NTSYSAPI void WINAPI RtlSetLastWin32ErrorAndNtStatusFromNtStatus(NTSTATUS);
NTSYSAPI NTSTATUS WINAPI RtlSetProcessPreferredUILanguages(DWORD,PCZZWSTR,ULONG*);
NTSYSAPI NTSTATUS WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN); NTSYSAPI NTSTATUS WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN);
NTSYSAPI NTSTATUS WINAPI RtlSetSearchPathMode(ULONG); NTSYSAPI NTSTATUS WINAPI RtlSetSearchPathMode(ULONG);
NTSYSAPI NTSTATUS WINAPI RtlSetThreadErrorMode(DWORD,LPDWORD); NTSYSAPI NTSTATUS WINAPI RtlSetThreadErrorMode(DWORD,LPDWORD);
NTSYSAPI NTSTATUS WINAPI RtlSetThreadPreferredUILanguages(DWORD,PCZZWSTR,ULONG*);
NTSYSAPI NTSTATUS WINAPI RtlSetTimeZoneInformation(const RTL_TIME_ZONE_INFORMATION*); NTSYSAPI NTSTATUS WINAPI RtlSetTimeZoneInformation(const RTL_TIME_ZONE_INFORMATION*);
NTSYSAPI void WINAPI RtlSetUnhandledExceptionFilter(PRTL_EXCEPTION_FILTER); NTSYSAPI void WINAPI RtlSetUnhandledExceptionFilter(PRTL_EXCEPTION_FILTER);
NTSYSAPI SIZE_T WINAPI RtlSizeHeap(HANDLE,ULONG,const void*); NTSYSAPI SIZE_T WINAPI RtlSizeHeap(HANDLE,ULONG,const void*);