From 7845d0d8d1aa9d2a3b981cc05d523451ad0628f8 Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 20 Jun 2016 12:10:12 -0400 Subject: __ntapi_uc_validate_unicode_stream_utf16(): preserve callback fn return value. --- src/unicode/ntapi_uc_unicode_validation.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/unicode') diff --git a/src/unicode/ntapi_uc_unicode_validation.c b/src/unicode/ntapi_uc_unicode_validation.c index 7241509..dbdf4e1 100644 --- a/src/unicode/ntapi_uc_unicode_validation.c +++ b/src/unicode/ntapi_uc_unicode_validation.c @@ -251,6 +251,7 @@ int32_t __stdcall __ntapi_uc_validate_unicode_stream_utf16( __in ntapi_uc_utf16_callback_fn ** callback_fn __optional, __in nt_utf16_callback_args * callback_args __optional) { + int32_t status; const wchar16_t * wch_trail; wchar16_t * wch_boundary; unsigned char byte_count; @@ -314,7 +315,9 @@ int32_t __stdcall __ntapi_uc_validate_unicode_stream_utf16( if (byte_count) { (*code_points)++; callback_args->byte_count = byte_count; - callback_fn[byte_count](callback_args); + + if ((status = callback_fn[byte_count](callback_args))) + return status; } else { if (addr_failed) *addr_failed = (void *)wch; @@ -326,7 +329,7 @@ int32_t __stdcall __ntapi_uc_validate_unicode_stream_utf16( } if ((wch < wch_boundary) && (*wch == 0)) - callback_fn[0](callback_args); + return callback_fn[0](callback_args); return NT_STATUS_SUCCESS; } -- cgit v1.2.3