CmpDoFlushNextHive

UINT8 __stdcall CmpDoFlushNextHive(UINT8 *WriteError, UINT64 *NextDueDelay){
  unsigned __int64 v2; 
  UINT8 v3; 
  _CMHIVE *NextActiveHive; 
  EVENT_DESCRIPTOR *v7; 
  UINT64 v8; 
  EVENT_DESCRIPTOR *v10; 
  UINT64 UnbiasedInterruptTime; 
  unsigned __int64 v12; 
  v2 = -1i64;
  v3 = 0;
  if( BYTE1(NlsMbCodePageTag) )
    return 0;
  NextActiveHive = CmpGetNextActiveHive(0i64);
  if( NextActiveHive )
  {
    do
    {
      v8 = -1i64;
      if( (*((_DWORD *)NextActiveHive + 40) & 3) == 0 )
      {
        if( *((_DWORD *)NextActiveHive + 26) || *((_BYTE *)NextActiveHive + 191) )
        {
          UnbiasedInterruptTime = KiQueryUnbiasedInterruptTime(1u);
          v12 = *((_QWORD *)NextActiveHive + 522) + 10000000i64 * (unsigned int)dword_140C00400;
          if( UnbiasedInterruptTime >= v12 )
          {
            if( (int)CmpFlushHive((ULONG_PTR)NextActiveHive, 18, v10) < 0 )
            {
              v3 = 1;
              *WriteError = 1;
              v8 = 10000000i64 * (unsigned int)dword_140C0040C;
            }
          }
          else
          {
            v3 = 1;
            v8 = v12 - UnbiasedInterruptTime;
          }
        }
        else if( (*((_DWORD *)NextActiveHive + 1066) & 1) == 0 )
        {
          CmpFlushHive((ULONG_PTR)NextActiveHive, 34, v7);
        }
      }
      if( *((_BYTE *)NextActiveHive + 2936) == 1 )
      {
        LOCK_HIVE_LOAD();
        CmpLockRegistryFreezeAware(0);
        if( *((_BYTE *)NextActiveHive + 2936) == 1 )
          CmpDoQueueLateUnloadWorker((__int64)NextActiveHive);
        CmpUnlockRegistry();
        UNLOCK_HIVE_LOAD();
      }
      if( v8 >= v2 )
        v8 = v2;
      v2 = v8;
      NextActiveHive = CmpGetNextActiveHive(NextActiveHive);
    }
    while( NextActiveHive );
    if( v3 )
      *NextDueDelay = v8;
  }
  return v3;
}

Referenced by:

No references.