diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec index 0324e90201b..a095a85e66b 100644 --- a/dlls/kernel32/kernel32.spec +++ b/dlls/kernel32/kernel32.spec @@ -761,7 +761,7 @@ @ stdcall -import GetOEMCP() @ stdcall -import GetOverlappedResult(long ptr ptr 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 -import GetPhysicallyInstalledSystemMemory(ptr) @ stdcall -import GetPriorityClass(long) @@ -787,7 +787,7 @@ @ stdcall -import GetProcessIdOfThread(long) @ stdcall GetProcessIoCounters(long ptr) @ 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 GetProcessShutdownParameters(ptr ptr) # @ stub GetProcessorSystemCycleTime @@ -829,7 +829,7 @@ @ stdcall -import GetSystemFirmwareTable(long long ptr long) @ stdcall -import GetSystemInfo(ptr) @ stdcall GetSystemPowerStatus(ptr) -@ stdcall GetSystemPreferredUILanguages(long ptr ptr ptr) +@ stdcall -import GetSystemPreferredUILanguages(long ptr ptr ptr) @ stdcall GetSystemRegistryQuota(ptr ptr) @ stdcall -import GetSystemTime(ptr) @ stdcall -import GetSystemTimeAdjustment(ptr ptr ptr) @@ -855,7 +855,7 @@ @ stdcall -import GetThreadId(ptr) @ stdcall -import GetThreadIdealProcessorEx(long ptr) @ stdcall -import GetThreadLocale() -@ stdcall GetThreadPreferredUILanguages(long ptr ptr ptr) +@ stdcall -import GetThreadPreferredUILanguages(long ptr ptr ptr) @ stdcall -import GetThreadPriority(long) @ stdcall -import GetThreadPriorityBoost(long ptr) @ stdcall GetThreadSelectorEntry(long long ptr) @@ -1433,7 +1433,7 @@ @ stdcall -import SetProcessAffinityUpdateMode(long long) @ stdcall SetProcessDEPPolicy(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 SetProcessShutdownParameters(long long) # @ stub SetProcessUserModeExceptionPolicy @@ -1458,7 +1458,7 @@ @ stdcall -import SetThreadIdealProcessor(long long) @ stdcall -import SetThreadIdealProcessorEx(long ptr ptr) @ stdcall -import SetThreadLocale(long) -@ stdcall SetThreadPreferredUILanguages(long ptr ptr) +@ stdcall -import SetThreadPreferredUILanguages(long ptr ptr) @ stdcall -import SetThreadPriority(long long) @ stdcall -import SetThreadPriorityBoost(long long) @ stdcall -import SetThreadStackGuarantee(ptr) diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index 6ec1be144fe..58389f6697d 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -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.@] * diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index a8efb60eb55..c73c4a3f210 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -93,6 +93,9 @@ static NTSTATUS (WINAPI *pRtlIsNormalizedString)(ULONG, LPCWSTR, INT, BOOLEAN*); static NTSTATUS (WINAPI *pNtGetNlsSectionPtr)(ULONG,ULONG,void*,void**,SIZE_T*); static void (WINAPI *pRtlInitCodePageTable)(USHORT*,CPTABLEINFO*); 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) { @@ -140,6 +143,9 @@ static void InitFunctionPointers(void) X(NtGetNlsSectionPtr); X(RtlInitCodePageTable); X(RtlCustomCPToUnicodeN); + X(RtlGetSystemPreferredUILanguages); + X(RtlGetThreadPreferredUILanguages); + X(RtlGetUserPreferredUILanguages); #undef X } @@ -5328,10 +5334,10 @@ static void test_invariant(void) static void test_GetSystemPreferredUILanguages(void) { BOOL ret; + NTSTATUS status; ULONG count, size, size_id, size_name, size_buffer; WCHAR *buffer; - if (!pGetSystemPreferredUILanguages) { 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", 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; SetLastError(0xdeadbeef); ret = pGetSystemPreferredUILanguages(MUI_LANGUAGE_ID, &count, buffer, &size); -todo_wine ok(!ret, "Expected GetSystemPreferredUILanguages to fail\n"); -todo_wine ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); ok(size == size_id, "expected %u, got %u\n", size_id, size); @@ -5524,6 +5563,7 @@ todo_wine static void test_GetThreadPreferredUILanguages(void) { BOOL ret; + NTSTATUS status; ULONG count, size, size_id; WCHAR *buf; @@ -5552,12 +5592,18 @@ static void test_GetThreadPreferredUILanguages(void) ok(size_id, "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; SetLastError(0xdeadbeef); ret = pGetThreadPreferredUILanguages(MUI_LANGUAGE_ID, &count, buf, &size); -todo_wine ok(!ret, "Expected GetThreadPreferredUILanguages to fail\n"); -todo_wine ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); ok(size == size_id, "expected %u, got %u\n", size_id, size); @@ -5593,6 +5639,7 @@ todo_wine static void test_GetUserPreferredUILanguages(void) { BOOL ret; + NTSTATUS status; ULONG count, size, size_id, size_name, size_buffer; WCHAR *buffer; @@ -5653,6 +5700,15 @@ static void test_GetUserPreferredUILanguages(void) 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)); count = 0; diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec index 15f43db65d4..d85c36c6e5c 100644 --- a/dlls/kernelbase/kernelbase.spec +++ b/dlls/kernelbase/kernelbase.spec @@ -632,7 +632,7 @@ # @ stub GetProcessInformation # @ stub GetProcessMemoryInfo @ 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 GetProcessShutdownParameters(ptr ptr) @ stdcall GetProcessTimes(long ptr ptr ptr ptr) @@ -692,7 +692,7 @@ # @ stub GetSystemMetadataPath # @ stub GetSystemMetadataPathForPackage # @ stub GetSystemMetadataPathForPackageFamily -@ stdcall GetSystemPreferredUILanguages(long ptr ptr ptr) kernel32.GetSystemPreferredUILanguages +@ stdcall GetSystemPreferredUILanguages(long ptr ptr ptr) # @ stub GetSystemStateRootFolder @ stdcall GetSystemTime(ptr) @ stdcall GetSystemTimeAdjustment(ptr ptr ptr) @@ -719,7 +719,7 @@ @ stdcall GetThreadIdealProcessorEx(long ptr) # @ stub GetThreadInformation @ stdcall GetThreadLocale() -@ stdcall GetThreadPreferredUILanguages(long ptr ptr ptr) kernel32.GetThreadPreferredUILanguages +@ stdcall GetThreadPreferredUILanguages(long ptr ptr ptr) @ stdcall GetThreadPriority(long) @ stdcall GetThreadPriorityBoost(long ptr) # @ stub GetThreadSelectedCpuSets @@ -748,7 +748,7 @@ @ stub GetUserInfoWord # @ stub GetUserOverrideString # @ stub GetUserOverrideWord -@ stdcall GetUserPreferredUILanguages(long ptr ptr ptr) kernel32.GetUserPreferredUILanguages +@ stdcall GetUserPreferredUILanguages(long ptr ptr ptr) @ stdcall GetVersion() @ stdcall GetVersionExA(ptr) @ stdcall GetVersionExW(ptr) @@ -1458,7 +1458,7 @@ # @ stub SetProcessGroupAffinity # @ stub SetProcessInformation @ stdcall SetProcessMitigationPolicy(long ptr long) -@ stdcall SetProcessPreferredUILanguages(long ptr ptr) kernel32.SetProcessPreferredUILanguages +@ stdcall SetProcessPreferredUILanguages(long ptr ptr) @ stdcall SetProcessPriorityBoost(long long) @ stdcall SetProcessShutdownParameters(long long) # @ stub SetProcessValidCallTargets @@ -1486,7 +1486,7 @@ @ stdcall SetThreadIdealProcessorEx(long ptr ptr) # @ stub SetThreadInformation @ stdcall SetThreadLocale(long) -@ stdcall SetThreadPreferredUILanguages(long ptr ptr) kernel32.SetThreadPreferredUILanguages +@ stdcall SetThreadPreferredUILanguages(long ptr ptr) @ stdcall SetThreadPriority(long long) @ stdcall SetThreadPriorityBoost(long long) # @ stub SetThreadSelectedCpuSets diff --git a/dlls/kernelbase/locale.c b/dlls/kernelbase/locale.c index c7963e33267..4f67a0d6d21 100644 --- a/dlls/kernelbase/locale.c +++ b/dlls/kernelbase/locale.c @@ -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.@) */ @@ -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.@) */ @@ -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.@) */ @@ -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.@) */ diff --git a/dlls/ntdll/locale.c b/dlls/ntdll/locale.c index 89137dcca88..15ccdeb2e63 100644 --- a/dlls/ntdll/locale.c +++ b/dlls/ntdll/locale.c @@ -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.@) */ diff --git a/dlls/ntdll/ntdll.spec b/dlls/ntdll/ntdll.spec index e82fb6a2aa1..7ae8a6071dc 100644 --- a/dlls/ntdll/ntdll.spec +++ b/dlls/ntdll/ntdll.spec @@ -711,15 +711,19 @@ @ stdcall RtlGetOwnerSecurityDescriptor(ptr ptr ptr) @ stdcall RtlGetProductInfo(long long long long ptr) @ stdcall RtlGetProcessHeaps(long ptr) +@ stdcall RtlGetProcessPreferredUILanguages(long ptr ptr ptr) @ stdcall RtlGetSaclSecurityDescriptor(ptr ptr ptr ptr) @ stdcall RtlGetSearchPath(ptr) # @ stub RtlGetSecurityDescriptorRMControl # @ stub RtlGetSetBootStatusData +@ stdcall RtlGetSystemPreferredUILanguages(long long ptr ptr ptr) @ stdcall -ret64 RtlGetSystemTimePrecise() @ stdcall RtlGetThreadErrorMode() +@ stdcall RtlGetThreadPreferredUILanguages(long ptr ptr ptr) @ stdcall RtlGetUnloadEventTrace() @ stdcall RtlGetUnloadEventTraceEx(ptr ptr ptr) @ stub RtlGetUserInfoHeap +@ stdcall RtlGetUserPreferredUILanguages(long long ptr ptr ptr) @ stdcall RtlGetVersion(ptr) @ stdcall -arch=arm,arm64,x86_64 RtlGrowFunctionTable(ptr long) @ stub RtlGuidToPropertySetName @@ -942,6 +946,7 @@ # @ stub RtlSetMemoryStreamSize @ stdcall RtlSetOwnerSecurityDescriptor(ptr ptr long) # @ stub RtlSetProcessIsCritical +@ stdcall RtlSetProcessPreferredUILanguages(long ptr ptr) @ stub RtlSetProperties @ stub RtlSetPropertyClassId @ stub RtlSetPropertyNames @@ -953,6 +958,7 @@ # @ stub RtlSetSecurityObjectEx @ stdcall RtlSetThreadErrorMode(long ptr) # @ stub RtlSetThreadIsCritical +@ stdcall RtlSetThreadPreferredUILanguages(long ptr ptr) # @ stub RtlSetThreadPoolStartFunc @ stdcall RtlSetTimeZoneInformation(ptr) # @ stub RtlSetTimer diff --git a/include/winnls.h b/include/winnls.h index e7b478b1c64..2964ae56853 100644 --- a/include/winnls.h +++ b/include/winnls.h @@ -938,6 +938,7 @@ WINBASEAPI BOOL WINAPI GetSystemPreferredUILanguages(DWORD,ULONG*,WCHAR*, WINBASEAPI LCID WINAPI GetThreadLocale(void); WINBASEAPI BOOL WINAPI GetThreadPreferredUILanguages(DWORD,ULONG*,WCHAR*,ULONG*); 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 GetTimeFormatEx(LPCWSTR,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 SetLocaleInfoW(LCID,LCTYPE,LPCWSTR); #define SetLocaleInfo WINELIB_NAME_AW(SetLocaleInfo) +WINBASEAPI BOOL WINAPI SetProcessPreferredUILanguages(DWORD,PCZZWSTR,PULONG); WINBASEAPI BOOL WINAPI SetThreadLocale(LCID); +WINBASEAPI BOOL WINAPI SetThreadPreferredUILanguages(DWORD,PCZZWSTR,PULONG); WINBASEAPI LANGID WINAPI SetThreadUILanguage(LANGID); WINBASEAPI BOOL WINAPI SetUserGeoID(GEOID); WINBASEAPI INT WINAPI WideCharToMultiByte(UINT,DWORD,LPCWSTR,INT,LPSTR,INT,LPCSTR,LPBOOL); diff --git a/include/winternl.h b/include/winternl.h index edcbc5ca13d..e197a55a27d 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2890,10 +2890,14 @@ NTSYSAPI ULONG WINAPI RtlGetNtGlobalFlags(void); NTSYSAPI BOOLEAN WINAPI RtlGetNtProductType(LPDWORD); NTSYSAPI NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(PSECURITY_DESCRIPTOR,PSID *,PBOOLEAN); 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 RtlGetSearchPath(PWSTR*); +NTSYSAPI NTSTATUS WINAPI RtlGetSystemPreferredUILanguages(DWORD,ULONG,ULONG*,WCHAR*,ULONG*); NTSYSAPI LONGLONG WINAPI RtlGetSystemTimePrecise(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 RtlGUIDFromString(PUNICODE_STRING,GUID*); 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 void WINAPI RtlSetLastWin32Error(DWORD); NTSYSAPI void WINAPI RtlSetLastWin32ErrorAndNtStatusFromNtStatus(NTSTATUS); +NTSYSAPI NTSTATUS WINAPI RtlSetProcessPreferredUILanguages(DWORD,PCZZWSTR,ULONG*); NTSYSAPI NTSTATUS WINAPI RtlSetSaclSecurityDescriptor(PSECURITY_DESCRIPTOR,BOOLEAN,PACL,BOOLEAN); NTSYSAPI NTSTATUS WINAPI RtlSetSearchPathMode(ULONG); NTSYSAPI NTSTATUS WINAPI RtlSetThreadErrorMode(DWORD,LPDWORD); +NTSYSAPI NTSTATUS WINAPI RtlSetThreadPreferredUILanguages(DWORD,PCZZWSTR,ULONG*); NTSYSAPI NTSTATUS WINAPI RtlSetTimeZoneInformation(const RTL_TIME_ZONE_INFORMATION*); NTSYSAPI void WINAPI RtlSetUnhandledExceptionFilter(PRTL_EXCEPTION_FILTER); NTSYSAPI SIZE_T WINAPI RtlSizeHeap(HANDLE,ULONG,const void*);