mirror of
https://github.com/reactos/reactos.git
synced 2024-07-12 15:45:20 +00:00
[RTL]
- Implement IS_TEXT_UNICODE_DBCS_LEADBYTE flag * Fixes 4 new tests in advapi32_apitest svn path=/trunk/; revision=72488
This commit is contained in:
parent
85d39f7ebe
commit
75ece18c55
|
@ -1307,11 +1307,6 @@ RtlIsTextUnicode(CONST VOID* buf, INT len, INT* pf)
|
|||
}
|
||||
}
|
||||
|
||||
if (lo_byte_diff < 127 && !hi_byte_diff)
|
||||
{
|
||||
out_flags |= IS_TEXT_UNICODE_ASCII16;
|
||||
}
|
||||
|
||||
if (NlsMbCodePageTag)
|
||||
{
|
||||
for (i = 0; i < len; i++)
|
||||
|
@ -1333,9 +1328,27 @@ RtlIsTextUnicode(CONST VOID* buf, INT len, INT* pf)
|
|||
weight = 2;
|
||||
else
|
||||
weight = 1;
|
||||
|
||||
if (*pf && (*pf & IS_TEXT_UNICODE_DBCS_LEADBYTE))
|
||||
out_flags |= IS_TEXT_UNICODE_DBCS_LEADBYTE;
|
||||
}
|
||||
}
|
||||
|
||||
if (lo_byte_diff < 127 && !hi_byte_diff)
|
||||
{
|
||||
out_flags |= IS_TEXT_UNICODE_ASCII16;
|
||||
}
|
||||
|
||||
if (hi_byte_diff && !lo_byte_diff)
|
||||
{
|
||||
out_flags |= IS_TEXT_UNICODE_REVERSE_ASCII16;
|
||||
}
|
||||
|
||||
if ((weight * lo_byte_diff) < hi_byte_diff)
|
||||
{
|
||||
out_flags |= IS_TEXT_UNICODE_REVERSE_STATISTICS;
|
||||
}
|
||||
|
||||
/* apply some statistical analysis */
|
||||
if ((flags & IS_TEXT_UNICODE_STATISTICS) &&
|
||||
((weight * hi_byte_diff) < lo_byte_diff))
|
||||
|
@ -1378,16 +1391,6 @@ RtlIsTextUnicode(CONST VOID* buf, INT len, INT* pf)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hi_byte_diff && !lo_byte_diff)
|
||||
{
|
||||
out_flags |= IS_TEXT_UNICODE_REVERSE_ASCII16;
|
||||
}
|
||||
|
||||
if ((weight * lo_byte_diff) < hi_byte_diff)
|
||||
{
|
||||
out_flags |= IS_TEXT_UNICODE_REVERSE_STATISTICS;
|
||||
}
|
||||
}
|
||||
|
||||
if (pf)
|
||||
|
|
Loading…
Reference in a new issue