Blame src/string/ntapi_tt_init_unicode_string_from_utf16.c

dd89bb
/********************************************************/
dd89bb
/*  ntapi: Native API core library                      */
dde53a
/*  Copyright (C) 2013--2017  Z. Gilboa                 */
dd89bb
/*  Released under GPLv2 and GPLv3; see COPYING.NTAPI.  */
dd89bb
/********************************************************/
dd89bb
dd89bb
#include <psxtypes/psxtypes.h>
dd89bb
#include <pemagine/pemagine.h>
dd89bb
#include <ntapi/nt_object.h>
dd89bb
#include <ntapi/ntapi.h>
dd89bb
#include "ntapi_impl.h"
dd89bb
dd89bb
void __ntapi_tt_init_unicode_string_from_utf16(
dd89bb
    __out 	nt_unicode_string *	str_dest,
dd89bb
    __in	wchar16_t *		str_src)
dd89bb
{
dd89bb
	if ((intptr_t)str_src) {
dd89bb
		str_dest->strlen = (uint16_t)__ntapi->tt_string_null_offset_short((const int16_t *)str_src);
dd89bb
		str_dest->maxlen = str_dest->strlen + sizeof(uint16_t);
dd89bb
		str_dest->buffer = (uint16_t *)str_src;
dd89bb
	} else {
dd89bb
		str_dest->strlen = 0;
dd89bb
		str_dest->maxlen = 0;
dd89bb
		str_dest->buffer = (uint16_t *)0;
dd89bb
	}
dd89bb
}