CmpCheckAndFixSecurityCellsRefcount

UINT8 __stdcall CmpCheckAndFixSecurityCellsRefcount(CMHIVE *CmHive){
  int v1; 
  UINT8 v3; 
  _CM_KEY_SECURITY_CACHE_ENTRY *v4; 
  _CELL_DATA *v5; 
  __int64 v7; 

  v7 = 0xFFFFFFFFi64;
  v1 = 0;
  v3 = 1;
  if( !CmHive->SecurityCount )
  {
LABEL_5:
    v5 = 0i64;
    goto LABEL_6;
  }
  while( 1 )
  {
    v4 = &CmHive->SecurityCache[v1];
    v5 = CmHive->Hive.GetCellRoutine(CmHive, v4->Cell, &v7);
    if( !v5 )
      return 0;
    if( v5->u.KeyValue.Type != v4->CachedSecurity->RealRefCount )
      break;
LABEL_4:
    CmHive->Hive.ReleaseCellRoutine((_HHIVE *)CmHive, (_HV_GET_CELL_CONTEXT *)&v7);
    if( ++v1 >= CmHive->SecurityCount )
      goto LABEL_5;
  }
  if( HvpMarkCellDirty(CmHive, (PVOID)v4->Cell, 0, CmHiveDirtyNormal) )
  {
    v5->u.KeyValue.Type = v4->CachedSecurity->RealRefCount;
    goto LABEL_4;
  }
  v3 = 0;
LABEL_6:
  if( v5 )
    CmHive->Hive.ReleaseCellRoutine((_HHIVE *)CmHive, (_HV_GET_CELL_CONTEXT *)&v7);
  return v3;
}

Referenced by:

CmpCheckRegistry2