Index: lib/rtl/unicode.c =================================================================== --- lib/rtl/unicode.c (revision 13231) +++ lib/rtl/unicode.c (working copy) @@ -962,7 +962,6 @@ * * NOTES * This function always writes a terminating '\0'. - * It performs a partial copy if ansi is too small. */ NTSTATUS FASTCALL @@ -982,8 +981,6 @@ else Length = (UniSource->Length / sizeof(WCHAR)) + sizeof(CHAR); - AnsiDest->Length = Length - sizeof(CHAR); - if (AllocateDestinationString) { AnsiDest->Buffer = ExAllocatePoolWithTag(PoolType, Length, TAG_ASTR); @@ -992,15 +989,11 @@ AnsiDest->MaximumLength = Length; } - else if (AnsiDest->MaximumLength == 0) + else if (Length > AnsiDest->MaximumLength) { return STATUS_BUFFER_TOO_SMALL; } - else if (Length > AnsiDest->MaximumLength) - { - //make room for nullterm - AnsiDest->Length = AnsiDest->MaximumLength - sizeof(CHAR); - } + AnsiDest->Length = Length - sizeof(CHAR); Status = RtlUnicodeToMultiByteN (AnsiDest->Buffer, AnsiDest->Length,