mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:12:57 +00:00
- Create another branch for networking fixes
- TSVN choked repeatedly when attempting to merge ~9000 revs into the branch (tried 3 times on 2 different computers) - If someone wants to delete aicom-network-fixes, they are welcome to - Lesson learned: Letting a branch get thousands of revs out of date is a horrible idea svn path=/branches/aicom-network-branch/; revision=44353
This commit is contained in:
parent
6bc24c2625
commit
29fa274d6d
19364 changed files with 0 additions and 964402 deletions
59
lib/sdk/crt/string/wcstombs_nt.c
Normal file
59
lib/sdk/crt/string/wcstombs_nt.c
Normal file
|
@ -0,0 +1,59 @@
|
|||
#define WIN32_NO_STATUS
|
||||
#include <windows.h>
|
||||
#include <ndk/umtypes.h>
|
||||
#include <ndk/rtlfuncs.h>
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
int wctomb (char *mbchar, wchar_t wchar)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
ULONG Size;
|
||||
|
||||
if (mbchar == NULL)
|
||||
return 0;
|
||||
|
||||
Status = RtlUnicodeToMultiByteN (mbchar,
|
||||
1,
|
||||
&Size,
|
||||
&wchar,
|
||||
sizeof(WCHAR));
|
||||
if (!NT_SUCCESS(Status))
|
||||
return -1;
|
||||
|
||||
return (int)Size;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
size_t wcstombs (char *mbstr, const wchar_t *wcstr, size_t count)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
ULONG Size;
|
||||
ULONG Length;
|
||||
|
||||
Length = wcslen (wcstr);
|
||||
|
||||
if (mbstr == NULL)
|
||||
{
|
||||
RtlUnicodeToMultiByteSize (&Size,
|
||||
(wchar_t*)((size_t)wcstr),
|
||||
Length * sizeof(WCHAR));
|
||||
|
||||
return (size_t)Size;
|
||||
}
|
||||
|
||||
Status = RtlUnicodeToMultiByteN (mbstr,
|
||||
count,
|
||||
&Size,
|
||||
(wchar_t*)((size_t)wcstr),
|
||||
Length * sizeof(WCHAR));
|
||||
if (!NT_SUCCESS(Status))
|
||||
return -1;
|
||||
|
||||
return (size_t)Size;
|
||||
}
|
||||
|
||||
/* EOF */
|
Loading…
Add table
Add a link
Reference in a new issue