- Implement IS_TEXT_UNICODE_ILLEGAL_CHARS and IS_TEXT_UNICODE_ASCII16 flags

* It fixes 7 tests for the IsTextUnicode function in advapi32_apitest. All tests passed now

svn path=/trunk/; revision=72486
This commit is contained in:
Dmitry Chapyshev 2016-08-28 11:05:01 +00:00
parent 25d05a1982
commit af19896deb
2 changed files with 16 additions and 1 deletions

View file

@ -1295,6 +1295,21 @@ RtlIsTextUnicode(CONST VOID* buf, INT len, INT* pf)
last_lo_byte = lo_byte;
last_hi_byte = hi_byte;
switch (s[i])
{
case 0xFFFE: /* Reverse BOM */
case UNICODE_NULL:
case 0x0A0D: /* ASCII CRLF (packed into one word) */
case 0xFFFF: /* Unicode 0xFFFF */
out_flags |= IS_TEXT_UNICODE_ILLEGAL_CHARS;
break;
}
}
if (lo_byte_diff < 127 && !hi_byte_diff)
{
out_flags |= IS_TEXT_UNICODE_ASCII16;
}
if (NlsMbCodePageTag)

View file

@ -80,7 +80,7 @@ START_TEST(IsTextUnicode)
NEW_TEST(L"\xFFFE" L"UNICODE String 5 Привет!", IS_TEXT_UNICODE_STATISTICS, 0, FALSE),
NEW_TEST(L"\xFFFE" L"UNICODE String 5 Привет!", INVALID_FLAG, 0, FALSE),
// 28
// 31
/* Reverse BOM */
NEW_TEST(L"UNICODE S" L"\xFFFE" L"tring 5 Привет!", IS_TEXT_UNICODE_ILLEGAL_CHARS, IS_TEXT_UNICODE_ILLEGAL_CHARS, FALSE),
/* UNICODE_NUL */