summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-11-07 21:45:50 -0500
committermidipix <writeonce@midipix.org>2016-11-07 22:41:02 -0500
commit0e78645878fb98861eeec67e72c383e12d7ea35c (patch)
tree99caf9bc7cf7164b8cd9b9de3280aa3a62ae0b73 /src
parent56548d7e7fd4703a3782c76dd08e4118a42cf7d5 (diff)
downloadntapi-0e78645878fb98861eeec67e72c383e12d7ea35c.tar.bz2
ntapi-0e78645878fb98861eeec67e72c383e12d7ea35c.tar.xz
unicode interfaces: always set addr_failed, leftover_bytes, and leftover_count.
Diffstat (limited to 'src')
-rw-r--r--src/unicode/ntapi_uc_unicode_conversion_from_utf16.c8
-rw-r--r--src/unicode/ntapi_uc_unicode_conversion_from_utf8.c8
-rw-r--r--src/unicode/ntapi_uc_unicode_validation.c4
3 files changed, 18 insertions, 2 deletions
diff --git a/src/unicode/ntapi_uc_unicode_conversion_from_utf16.c b/src/unicode/ntapi_uc_unicode_conversion_from_utf16.c
index eb8196c..f089ec0 100644
--- a/src/unicode/ntapi_uc_unicode_conversion_from_utf16.c
+++ b/src/unicode/ntapi_uc_unicode_conversion_from_utf16.c
@@ -272,7 +272,15 @@ int32_t __stdcall __ntapi_uc_convert_unicode_stream_utf16_to_utf8(
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:
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:
diff --git a/src/unicode/ntapi_uc_unicode_validation.c b/src/unicode/ntapi_uc_unicode_validation.c
index dbdf4e1..35b2d50 100644
--- a/src/unicode/ntapi_uc_unicode_validation.c
+++ b/src/unicode/ntapi_uc_unicode_validation.c
@@ -108,7 +108,7 @@ int32_t __stdcall __ntapi_uc_validate_unicode_stream_utf8(
__in const unsigned char * ch,
__in size_t size_in_bytes __optional,
__out size_t * code_points __optional,
- __out void ** addr_failed __optional,
+ __out const unsigned char ** addr_failed __optional,
__in ntapi_uc_utf8_callback_fn ** callback_fn __optional,
__in nt_utf8_callback_args * callback_args __optional)
{
@@ -247,7 +247,7 @@ int32_t __stdcall __ntapi_uc_validate_unicode_stream_utf16(
__in const wchar16_t * wch,
__in size_t size_in_bytes __optional,
__out size_t * code_points __optional,
- __out void ** addr_failed __optional,
+ __out const wchar16_t ** addr_failed __optional,
__in ntapi_uc_utf16_callback_fn ** callback_fn __optional,
__in nt_utf16_callback_args * callback_args __optional)
{