RtlAnsiCharToUnicodeChar
WCHAR __stdcall RtlAnsiCharToUnicodeChar(UINT8 **SourceCharacter){
bool IsUtf8Process;
UINT8 *v3;
__int64 v4;
int v5;
unsigned int v6;
WCHAR *p_UnicodeStringDestination;
unsigned int v8;
INT64 v9;
WCHAR *v10;
__int64 v11;
__int64 v12;
__int64 v14;
__int64 v15;
__int64 v16;
__int64 v17;
UINT64 UTF8StringByteCount;
WCHAR UnicodeStringDestination;
UINT64 UnicodeStringActualByteCount;
UnicodeStringDestination = 32;
IsUtf8Process = RtlpIsUtf8Process(0);
v3 = *SourceCharacter;
v4 = **SourceCharacter;
v5 = 1;
if( IsUtf8Process )
{
if( (unsigned __int8)v4 >= 0xC0u )
{
if( (unsigned __int8)v4 >= 0xE0u )
{
if( (unsigned __int8)v4 >= 0xF0u )
{
v6 = 1;
if( (unsigned __int8)v4 < 0xF8u )
v6 = 4;
}
else
{
v6 = 3;
}
}
else
{
v6 = 2;
}
}
else
{
v6 = 1;
}
}
else
{
v6 = 1;
if( *((_WORD *)&NlsLeadByteInfoTable + v4) )
v6 = 2;
}
p_UnicodeStringDestination = &UnicodeStringDestination;
v8 = v6;
if( RtlpIsUtf8Process(0) )
{
LODWORD(UTF8StringByteCount) = v6;
RtlUTF8ToUnicodeN(
&UnicodeStringDestination,
2ui64,
&UnicodeStringActualByteCount,
(const CHAR *)v3,
UTF8StringByteCount);
}
else if( (_BYTE)NlsMbCodePageTag )
{
v14 = NlsMbAnsiCodePageTables;
while( v8 )
{
--v5;
--v8;
v15 = 2i64 * *v3;
v16 = *(unsigned __int16 *)((char *)&NlsLeadByteInfoTable + v15);
if( (_WORD)v16 )
{
if( !v8 )
{
*p_UnicodeStringDestination = 0;
break;
}
v17 = *++v3;
*p_UnicodeStringDestination++ = *(_WORD *)(v14 + 2 * (v16 + v17));
--v8;
}
else
{
*p_UnicodeStringDestination++ = *(_WORD *)(v15 + NlsAnsiToUnicodeData);
}
++v3;
if( !v5 )
break;
}
}
else
{
v9 = NlsAnsiToUnicodeData;
v10 = &UnicodeStringDestination;
v11 = v6;
if( v6 > 1 )
v11 = 1i64;
do
{
v12 = *v3;
++v10;
++v3;
*(v10 - 1) = *(_WORD *)(v9 + 2 * v12);
--v11;
}
while( v11 );
}
*SourceCharacter += v6;
return UnicodeStringDestination;
}Referenced by:
safecrt_mbtowc
toupper