ReactOS 0.4.16-dev-747-gbc52d5f
LCMapStringA.cpp File Reference
#include <corecrt_internal.h>
#include <locale.h>
Include dependency graph for LCMapStringA.cpp:

Go to the source code of this file.

Functions

static _Success_ (return !=0) int __cdecl __acrt_LCMapStringA_stat(_In_opt_ _locale_t plocinfo
 
static _In_ LPCWSTR _In_ DWORD _In_CRT_NLS_string_ (cchSrc) PCCH lpSrcStr
 
static _In_ LPCWSTR _In_ DWORD _In_ int _Out_writes_opt_ (cchDest) PCH lpDestStr
 
 if (0==code_page) code_page
 
__crt_scoped_stack_ptr< wchar_t > const inwbuffer (_malloca_crt_t(wchar_t, inbuff_size))
 
 if (!inwbuffer) return 0
 
 if (dwMapFlags &LCMAP_SORTKEY)
 
__crt_scoped_stack_ptr< wchar_t > const outwbuffer (_malloca_crt_t(wchar_t, outbuff_size))
 
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)
 

Variables

static _In_ LPCWSTR LocaleName
 
static _In_ LPCWSTR _In_ DWORD dwMapFlags
 
static _In_ LPCWSTR _In_ DWORD _In_ int cchSrc
 
static _In_ LPCWSTR _In_ DWORD _In_ int _In_ int cchDest
 
static _In_ LPCWSTR _In_ DWORD _In_ int _In_ int _In_ int code_page
 
static _In_ LPCWSTR _In_ DWORD _In_ int _In_ int _In_ int _In_ BOOL bError
 
int inbuff_size
 
int outbuff_size
 
 else
 
return retval
 

Function Documentation

◆ __acrt_LCMapStringA()

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 
)

Definition at line 210 of file LCMapStringA.cpp.

221{
222 _LocaleUpdate _loc_update(plocinfo);
223
224 return __acrt_LCMapStringA_stat(
225 _loc_update.GetLocaleT(),
228 lpSrcStr,
229 cchSrc,
230 lpDestStr,
231 cchDest,
232 code_page,
233 bError
234 );
235}
static _In_ LPCWSTR LocaleName
static _In_ LPCWSTR _In_ DWORD _In_ int _In_ int _In_ int _In_ BOOL bError
static _In_ LPCWSTR _In_ DWORD dwMapFlags
static _In_ LPCWSTR _In_ DWORD _In_ int _In_ int cchDest
static _In_ LPCWSTR _In_ DWORD _In_ int _In_ int _In_ int code_page
static _In_ LPCWSTR _In_ DWORD _In_ int cchSrc
_locale_t plocinfo
Definition: ismbbyte.cpp:75

Referenced by __acrt_locale_initialize_ctype(), _mbctolower_l(), _mbctoupper_l(), _mbsicmp_l(), _mbslwr_s_l(), _mbsupr_s_l(), _strlwr_s_l_stat(), _strupr_s_l_stat(), _strxfrm_l(), common_tox_win_lookup(), and setSBUpLow().

◆ _In_CRT_NLS_string_()

static _In_ LPCWSTR _In_ DWORD _In_CRT_NLS_string_ ( cchSrc  )

◆ _Out_writes_opt_()

static _In_ LPCWSTR _In_ DWORD _In_ int _Out_writes_opt_ ( cchDest  )

◆ _Success_()

static _Success_ ( return = 0)
static

◆ if() [1/3]

if ( inwbuffer)

Definition at line 2998 of file btrfs.c.

2998 {
2999 ERR("out of memory\n");
3001 }
#define ERR(fmt,...)
Definition: precomp.h:57
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158

◆ if() [2/3]

if ( = code_page)

Definition at line 179 of file LCMapStringA.cpp.

179 {
180 /* get size required */
181 if ( 0 == (retval =
183 0,
184 outwbuffer.get(),
186 nullptr,
187 0,
188 nullptr,
189 nullptr )) )
190 return retval;
191 }
return __acrt_WideCharToMultiByte(code_page, 0, buffer.get(), -1, result_size !=0 ? result :nullptr, result_size, nullptr, nullptr)
return retval
__crt_scoped_stack_ptr< wchar_t > const outwbuffer(_malloca_crt_t(wchar_t, outbuff_size))
int outbuff_size

◆ if() [3/3]

if ( dwMapFlags LCMAP_SORTKEY)

Definition at line 131 of file LCMapStringA.cpp.

131 {
132 /* retval is size in BYTES */
133
134 if (0 != cchDest) {
135
136 if (retval > cchDest)
137 return 0;
138
139 /* do string mapping */
140 // The buffer overflow warning here is due to an inadequate annotation
141 // on __acrt_LCMapStringEx. When the map flags include LCMAP_SORTKEY,
142 // the destination buffer is actually required to be an array of bytes,
143 // despite the type of the buffer being a wchar_t*.
147 inwbuffer.get(),
149 reinterpret_cast<PWCH>(lpDestStr),
150 cchDest,
151 nullptr,
152 nullptr,
153 0)) )
154 return retval;
155 }
156 }
__crt_scoped_stack_ptr< wchar_t > const inwbuffer(_malloca_crt_t(wchar_t, inbuff_size))
int inbuff_size
int WINAPI __acrt_LCMapStringEx(_In_opt_ LPCWSTR locale_name, _In_ DWORD flags, _In_CRT_NLS_string_(source_count) LPCWSTR source, _In_ int source_count, _Out_writes_opt_(destination_count) LPWSTR destination, _In_ int destination_count, _In_opt_ LPNLSVERSIONINFO version, _In_opt_ LPVOID reserved, _In_opt_ LPARAM sort_handle)
boolean suppress
Definition: jpeglib.h:1006
WCHAR * PWCH
Definition: ntbasedef.h:418
#define __pragma(x)
Definition: debug.h:260
#define warning(s)
Definition: debug.h:83
#define __WARNING_BUFFER_OVERFLOW
Definition: suppress.h:436

◆ inwbuffer()

__crt_scoped_stack_ptr< wchar_t > const inwbuffer ( _malloca_crt_t(wchar_t, inbuff_size )

Referenced by if().

◆ outwbuffer()

__crt_scoped_stack_ptr< wchar_t > const outwbuffer ( _malloca_crt_t(wchar_t, outbuff_size )

Referenced by if().

Variable Documentation

◆ bError

Initial value:
{
if (cchSrc > 0)
{
int cchSrcCnt = static_cast<int>(__strncnt(lpSrcStr, cchSrc));
if (cchSrcCnt < cchSrc)
{
cchSrc = cchSrcCnt + 1;
}
else
{
cchSrc = cchSrcCnt;
}
}
int retval = 0
_CRTIMP size_t __cdecl __strncnt(const char *_Str, size_t _Cnt)
Definition: strncnt.cpp:13

Definition at line 50 of file LCMapStringA.cpp.

Referenced by __acrt_LCMapStringA(), CallNamedPipeW(), QueryConfig2A(), QueryConfig2W(), Test_LockUnlockServiceDatabase(), Test_LockUnlockServiceDatabaseWithServiceStart(), Test_QueryLockStatusA(), and Test_QueryLockStatusW().

◆ cchDest

Definition at line 48 of file LCMapStringA.cpp.

Referenced by __acrt_LCMapStringA(), CViewStatePropertyBag::_GetRegKey(), _SHExpandEnvironmentStrings(), GetLocalisedText(), GetSystemVersionString(), if(), Imm32ReconvertAnsiFromWide(), Imm32ReconvertWideFromAnsi(), RtlpArrayVPrintfWorkerW(), RtlpStringVPrintfExWorkerW(), RtlpStringVPrintfWorkerW(), RtlStringCatExWorkerA(), RtlStringCatExWorkerW(), RtlStringCatNExWorkerA(), RtlStringCatNExWorkerW(), RtlStringCatNWorkerA(), RtlStringCatNWorkerW(), RtlStringCatWorkerA(), RtlStringCatWorkerW(), RtlStringCbCatExW(), RtlStringCbCatNExW(), RtlStringCbCatNW(), RtlStringCbCatW(), RtlStringCbCopyA(), RtlStringCbCopyExA(), RtlStringCbCopyExW(), RtlStringCbCopyNA(), RtlStringCbCopyNExW(), RtlStringCbCopyNW(), RtlStringCbCopyW(), RtlStringCbPrintfExA(), RtlStringCbPrintfExW(), RtlStringCbPrintfW(), RtlStringCbVPrintfExA(), RtlStringCbVPrintfExW(), RtlStringCbVPrintfW(), RtlStringCchCatA(), RtlStringCchCatExA(), RtlStringCchCatExW(), RtlStringCchCatNA(), RtlStringCchCatNExA(), RtlStringCchCatNExW(), RtlStringCchCatNW(), RtlStringCchCatW(), RtlStringCchCopyA(), RtlStringCchCopyExA(), RtlStringCchCopyExW(), RtlStringCchCopyNA(), RtlStringCchCopyNExA(), RtlStringCchCopyNExW(), RtlStringCchCopyNW(), RtlStringCchCopyW(), RtlStringCchPrintfA(), RtlStringCchPrintfExA(), RtlStringCchPrintfExW(), RtlStringCchPrintfW(), RtlStringCchVPrintfA(), RtlStringCchVPrintfExA(), RtlStringCchVPrintfExW(), RtlStringCchVPrintfW(), RtlStringCopyExWorkerA(), RtlStringCopyExWorkerW(), RtlStringCopyNExWorkerA(), RtlStringCopyNExWorkerW(), RtlStringCopyNWorkerA(), RtlStringCopyNWorkerW(), RtlStringCopyWorkerA(), RtlStringCopyWorkerW(), RtlStringVPrintfExWorkerA(), RtlStringVPrintfExWorkerW(), RtlStringVPrintfWorkerA(), RtlStringVPrintfWorkerW(), StringCatExWorkerA(), StringCatExWorkerW(), StringCatNExWorkerA(), StringCatNExWorkerW(), StringCatNWorkerA(), StringCatNWorkerW(), StringCatWorkerA(), StringCatWorkerW(), StringCbCatExW(), StringCbCatNExW(), StringCbCatNW(), StringCbCatW(), StringCbCopyExW(), StringCbCopyNExW(), StringCbCopyNW(), StringCbCopyW(), StringCbGetsA(), StringCbGetsExA(), StringCbGetsExW(), StringCbGetsW(), StringCbPrintfExA(), StringCbPrintfExW(), StringCbPrintfW(), StringCbVPrintfExA(), StringCbVPrintfExW(), StringCbVPrintfW(), StringCchCatA(), StringCchCatExA(), StringCchCatExW(), StringCchCatNA(), StringCchCatNExA(), StringCchCatNExW(), StringCchCatNW(), StringCchCatW(), StringCchCopyA(), StringCchCopyExA(), StringCchCopyExW(), StringCchCopyNA(), StringCchCopyNExA(), StringCchCopyNExW(), StringCchCopyNW(), StringCchCopyW(), StringCchGetsA(), StringCchGetsExA(), StringCchGetsExW(), StringCchGetsW(), StringCchPrintfA(), StringCchPrintfExA(), StringCchPrintfExW(), StringCchPrintfW(), StringCchVPrintfA(), StringCchVPrintfExA(), StringCchVPrintfExW(), StringCchVPrintfW(), StringCopyExWorkerA(), StringCopyExWorkerW(), StringCopyNExWorkerA(), StringCopyNExWorkerW(), StringCopyNWorkerA(), StringCopyNWorkerW(), StringCopyWorkerA(), StringCopyWorkerW(), StringGetsExWorkerA(), StringGetsExWorkerW(), StringVPrintfExWorkerA(), StringVPrintfExWorkerW(), StringVPrintfWorkerA(), StringVPrintfWorkerW(), UXTHEME_FormatLocalMsg(), and UXTHEME_FormatParseMessage().

◆ cchSrc

◆ code_page

Definition at line 49 of file LCMapStringA.cpp.

Referenced by __acrt_LCMapStringA(), and if().

◆ dwMapFlags

_In_ LPCWSTR _In_ DWORD dwMapFlags

Definition at line 44 of file LCMapStringA.cpp.

Referenced by __acrt_LCMapStringA(), and if().

◆ else

else
Initial value:

Definition at line 157 of file LCMapStringA.cpp.

◆ inbuff_size

int inbuff_size

Definition at line 73 of file LCMapStringA.cpp.

Referenced by if().

◆ LocaleName

◆ outbuff_size

int outbuff_size

Definition at line 74 of file LCMapStringA.cpp.

Referenced by if().

◆ retval

return retval

Definition at line 207 of file LCMapStringA.cpp.

Referenced by if().