RtlpHeapListCompare

NTSTATUS __stdcall RtlpHeapListCompare(_HEAP *Heap, _LIST_ENTRY *ListEntry, UINT64 Size, UINT8 FreeList){
  int v4; 
  unsigned int Blink; 

  v4 = Size;
  if( !FreeList )
    return Size - LODWORD(ListEntry[2].Blink);
  Blink = (unsigned int)ListEntry[-1].Blink;
  if( Heap->EncodeFlagMask )
  {
    Blink = LODWORD(ListEntry[-1].Blink) ^ Heap->Encoding.UnpackedEntry.SubSegmentCode;
    if( HIBYTE(Blink) != ((unsigned __int8)Blink ^ (unsigned __int8)(BYTE1(Blink) ^ BYTE2(Blink))) )
      RtlpLogHeapFailure(heap_failure_entry_corruption, Heap, &ListEntry[-1], 0i64, 0i64);
  }
  return v4 - (unsigned __int16)Blink;
}

Referenced by:

RtlpHeapAddListEntry
RtlpHeapFindListLookupEntry
RtlpHeapRemoveListEntry