14static
int __cdecl InternalGetLocaleInfoA(
22 _LocaleUpdate locale_update(
locale);
24 int const code_page = locale_update.GetLocaleT()->locinfo->_public._locale_lc_codepage;
76 void*
const void_result
79 *
static_cast<void**
>(void_result) =
nullptr;
83 char**
const char_result =
static_cast<char**
>(void_result);
85 int const local_buffer_size = 128;
86 char local_buffer[local_buffer_size];
88 int const local_length = InternalGetLocaleInfoA(
91 if (local_length != 0)
93 *char_result = _calloc_crt_t(
char, local_length).detach();
94 if (*char_result ==
nullptr)
106 int const required_length = InternalGetLocaleInfoA(
109 if (required_length == 0)
112 __crt_unique_heap_ptr<char> dynamic_buffer(_calloc_crt_t(
char, required_length));
113 if (dynamic_buffer.get() ==
nullptr)
116 int const actual_length = InternalGetLocaleInfoA(
119 if (actual_length == 0)
122 *char_result = dynamic_buffer.detach();
127 wchar_t**
const wchar_result =
static_cast<wchar_t**
>(void_result);
130 if (required_length == 0)
133 __crt_unique_heap_ptr<wchar_t> dynamic_buffer(_calloc_crt_t(
wchar_t, required_length));
134 if (dynamic_buffer.get() ==
nullptr)
140 if (actual_length == 0)
143 *wchar_result = dynamic_buffer.detach();
148 unsigned char*
const uchar_result =
static_cast<unsigned char*
>(void_result);
154 reinterpret_cast<wchar_t*
>(&
value),
155 sizeof(
value) /
sizeof(
wchar_t));
157 if (actual_length == 0)
160 *uchar_result =
static_cast<unsigned char>(
value);
int __cdecl __acrt_GetLocaleInfoA(_locale_t const locale, int const lc_type, wchar_t const *const locale_name, LCTYPE const locale_type, void *const void_result)
PCWSTR const LCTYPE const int const result_size
return __acrt_WideCharToMultiByte(code_page, 0, buffer.get(), -1, result_size !=0 ? result :nullptr, result_size, nullptr, nullptr)
PCWSTR const LCTYPE const locale_type
int WINAPI __acrt_GetLocaleInfoEx(_In_opt_ LPCWSTR locale_name, _In_ LCTYPE lc_type, _Out_writes_opt_(data_count) LPWSTR data, _In_ int data_count)
#define ERROR_INSUFFICIENT_BUFFER
#define _Out_writes_z_(s)
DWORD WINAPI GetLastError(void)