CmpRegisterCallbackInternal

__int64 __fastcall CmpRegisterCallbackInternal(
        __int64 a1,
        __int64 a2,
        const VOID **a3,
        char a4,
        unsigned __int8 a5,
        _QWORD *a6){
  VOID **PoolWithTag; 
  VOID **v11; 
  int v12; 
  VOID **v13; 
  int inserted; 
  void *v16; 

  PoolWithTag = ExAllocatePoolWithTag(1ui64, 0x50ui64, 1650675011i64);
  v11 = PoolWithTag;
  if( PoolWithTag )
  {
    memset(PoolWithTag, 0i64, 0x50u);
    v11[1] = v11;
    v11[9] = v11 + 8;
    v11[8] = v11 + 8;
    v12 = *((_DWORD *)v11 + 5) ^ a5;
    *v11 = v11;
    *((_DWORD *)v11 + 5) ^= v12 & 1;
    *((_DWORD *)v11 + 4) = 0;
    v11[4] = (VOID *)a2;
    v11[5] = (VOID *)a1;
    LOWORD(v12) = *(_WORD *)a3;
    *((_WORD *)v11 + 25) = *(_WORD *)a3;
    *((_WORD *)v11 + 24) = v12;
    v13 = ExAllocatePoolWithTag(1ui64, *(unsigned __int16 *)a3, 1633897795i64);
    v11[7] = v13;
    if( v13 )
    {
      memmove(v13, a3[1], *(unsigned __int16 *)a3);
      inserted = CmpInsertCallbackInListByAltitude((INT64)v11, a4);
      *a6 = v11[3];
      if( inserted >= 0 )
        return(unsigned int)inserted;
    }
    else
    {
      inserted = -1073741670;
    }
    v16 = v11[7];
    if( v16 )
      ExFreePoolWithTag(v16, 0);
    ExFreePoolWithTag(v11, 0);
    return(unsigned int)inserted;
  }
  return 3221225626i64;
}

Referenced by:

CmRegisterCallback
CmRegisterCallbackEx
CmRegisterInternalCallback