ReactOS  0.4.14-dev-315-gbb6fece
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;
33  ULONG Length;
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 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
NTSYSAPI NTSTATUS NTAPI RtlUnicodeToMultiByteSize(PULONG MbSize, PCWCH UnicodeString, ULONG UnicodeSize)
LONG NTSTATUS
Definition: precomp.h:26
smooth NULL
Definition: ftsmooth.c:416
unsigned char
Definition: typeof.h:29
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
NTSYSAPI NTSTATUS NTAPI RtlUnicodeToMultiByteN(PCHAR MbString, ULONG MbSize, PULONG ResultSize, PCWCH UnicodeString, ULONG UnicodeSize)
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
Status
Definition: gdiplustypes.h:24
unsigned int ULONG
Definition: retypes.h:1
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)

◆ 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 }
LONG NTSTATUS
Definition: precomp.h:26
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSYSAPI NTSTATUS NTAPI RtlUnicodeToMultiByteN(PCHAR MbString, ULONG MbSize, PULONG ResultSize, PCWCH UnicodeString, ULONG UnicodeSize)
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
Status
Definition: gdiplustypes.h:24
unsigned int ULONG
Definition: retypes.h:1

Referenced by streamout_wstring().