16a53462926c78d388471c3a7ecada12e4bf164f
1 #include <ndk/umtypes.h>
2 #include <ndk/rtlfuncs.h>
5 WCHAR NTAPI
RtlAnsiCharToUnicodeChar(IN OUT PUCHAR
*AnsiChar
);
12 int mbtowc (wchar_t *wchar
, const char *mbchar
, size_t count
)
14 UCHAR mbarr
[MB_CUR_MAX
] = { 0 };
24 memcpy(mbarr
, mbchar
, min(count
, sizeof mbarr
));
26 wc
= RtlAnsiCharToUnicodeChar(&mbs
);
28 if (wc
== L
' ' && mbarr
[0] != ' ')
33 return (int)(mbs
- mbarr
);
39 size_t mbstowcs (wchar_t *wcstr
, const char *mbstr
, size_t count
)
45 Length
= (ULONG
)strlen (mbstr
);
49 RtlMultiByteToUnicodeSize (&Size
,
56 Status
= RtlMultiByteToUnicodeN (wcstr
,
57 (ULONG
)count
* sizeof(WCHAR
),
61 if (!NT_SUCCESS(Status
))