ReactOS
0.4.16-dev-814-g656a5dc
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
m
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
mbccpy_s_l.cpp
Go to the documentation of this file.
1
/***
2
*mbccpy_s_l.c - Copy one character to another (MBCS)
3
*
4
* Copyright (c) Microsoft Corporation. All rights reserved.
5
*
6
*Purpose:
7
* Copy one MBCS character to another (1 or 2 bytes)
8
*
9
*******************************************************************************/
10
11
#include <
corecrt_internal_mbstring.h
>
12
#include <
corecrt_internal_securecrt.h
>
13
#include <locale.h>
14
15
#pragma warning(disable:__WARNING_POTENTIAL_BUFFER_OVERFLOW_NULLTERMINATED)
// 26018
16
17
errno_t
__cdecl
_mbccpy_s_l
(
unsigned
char
*_Dst,
size_t
_SizeInBytes
,
int
*_PCopied,
const
unsigned
char
*_Src,
_LOCALE_ARG_DECL
)
18
{
19
/* validation section */
20
_ASSIGN_IF_NOT_NULL
(_PCopied, 0);
21
_VALIDATE_STRING
(_Dst,
_SizeInBytes
);
22
if
(_Src ==
nullptr
)
23
{
24
*_Dst =
'\0'
;
25
_RETURN_EINVAL
;
26
}
27
28
_LOCALE_UPDATE
;
29
30
/* copy */
31
if
(
_ISMBBLEAD
(*_Src))
32
{
33
if
(_Src[1] ==
'\0'
)
34
{
35
/* the source string contained a lead byte followed by the null terminator:
36
we copy only the null terminator and return EILSEQ to indicate the
37
malformed char */
38
*_Dst =
'\0'
;
39
_ASSIGN_IF_NOT_NULL
(_PCopied, 1);
40
_RETURN_MBCS_ERROR
;
41
}
42
if
(
_SizeInBytes
< 2)
43
{
44
*_Dst =
'\0'
;
45
_RETURN_BUFFER_TOO_SMALL
(_Dst,
_SizeInBytes
);
46
}
47
*_Dst++ = *_Src++;
48
*_Dst = *_Src;
49
_ASSIGN_IF_NOT_NULL
(_PCopied, 2);
50
}
51
else
52
{
53
*_Dst = *_Src;
54
_ASSIGN_IF_NOT_NULL
(_PCopied, 1);
55
}
56
57
_RETURN_NO_ERROR
;
58
}
__cdecl
#define __cdecl
Definition:
accygwin.h:79
corecrt_internal_mbstring.h
corecrt_internal_securecrt.h
_LOCALE_ARG_DECL
#define _LOCALE_ARG_DECL
Definition:
corecrt_internal_securecrt.h:97
_RETURN_EINVAL
#define _RETURN_EINVAL
Definition:
corecrt_internal_securecrt.h:73
_ASSIGN_IF_NOT_NULL
#define _ASSIGN_IF_NOT_NULL(_Pointer, _Value)
Definition:
corecrt_internal_securecrt.h:124
_RETURN_BUFFER_TOO_SMALL
#define _RETURN_BUFFER_TOO_SMALL(_String, _Size)
Definition:
corecrt_internal_securecrt.h:67
_RETURN_NO_ERROR
#define _RETURN_NO_ERROR
Definition:
corecrt_internal_securecrt.h:80
_LOCALE_UPDATE
#define _LOCALE_UPDATE
Definition:
corecrt_internal_securecrt.h:100
_RETURN_MBCS_ERROR
#define _RETURN_MBCS_ERROR
Definition:
corecrt_internal_securecrt.h:90
_ISMBBLEAD
#define _ISMBBLEAD(_Character)
Definition:
corecrt_internal_securecrt.h:103
_VALIDATE_STRING
#define _VALIDATE_STRING(_String, _Size)
Definition:
corecrt_internal_securecrt.h:36
_mbccpy_s_l
errno_t __cdecl _mbccpy_s_l(unsigned char *_Dst, size_t _SizeInBytes, int *_PCopied, const unsigned char *_Src, _LOCALE_ARG_DECL)
Definition:
mbccpy_s_l.cpp:17
_SizeInBytes
_In_ size_t _SizeInBytes
Definition:
time.h:146
errno_t
int errno_t
Definition:
corecrt.h:615
sdk
lib
ucrt
mbstring
mbccpy_s_l.cpp
Generated on Thu Mar 13 2025 06:14:46 for ReactOS by
1.9.6