mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 21:36:11 +00:00
[KERNEL32_VISTA] Move GetLocaleInfoEx from locale.c into a separate file
This allows to have it in kernel32_vista
This commit is contained in:
parent
c37310b4e0
commit
a8987adb67
4 changed files with 52 additions and 0 deletions
|
@ -9,6 +9,7 @@ spec2def(kernel32_vista.dll kernel32_vista.spec ADD_IMPORTLIB)
|
|||
list(APPEND SOURCE
|
||||
firmware.c
|
||||
EnumSystemLocalesEx.c
|
||||
GetLocaleInfoEx.c
|
||||
GetFileInformationByHandleEx.c
|
||||
GetTickCount64.c
|
||||
GetUserDefaultLocaleName.c
|
||||
|
|
48
dll/win32/kernel32/kernel32_vista/GetLocaleInfoEx.c
Normal file
48
dll/win32/kernel32/kernel32_vista/GetLocaleInfoEx.c
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* PROJECT: ReactOS Win32 Base API
|
||||
* LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
|
||||
* PURPOSE: Implementation of GetLocaleInfoEx (taken from wine-locale.c)
|
||||
* COPYRIGHT: Copyright 1995 Martin von Loewis
|
||||
* Copyright 1998 David Lee Lambert
|
||||
* Copyright 2000 Julio César Gázquez
|
||||
* Copyright 2002 Alexandre Julliard for CodeWeavers
|
||||
*/
|
||||
|
||||
#include "k32_vista.h"
|
||||
#include <winnls.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
/******************************************************************************
|
||||
* GetLocaleInfoEx (KERNEL32.@)
|
||||
*/
|
||||
INT WINAPI GetLocaleInfoEx(LPCWSTR locale, LCTYPE info, LPWSTR buffer, INT len)
|
||||
{
|
||||
LCID lcid = LocaleNameToLCID(locale, 0);
|
||||
|
||||
DPRINT("%s, lcid=0x%x, 0x%x\n", debugstr_w(locale), lcid, info);
|
||||
|
||||
if (!lcid) return 0;
|
||||
|
||||
/* special handling for neutral locale names */
|
||||
if (locale && strlenW(locale) == 2)
|
||||
{
|
||||
switch (info)
|
||||
{
|
||||
case LOCALE_SNAME:
|
||||
if (len && len < 3)
|
||||
{
|
||||
SetLastError(ERROR_INSUFFICIENT_BUFFER);
|
||||
return 0;
|
||||
}
|
||||
if (len) strcpyW(buffer, locale);
|
||||
return 3;
|
||||
case LOCALE_SPARENT:
|
||||
if (len) buffer[0] = 0;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return GetLocaleInfoW(lcid, info, buffer, len);
|
||||
}
|
|
@ -39,6 +39,7 @@
|
|||
@ stdcall GetFileMUIPath(long wstr wstr ptr wstr ptr ptr)
|
||||
@ stdcall GetFinalPathNameByHandleA(ptr str long long)
|
||||
@ stdcall GetFinalPathNameByHandleW(ptr wstr long long)
|
||||
@ stdcall GetLocaleInfoEx(wstr long ptr long)
|
||||
@ stdcall GetSystemPreferredUILanguages(long ptr wstr ptr)
|
||||
@ stdcall GetThreadPreferredUILanguages(long ptr wstr ptr)
|
||||
@ stdcall GetThreadUILanguage()
|
||||
|
|
|
@ -1816,6 +1816,7 @@ INT WINAPI GetLocaleInfoW( LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len )
|
|||
}
|
||||
|
||||
#if (WINVER >= 0x0600)
|
||||
#if 0 // See kernel32_vista
|
||||
/******************************************************************************
|
||||
* GetLocaleInfoEx (KERNEL32.@)
|
||||
*/
|
||||
|
@ -1848,6 +1849,7 @@ INT WINAPI GetLocaleInfoEx(LPCWSTR locale, LCTYPE info, LPWSTR buffer, INT len)
|
|||
|
||||
return GetLocaleInfoW(lcid, info, buffer, len);
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOL
|
||||
WINAPI
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue