CmpSortedValueEnumStackValueCompareFunction

NTSTATUS __fastcall CmpSortedValueEnumStackValueCompareFunction(const void *a1, const void *a2){
  unsigned __int16 *v2; 
  __int64 v3; 
  unsigned int v4; 
  unsigned int v5; 
  unsigned __int16 v6; 
  __int16 v7; 
  _UNICODE_STRING String2; 
  _UNICODE_STRING String1; 

  v2 = *(unsigned __int16 **)a1;
  v3 = *(_QWORD *)a2;
  *(_DWORD *)(&String1.MaximumLength + 1) = 0;
  *(_DWORD *)(&String2.MaximumLength + 1) = 0;
  v4 = v2[1];
  v5 = *(unsigned __int16 *)(v3 + 2);
  v6 = v2[8];
  String1.Buffer = v2 + 10;
  String1.Length = v4;
  String1.MaximumLength = v4;
  String2.Buffer = (wchar_t *)(v3 + 20);
  String2.Length = v5;
  String2.MaximumLength = v5;
  v7 = v6 & 1;
  if( v7 )
  {
    if( (*(_BYTE *)(v3 + 16) & 1) != 0 )
      return CmpCompareTwoCompressedNames(v2 + 10, v4, (_WCHAR *)(v3 + 20), v5);
  }
  else if( (*(_BYTE *)(v3 + 16) & 1) != 0 )
  {
    return CmpCompareCompressedName(&String1, (WCHAR *)(v3 + 20), v5, 0i64);
  }
  if( v7 )
    return -(int)CmpCompareCompressedName(&String2, v2 + 10, v4, 0i64);
  else
    return RtlCompareUnicodeString(&String1, &String2, 1u);
}

Referenced by:

CmpSortedValueEnumStackAdvanceInternal