22#define _CHINESE_SIMP_CP 936
23#define _KOREAN_WANGSUNG_CP 949
24#define _CHINESE_TRAD_CP 950
25#define _KOREAN_JOHAB_CP 1361
49 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
50 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
51 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
52 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
53 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
54 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
55 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
56 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00,
57 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
58 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
59 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00
62 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
63 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
64 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
65 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
66 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
67 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
68 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73,
69 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00,
70 0x00, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b,
71 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
72 0x58, 0x59, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00
77#define _MBCTYPE_DEFAULT \
79 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
80 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
81 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
82 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
83 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
84 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, \
85 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, \
86 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, \
87 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, \
88 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, \
89 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00 \
96 #ifdef _CRT_GLOBAL_STATE_ISOLATION
101#define _MBCASEMAP_DEFAULT \
103 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
104 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
105 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
106 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
107 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
108 0x00, 0x00, 0x00, 0x00, 0x00, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, \
109 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, 0x71, 0x72, 0x73, \
110 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x00, 0x00, 0x00, 0x00, 0x00, \
111 0x00, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, \
112 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, \
113 0x58, 0x59, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00 \
116static unsigned char _mbcasemaps[__crt_state_management::state_index_count][256] =
119 #ifdef _CRT_GLOBAL_STATE_ISOLATION
125__crt_state_management::dual_state_global<unsigned char*>
_mbctype;
128__crt_state_management::dual_state_global<unsigned char*>
_mbcasemap;
149 { 0xA6, 0xDF, 0, 0, 0, 0, 0, 0, },
150 { 0xA1, 0xA5, 0, 0, 0, 0, 0, 0, },
151 { 0x81, 0x9F, 0xE0, 0xFC, 0, 0, 0, 0, },
152 { 0x40, 0x7E, 0x80, 0xFC, 0, 0, 0, 0, },
164 { 0, 0, 0, 0, 0, 0, 0, 0, },
165 { 0, 0, 0, 0, 0, 0, 0, 0, },
166 { 0x81, 0xFE, 0, 0, 0, 0, 0, 0, },
167 { 0x40, 0xFE, 0, 0, 0, 0, 0, 0, },
179 { 0, 0, 0, 0, 0, 0, 0, 0, },
180 { 0, 0, 0, 0, 0, 0, 0, 0, },
181 { 0x81, 0xFE, 0, 0, 0, 0, 0, 0, },
182 { 0x41, 0xFE, 0, 0, 0, 0, 0, 0, },
194 { 0, 0, 0, 0, 0, 0, 0, 0, },
195 { 0, 0, 0, 0, 0, 0, 0, 0, },
196 { 0x81, 0xFE, 0, 0, 0, 0, 0, 0, },
197 { 0x40, 0x7E, 0xA1, 0xFE, 0, 0, 0, 0, },
209 { 0, 0, 0, 0, 0, 0, 0, 0, },
210 { 0, 0, 0, 0, 0, 0, 0, 0, },
211 { 0x81, 0xD3, 0xD8, 0xDE, 0xE0, 0xF9, 0, 0, },
212 { 0x31, 0x7E, 0x81, 0xFE, 0, 0, 0, 0, },
217#define JAPANSE_DEFAULT_LOCALE_NAME_INDEX 0
218#define CHINESE_SIMPLIFIED_LOCALE_NAME_INDEX 1
219#define KOREAN_DEFAULT_LOCALE_NAME_INDEX 2
220#define CHINESE_TRADITIONAL_LOCALE_NAME_INDEX 3
280 for (
i = 0 ;
i < 257 ;
i++ )
283 for (
i = 0 ;
i < 256 ;
i++ )
312 if (__acrt_should_sync_with_global_locale(
ptd) ||
ptd->_locale_info ==
nullptr)
317 ptmbci =
ptd->_multibyte_info;
318 if (ptmbci != *current_multibyte_data)
324 if (ptmbci !=
nullptr &&
338 ptmbci =
ptd->_multibyte_info = *current_multibyte_data;
350 ptmbci =
ptd->_multibyte_info;
395 int const requested_codepage,
396 bool const is_for_crt_initialization,
402 int const system_codepage =
getSystemCP(requested_codepage);
405 if (system_codepage ==
ptd->_multibyte_info->mbcodepage)
420 *mb_data.get() = *
ptd->_multibyte_info;
421 mb_data.get()->refcount = 0;
425 int const setmbcp_status =
_setmbcp_nolock(system_codepage, mb_data.get());
426 if (setmbcp_status == -1)
435 if (!is_for_crt_initialization)
447 mb_data.get()->refcount = 1;
448 ptd->_multibyte_info = mb_data.detach();
451 if (!__acrt_should_sync_with_global_locale(
ptd))
453 return setmbcp_status;
468 *current_multibyte_data =
ptd->_multibyte_info;
472 if (is_for_crt_initialization)
477 return setmbcp_status;
481#ifdef _UCRT_ENCLAVE_BUILD
557 _LocaleUpdate _loc_update(
plocinfo);
575 return _loc_update.GetLocaleT()->locinfo->_public._locale_lc_codepage;
605 UCHAR lowVector[256];
617 for (ich = 0; ich < 256; ich++)
618 sbVector[ich] = (
UCHAR) ich;
621 sbVector[0] = (
UCHAR)
' ';
622 for (pbPair = &cpInfo.
LeadByte[0]; *pbPair; pbPair += 2)
624 for (ich = *pbPair; ich <= *(pbPair + 1) && ich < 256; ich++)
625 sbVector[ich] = (
UCHAR)
' ';
645 for (ich = 0; ich < 256; ich++)
647 if (wVector[ich] &
_UPPER)
653 else if (wVector[ich] &
_LOWER)
667 for (ich = 0; ich < 256; ich++)
669 if (ich >= (
UINT)
'A' && ich <= (
UINT)
'Z')
673 ptmbci->
mbcasemap[ich] =
static_cast<unsigned char>(ich + (
'a' -
'A'));
675 else if (ich >= (
UINT)
'a' && ich <= (
UINT)
'z')
679 ptmbci->
mbcasemap[ich] =
static_cast<unsigned char>(ich - (
'a' -
'A'));
697 unsigned char *rgptr;
726 rgptr[0] && rgptr[1];
730 for (ich = rgptr[0]; ich <= rgptr[1] && ich < 256; ich++)
808 for (lbptr = cpInfo.
LeadByte; *lbptr && *(lbptr + 1); lbptr += 2)
810 for (ich = *lbptr; ich <= *(lbptr + 1); ich++)
815 for (ich = 0x01; ich < 0xFF; ich++)
873 _LocaleUpdate _loc_update(
plocinfo);
874 if ( _loc_update.GetLocaleT()->mbcinfo->ismbcodepage )
875 return _loc_update.GetLocaleT()->mbcinfo->mbcodepage;
918 for (
size_t i = 0;
i != __crt_state_management::state_index_count; ++
i)
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 __cdecl __acrt_LCMapStringA(_locale_t const plocinfo, PCWSTR const LocaleName, DWORD const dwMapFlags, PCCH const lpSrcStr, int const cchSrc, PCH const lpDestStr, int const cchDest, int const code_page, BOOL const bError)
#define InterlockedIncrement
#define InterlockedDecrement
__acrt_ptd *__cdecl __acrt_getptd(void)
__crt_locale_pointers __acrt_initial_locale_pointers
void __cdecl __acrt_unlock(_In_ __acrt_lock_id lock)
__acrt_ptd *__cdecl __acrt_getptd_head(void)
@ __acrt_multibyte_cp_lock
#define _CRT_LINKER_FORCE_INCLUDE(name)
_Out_opt_ UINT * code_page
void __cdecl __acrt_set_locale_changed(void)
_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)
BOOL WINAPI IsValidCodePage(UINT codepage)
BOOL WINAPI GetCPInfo(UINT codepage, LPCPINFO cpinfo)
UINT WINAPI GetOEMCP(void)
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
int __cdecl _setmbcp_nolock(int, __crt_multibyte_data *)
#define _MBCASEMAP_DEFAULT
__crt_state_management::dual_state_global< unsigned char * > _mbcasemap
static const wchar_t * CPtoLocaleName(int codepage)
static void setSBCS(__crt_multibyte_data *ptmbci)
#define CHINESE_SIMPLIFIED_LOCALE_NAME_INDEX
#define KOREAN_DEFAULT_LOCALE_NAME_INDEX
static int getSystemCP(int)
static unsigned char _mbctypes[__crt_state_management::state_index_count][NUM_CHARS]
static void setSBUpLow(__crt_multibyte_data *ptmbci)
__crt_multibyte_data *__cdecl __acrt_update_thread_multibyte_data()
#define JAPANSE_DEFAULT_LOCALE_NAME_INDEX
static __crt_multibyte_data *__cdecl update_thread_multibyte_data_internal(__acrt_ptd *const ptd, __crt_multibyte_data **const current_multibyte_data)
__crt_state_management::dual_state_global< __crt_multibyte_data * > __acrt_current_multibyte_data
bool __cdecl __acrt_initialize_multibyte()
static code_page_info __rgcode_page_info[]
#define CHINESE_TRADITIONAL_LOCALE_NAME_INDEX
const wchar_t *const _mb_locale_names[]
__crt_state_management::dual_state_global< unsigned char * > _mbctype
static unsigned char _mbcasemaps[__crt_state_management::state_index_count][256]
#define _KOREAN_WANGSUNG_CP
__crt_multibyte_data __acrt_initial_multibyte_data
int __cdecl _setmbcp(int const codepage)
static char __rgctypeflag[NUM_CTYPES]
unsigned char *__cdecl __p__mbcasemap()
unsigned char *__cdecl __p__mbctype()
static int __cdecl setmbcp_internal(int const requested_codepage, bool const is_for_crt_initialization, __acrt_ptd *const ptd, __crt_multibyte_data **const current_multibyte_data)
int CDECL memcpy_s(void *dest, size_t numberOfElements, const void *src, size_t count)
struct __crt_multibyte_data * mbcinfo
unsigned short mbulinfo[6]
unsigned char mbcasemap[256]
unsigned char mbctype[257]
wchar_t const * mblocalename
BYTE LeadByte[MAX_LEADBYTES]
unsigned short mbulinfo[NUM_ULINFO]
unsigned char rgrange[NUM_CTYPES][MAX_RANGES]