1 #define WIN32_NO_STATUS
3 #include <ndk/umtypes.h>
4 #include <ndk/rtlfuncs.h>
7 WCHAR NTAPI
RtlAnsiCharToUnicodeChar(IN OUT PUCHAR
*AnsiChar
);
14 int mbtowc (wchar_t *wchar
, const char *mbchar
, size_t count
)
16 UCHAR mbarr
[MB_CUR_MAX
] = { 0 };
26 memcpy(mbarr
, mbchar
, min(count
, sizeof mbarr
));
28 wc
= RtlAnsiCharToUnicodeChar(&mbs
);
30 if (wc
== L
' ' && mbarr
[0] != ' ')
35 return (int)(mbs
- mbarr
);
41 size_t mbstowcs (wchar_t *wcstr
, const char *mbstr
, size_t count
)
47 Length
= (ULONG
)strlen (mbstr
);
51 RtlMultiByteToUnicodeSize (&Size
,
58 Status
= RtlMultiByteToUnicodeN (wcstr
,
59 (ULONG
)count
* sizeof(WCHAR
),
63 if (!NT_SUCCESS(Status
))