diff options
author | midipix <writeonce@midipix.org> | 2015-07-27 04:01:18 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2015-07-27 04:01:18 -0400 |
commit | dd89bb8ad4fe184a34b5dbdda237e640fc82121b (patch) | |
tree | 5e80d2da35f5892f92be29f57982b2708e6bd99b /src/string/ntapi_tt_init_unicode_string_from_utf16.c | |
parent | dcdadc2702712fa750ed255ed1dfa354522797a0 (diff) | |
download | ntapi-dd89bb8ad4fe184a34b5dbdda237e640fc82121b.tar.bz2 ntapi-dd89bb8ad4fe184a34b5dbdda237e640fc82121b.tar.xz |
entered advanced internal development stage.
Diffstat (limited to 'src/string/ntapi_tt_init_unicode_string_from_utf16.c')
-rw-r--r-- | src/string/ntapi_tt_init_unicode_string_from_utf16.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/string/ntapi_tt_init_unicode_string_from_utf16.c b/src/string/ntapi_tt_init_unicode_string_from_utf16.c new file mode 100644 index 0000000..96673b4 --- /dev/null +++ b/src/string/ntapi_tt_init_unicode_string_from_utf16.c @@ -0,0 +1,26 @@ +/********************************************************/ +/* ntapi: Native API core library */ +/* Copyright (C) 2013,2014,2015 Z. Gilboa */ +/* Released under GPLv2 and GPLv3; see COPYING.NTAPI. */ +/********************************************************/ + +#include <psxtypes/psxtypes.h> +#include <pemagine/pemagine.h> +#include <ntapi/nt_object.h> +#include <ntapi/ntapi.h> +#include "ntapi_impl.h" + +void __ntapi_tt_init_unicode_string_from_utf16( + __out nt_unicode_string * str_dest, + __in wchar16_t * str_src) +{ + if ((intptr_t)str_src) { + str_dest->strlen = (uint16_t)__ntapi->tt_string_null_offset_short((const int16_t *)str_src); + str_dest->maxlen = str_dest->strlen + sizeof(uint16_t); + str_dest->buffer = (uint16_t *)str_src; + } else { + str_dest->strlen = 0; + str_dest->maxlen = 0; + str_dest->buffer = (uint16_t *)0; + } +}
\ No newline at end of file |