ReactOS 0.4.16-dev-1025-gd3456f5
LCMapStringW.cpp File Reference
#include <corecrt_internal.h>
Include dependency graph for LCMapStringW.cpp:

Go to the source code of this file.

Functions

int __cdecl __acrt_LCMapStringW (LPCWSTR const locale_name, DWORD const map_flags, LPCWSTR const source, int source_count, LPWSTR const destination, int const destination_count)
 

Function Documentation

◆ __acrt_LCMapStringW()

int __cdecl __acrt_LCMapStringW ( LPCWSTR const  locale_name,
DWORD const  map_flags,
LPCWSTR const  source,
int  source_count,
LPWSTR const  destination,
int const  destination_count 
)

Definition at line 45 of file LCMapStringW.cpp.

53{
54 // LCMapString will map past the null terminator. We must find the null
55 // terminator if it occurs in the string before source_count characters
56 // and cap the number of characters to be considered.
57 if (source_count > 0)
58 {
59 int const source_length = static_cast<int>(wcsnlen(source, source_count));
60
61 // Include the null terminator if the source string is terminated within
62 // the buffer.
63 if (source_length < source_count)
64 {
65 source_count = source_length + 1;
66 }
67 else
68 {
69 source_count = source_length;
70 }
71 }
72
73 return __acrt_LCMapStringEx(locale_name, map_flags, source, source_count, destination, destination_count, nullptr, nullptr, 0);
74}
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)
size_t const source_count
Definition: read.cpp:240
size_t __cdecl wcsnlen(wchar_t const *const string, size_t const maximum_count)
Definition: strnlen.cpp:210
size_t const destination_count
Definition: wcrtomb.cpp:52

Referenced by _towlower_l(), _towupper_l(), _wcslwr_s_l_stat(), _wcsupr_s_l_stat(), and _wcsxfrm_l().