17 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
19 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
20 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
21 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
22 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,101,102,
23 103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,
24 120,121,122,123,124,125,126,127
28extern const unsigned short _wctype[];
100 ptd->_own_locale =
ptd->_own_locale & ~_PER_THREAD_LOCALE_BIT;
229 locale_copy.get()->locinfo =
ptd->_locale_info;
230 locale_copy.get()->mbcinfo =
ptd->_multibyte_info;
241 return locale_copy.detach();
245#ifndef _UCRT_ENCLAVE_BUILD
258 const wchar_t * catname;
284 if (ptlocis !=
nullptr && ptlocid !=
nullptr && ptlocid != ptlocis) {
345 if (_category < LC_MIN || _category >
LC_MAX ||
locale ==
nullptr)
360 _setmbcp_nolock(locale_data.get()->_public._locale_lc_codepage, multibyte_data.get()) != 0)
367 multibyte_data.get()->refcount = 1;
369 result.get()->locinfo = locale_data.detach();
370 result.get()->mbcinfo = multibyte_data.detach();
386 if ( (_category <
LC_MIN) || (_category >
LC_MAX) || _locale ==
nullptr)
389 if ( __acrt_MultiByteToWideChar(
CP_ACP, 0, _locale, -1, _wlocale,
_countof(_wlocale)) == 0 )
443 const wchar_t *_wlocale
482 __crt_call_and_cleanup([&]
496 if (_wlocale !=
nullptr)
539 const wchar_t *_wlocale
556 if (_wlocale !=
nullptr)
558 if ( (_wlocale[0]==
L'L') && (_wlocale[1]==
L'C') && (_wlocale[2]==
L'_') )
562 const wchar_t *
p = _wlocale;
568 if (
s ==
nullptr || (
len=(
size_t)(
s -
p)) == 0 || (*
s ==
L';'))
649 const wchar_t * wlocale
653 wchar_t * oldlocalename;
659 wchar_t *
pch =
nullptr;
660 wchar_t * pch_cat_locale =
nullptr;
666 int _LOC_CCACHE =
_countof(
ptd->_setloc_data._Loc_c);
679 if ((
pch =
static_cast<wchar_t*
>(
_malloc_crt(
sizeof(
int) + (
cch *
sizeof(
wchar_t))))) ==
nullptr)
682 pch_cat_locale =
pch + (
sizeof(
int) /
sizeof(
wchar_t));
694 if (lctemp[0] ==
L'C' && lctemp[1] ==
L'\x0')
707 buf1 = _Loc_c[_LOC_CCACHE -1];
712 for (
i = 0;
i < _LOC_CCACHE;
i++)
721 _Loc_c[0] = _Loc_c[
i];
733 if (
i == _LOC_CCACHE)
793 reinterpret_cast<long&
>(*pch) = 1;
806 wchar_t *
pch =
nullptr;
808 long *refcount =
nullptr;
809 size_t refcountSize = 0;
813 if ( (refcount =
static_cast<long*
>(
_malloc_crt(refcountSize))) ==
nullptr)
816 pch = ((
wchar_t*)refcount) + (
sizeof(
int) /
sizeof(
wchar_t));
908 for (
size_t i = 0;
i <
len; ++
i)
920 for (
size_t i = 0;
i <
len; ++
i)
1005 wchar_t const *
p =
expr;
1006 wchar_t const *
const delimiters =
L"-_.";
1012 size_t num_sections = 0;
1029 sections[num_sections].length = section_length;
1030 sections[num_sections].delimiter = last_delimiter;
1032 p += section_length;
1036 switch (num_sections)
1076 valid_windows_locale_name,
1079 sizeof(
int) /
sizeof(
wchar_t)
1082 if (size_written == 0 ||
code_page == 0)
1098 wchar_t *
const localeNameOutput,
1140 wchar_t const *
const expr,
1141 wchar_t *
const output,
1143 wchar_t *
const localeNameOutput,
1145 UINT& output_code_page
1196 output_code_page =
CP_ACP;
1202 wchar_t *
const cachein = _psetloc_data->
_cachein;
1204 wchar_t *
const cacheout = _psetloc_data->
_cacheout;
1206 size_t charactersInExpression = 0;
1235 if (getqloc_results)
1249 *pcachecp =
static_cast<WORD>(iCodePage);
1260 wchar_t const *
const normalized_locale_name =
names.szLocaleName;
1262 if (
names.szCodePage[0])
1264 wchar_t const *
const cp =
names.szCodePage;
1270 && (
cp[3] ==
L'8' &&
cp[4] ==
L'\0')
1271 || (
cp[3] ==
L'-' &&
cp[4] ==
L'8' &&
cp[5] ==
L'\0'))
1287 *pcachecp =
static_cast<WORD>(iCodePage);
1311 output_code_page = *pcachecp;
1326 for (
i =0;
i<
n;
i++)
1344 if (*wlocale==
L'\0')
1348 if (wlocale[0] ==
L'.' && wlocale[1] !=
L'\0')
1404 if (*(
names->szCountry))
1406 if (*(
names->szCodePage))
1414 wchar_t* localeNameCopy;
1423 if ((localeNameCopy = (
wchar_t *)
_malloc_crt((
cch + 1) *
sizeof(
wchar_t))) ==
nullptr)
1427 return localeNameCopy;
BOOL __cdecl __acrt_GetStringTypeA(_locale_t const locale, DWORD const info_type, LPCSTR const string, int const string_size_in_bytes, unsigned short *const char_type, int const code_page, BOOL const error)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
#define InterlockedIncrement
#define InterlockedDecrement
void commit_locale_name_cache_already_updated(wchar_t const *const new_locale_name, size_t const new_locale_name_length)
__crt_qualified_locale_data * _psetloc_data
wchar_t * _localeNameOutput
_expandlocale_locale_name_cache(wchar_t *const localeNameOutput, size_t const localeNameSizeInChars, __crt_qualified_locale_data *const psetloc_data)
void commit_locale_name(wchar_t const *const new_locale_name, size_t const new_locale_name_length)
~_expandlocale_locale_name_cache()
_expandlocale_locale_name_cache & operator=(_expandlocale_locale_name_cache const &)=delete
size_t _localeNameSizeInChars
_expandlocale_locale_name_cache(_expandlocale_locale_name_cache const &)=delete
__acrt_ptd *__cdecl __acrt_getptd(void)
void __cdecl __acrt_unlock(_In_ __acrt_lock_id lock)
#define _WSETLOCALE_AVOID_SYNC_LOCALE_BIT
void __cdecl __acrt_release_locale_ref(__crt_locale_data *)
__crt_multibyte_data *__cdecl __acrt_update_thread_multibyte_data(void)
int WINAPI __acrt_GetLocaleInfoEx(_In_opt_ LPCWSTR locale_name, _In_ LCTYPE lc_type, _Out_writes_opt_(data_count) LPWSTR data, _In_ int data_count)
struct lconv * __acrt_lconv
@ __acrt_multibyte_cp_lock
bool __cdecl __acrt_can_use_vista_locale_apis(void)
#define _CRT_LINKER_FORCE_INCLUDE(name)
wchar_t __acrt_wide_c_locale_string[]
#define _PER_THREAD_LOCALE_BIT
void __cdecl __acrt_eagerly_load_locale_apis(void)
__crt_locale_data *__cdecl __acrt_update_thread_locale_data(void)
void __cdecl __acrt_add_locale_ref(__crt_locale_data *)
__crt_multibyte_data __acrt_initial_multibyte_data
#define _GLOBAL_LOCALE_BIT
BOOL WINAPI __acrt_IsValidLocaleName(_In_ LPCWSTR locale_name)
#define _VALIDATE_RETURN(expr, errorcode, retexpr)
_In_ size_t const _In_ int _In_ bool const _In_ unsigned const _In_ __acrt_rounding_mode const _Inout_ __crt_cached_ptd_host & ptd
__acrt_lock(__acrt_heap_lock)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
void __declspec(noinline) __cdecl _free_base(void *const block)
BOOL __cdecl __acrt_get_qualified_locale(const __crt_locale_strings *, UINT *, __crt_locale_strings *)
BOOL __cdecl __acrt_get_qualified_locale_downlevel(const __crt_locale_strings *lpInStr, UINT *lpOutCodePage, __crt_locale_strings *lpOutStr)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define _DISABLE_PER_THREAD_LOCALE
#define _ENABLE_PER_THREAD_LOCALE
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
__forceinline int __CRTDECL __ascii_towlower(int const _C)
#define __ascii_isalpha(c)
#define __ascii_isdigit(c)
int __cdecl __acrt_locale_initialize_ctype(__crt_locale_data *ploci)
int __cdecl __acrt_locale_initialize_monetary(__crt_locale_data *ploci)
int __cdecl __acrt_locale_initialize_numeric(__crt_locale_data *ploci)
int __cdecl __acrt_locale_initialize_time(__crt_locale_data *const locale_data)
#define _VALIDATE_RETURN_NOEXC(expr, errorcode, retexpr)
static substr_t substr(const WCHAR *str, size_t len)
long __cdecl _InterlockedExchange(_Interlocked_operand_ long volatile *_Target, long _Value)
#define wcscpy_s(d, l, s)
#define wcsncpy_s(d, l, s, n)
static DWORD DWORD void LPSTR DWORD cch
static size_t numberOfElements
struct section sections[2]
__crt_state_management::dual_state_global< __crt_locale_data * > __acrt_current_locale_data
#define _Out_writes_z_(s)
#define _Inout_updates_z_(s)
#define LOCALE_NAME_MAX_LENGTH
_Check_return_ _CRTIMP _CONST_RETURN wchar_t *__cdecl wcspbrk(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_Control)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP int __cdecl wcsncmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
_Check_return_ _CRTIMP size_t __cdecl wcscspn(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_Control)
size_t __cdecl wcsnlen(wchar_t const *const string, size_t const maximum_count)
__crt_qualified_locale_data _setloc_data
unsigned int _locale_lc_codepage
__crt_locale_data_public _public
unsigned int lc_collate_cp
__crt_locale_refcount lc_category[6]
wchar_t _cachein[MAX_LC_LEN]
wchar_t _cacheout[MAX_LC_LEN]
wchar_t _cacheLocaleName[LOCALE_NAME_MAX_LENGTH]
_bcp47_section_delimiter delimiter
INT CDECL wcscat_s(wchar_t *dst, size_t elem, const wchar_t *src)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
#define LOCALE_IDEFAULTANSICODEPAGE
int __cdecl _setmbcp_nolock(int, __crt_multibyte_data *)
__crt_locale_data *__cdecl _updatetlocinfoEx_nolock(__crt_locale_data **, __crt_locale_data *)
void _wcscats(_Inout_updates_z_(_Param_(2)) wchar_t *, size_t, int,...)
static wchar_t *__cdecl _wsetlocale_get_all(__crt_locale_data *)
static bool string_is_alpha(wchar_t const *const str, size_t const len)
static bool parse_bcp47_language(__crt_locale_strings *const names, _bcp47_section const §ion)
static bool parse_bcp47_script(__crt_locale_strings *const names, _bcp47_section const §ion)
void __cdecl __acrt_free_locale(__crt_locale_data *)
const unsigned short _wctype[]
static __crt_locale_data *__cdecl _updatetlocinfo_nolock(void)
static void __cdecl _copytlocinfo_nolock(__crt_locale_data *ptlocid, __crt_locale_data *ptlocis)
static bool parse_bcp47_code_page(__crt_locale_strings *const names, _bcp47_section const §ion)
static bool parse_bcp47_region(__crt_locale_strings *const names, _bcp47_section const §ion)
LPWSTR __cdecl __acrt_copy_locale_name(LPCWSTR localeName)
_In_ size_t _In_ size_t localeNameSizeInChars
static const char _first_127char[]
const __lc_category[LC_MAX-LC_MIN+1]
_locale_t __cdecl _get_current_locale(void)
wchar_t *__cdecl _wsetlocale(int _category, const wchar_t *_wlocale)
static __inline void sync_legacy_variables_lk()
void __cdecl __acrt_set_locale_changed()
static wchar_t *__cdecl _wsetlocale_nolock(__crt_locale_data *, int, const wchar_t *)
__crt_locale_data __acrt_initial_locale_data
static bool string_is_digit(wchar_t const *const str, size_t const len)
_locale_t __cdecl _create_locale(int _category, const char *_locale)
static wchar_t *__cdecl _wsetlocale_set_cat(__crt_locale_data *, int, const wchar_t *)
static int __cdecl no_op_initialize(__crt_locale_data *)
static _bcp47_section_delimiter categorize_delimiter(wchar_t const wc)
int __lc_wcstolc(__crt_locale_strings *, const wchar_t *)
void __cdecl __acrt_uninitialize_locale()
long __acrt_locale_changed_data
static int get_default_code_page(wchar_t const *const valid_windows_locale_name)
_In_ size_t _In_ size_t _Out_ UINT & cp
static const unsigned short * _ctype_loc_style
int __cdecl _configthreadlocale(int i)
void __cdecl _free_locale(_locale_t plocinfo)
_locale_t __cdecl _wcreate_locale(int _category, const wchar_t *locale)
static bool parse_bcp47(__crt_locale_strings *const names, const wchar_t *const expr)
wchar_t * _expandlocale(wchar_t const *const expr, wchar_t *const output, size_t const sizeInChars, wchar_t *const localeNameOutput, size_t const localeNameSizeInChars, UINT &output_code_page)
void __lc_lctowcs(_Inout_updates_z_(_Param_(2)) wchar_t *, size_t, const __crt_locale_strings *)