From 0e78645878fb98861eeec67e72c383e12d7ea35c Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 7 Nov 2016 21:45:50 -0500 Subject: unicode interfaces: always set addr_failed, leftover_bytes, and leftover_count. --- src/unicode/ntapi_uc_unicode_conversion_from_utf8.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/unicode/ntapi_uc_unicode_conversion_from_utf8.c') diff --git a/src/unicode/ntapi_uc_unicode_conversion_from_utf8.c b/src/unicode/ntapi_uc_unicode_conversion_from_utf8.c index 48eacb2..9543b71 100644 --- a/src/unicode/ntapi_uc_unicode_conversion_from_utf8.c +++ b/src/unicode/ntapi_uc_unicode_conversion_from_utf8.c @@ -273,7 +273,15 @@ int32_t __stdcall __ntapi_uc_convert_unicode_stream_utf8_to_utf16( switch (status) { case NT_STATUS_SUCCESS: + params->addr_failed = 0; + params->leftover_bytes = 0; + params->leftover_count = 0; + return status; + case NT_STATUS_BUFFER_TOO_SMALL: + params->addr_failed = args.src; + params->leftover_bytes = 0; + params->leftover_count = 0; return status; default: -- cgit v1.2.3