CmpIsCmRm

char __fastcall CmpIsCmRm(char *a1){
  _ETHREAD *CurrentThread; 
  char v2; 
  char *v4; 
  char v5; 
  char v6; 
  LIST_ENTRY *ListIterator; 
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  v2 = 0;
  ListIterator = 0i64;
  --*((_WORD *)CurrentThread + 242);
  ExAcquireFastMutexUnsafe(&CmpRmListLock);
  while( 1 )
  {
    LODWORD(v4) = CmListGetNextElement(&CmpRmListHead, &ListIterator, 0i64);
    if( !v4 )
      break;
    if( v4 == a1 )
    {
      if( *((_QWORD *)a1 + 6) && *((_QWORD *)a1 + 7) && *((_QWORD *)a1 + 4) )
      {
        v6 = 0;
        if( *((_QWORD *)a1 + 5) )
          v6 = v5 + 1;
        v2 = v6;
      }
      break;
    }
  }
  ExReleaseFastMutexUnsafe(&CmpRmListLock);
  KeLeaveCriticalRegionThread((__int64)KeGetCurrentThread());
  return v2;
}

Referenced by:

CmKtmNotification