ReactOS 0.4.15-dev-7953-g1f49173
wcstombs_nt.c File Reference
#include <ndk/umtypes.h>
#include <ndk/rtlfuncs.h>
Include dependency graph for wcstombs_nt.c:

Go to the source code of this file.

Functions

int wctomb (char *mbchar, wchar_t wchar)
 
size_t wcstombs (char *mbstr, const wchar_t *wcstr, size_t count)
 

Function Documentation

◆ wcstombs()

size_t wcstombs ( char mbstr,
const wchar_t wcstr,
size_t  count 
)

Definition at line 29 of file wcstombs_nt.c.

30{
32 ULONG Size;
34
35 Length = (ULONG)wcslen (wcstr);
36
37 if (mbstr == NULL)
38 {
40 (wchar_t*)((size_t)wcstr),
41 Length * sizeof(WCHAR));
42
43 return (size_t)(Size / sizeof(char));
44 }
45
47 (ULONG)count,
48 &Size,
49 (wchar_t*)((size_t)wcstr),
50 Length * sizeof(WCHAR));
51 if (!NT_SUCCESS(Status))
52 return -1;
53
54 return (size_t)(Size / sizeof(char));
55}
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
unsigned char
Definition: typeof.h:29
Status
Definition: gdiplustypes.h:25
GLuint GLuint GLsizei count
Definition: gl.h:1545
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_Use_decl_annotations_ NTSTATUS NTAPI RtlUnicodeToMultiByteN(_Out_ PCHAR MbString, _In_ ULONG MbSize, _Out_opt_ PULONG ResultSize, _In_ PCWCH UnicodeString, _In_ ULONG UnicodeSize)
Definition: nlsboot.c:107
_Use_decl_annotations_ NTSTATUS NTAPI RtlUnicodeToMultiByteSize(_Out_ PULONG MbSize, _In_ PCWCH UnicodeString, _In_ ULONG UnicodeSize)
Definition: nlsboot.c:145
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ wctomb()

int wctomb ( char mbchar,
wchar_t  wchar 
)

Definition at line 7 of file wcstombs_nt.c.

8{
10 ULONG Size;
11
12 if (mbchar == NULL)
13 return 0;
14
16 1,
17 &Size,
18 &wchar,
19 sizeof(WCHAR));
20 if (!NT_SUCCESS(Status))
21 return -1;
22
23 return (int)Size;
24}