RtlAreNamesEqual

UINT8 __stdcall RtlAreNamesEqual(
        _UNICODE_STRING *ConstantNameA,
        _UNICODE_STRING *ConstantNameB,
        UINT8 IgnoreCase,
        WCHAR *UpcaseTable){
  unsigned int Length; 
  char v5; 
  _UNICODE_STRING *p_UnicodeString; 
  unsigned int v7; 
  __int64 v8; 
  int v10; 
  UINT8 v11; 
  NTSTATUS v12; 
  NTSTATUS v13; 
  bool v14; 
  _UNICODE_STRING DestinationString; 
  _UNICODE_STRING UnicodeString; 

  Length = ConstantNameA->Length;
  v5 = 0;
  p_UnicodeString = ConstantNameB;
  DestinationString = 0i64;
  UnicodeString = 0i64;
  if( (_WORD)Length != ConstantNameB->Length )
    return 0;
  v7 = Length >> 1;
  if( IgnoreCase )
  {
    if( UpcaseTable )
    {
      v8 = 0i64;
      if( !v7 )
        return 1;
      while( UpcaseTable[ConstantNameA->Buffer[v8]] == UpcaseTable[ConstantNameB->Buffer[v8]] )
      {
        v8 = (unsigned int)(v8 + 1);
        if( (unsigned int)v8 >= v7 )
          return 1;
      }
      return 0;
    }
    v10 = RtlpUpcaseUnicodeStringPrivate(&DestinationString, ConstantNameA, IgnoreCase);
    if( v10 < 0 )
      RtlRaiseStatus(v10);
    v12 = RtlpUpcaseUnicodeStringPrivate(&UnicodeString, p_UnicodeString, v11);
    ConstantNameA = &DestinationString;
    v13 = v12;
    if( v12 < 0 )
    {
      RtlFreeAnsiString(&DestinationString);
      RtlRaiseStatus(v13);
    }
    LOWORD(Length) = DestinationString.Length;
    p_UnicodeString = &UnicodeString;
    v5 = 1;
  }
  v14 = memcmp(ConstantNameA->Buffer, p_UnicodeString->Buffer, (unsigned __int16)Length) == 0;
  if( v5 )
  {
    RtlFreeAnsiString(&DestinationString);
    RtlFreeAnsiString(&UnicodeString);
  }
  return v14;
}

Referenced by:

No references.