diff options
author | midipix <writeonce@midipix.org> | 2016-06-20 12:10:12 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-06-20 12:10:12 -0400 |
commit | 7845d0d8d1aa9d2a3b981cc05d523451ad0628f8 (patch) | |
tree | 22bece06300b6fed7fef34071b2271f7726ffd59 /src/unicode | |
parent | 099813ca335488ed3e67e96615df8c3e7c6ecad0 (diff) | |
download | ntapi-7845d0d8d1aa9d2a3b981cc05d523451ad0628f8.tar.bz2 ntapi-7845d0d8d1aa9d2a3b981cc05d523451ad0628f8.tar.xz |
__ntapi_uc_validate_unicode_stream_utf16(): preserve callback fn return value.
Diffstat (limited to 'src/unicode')
-rw-r--r-- | src/unicode/ntapi_uc_unicode_validation.c | 7 |
1 files changed, 5 insertions, 2 deletions
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; } |