CmpFindSubKeyByNameWithStatus

INT64 __fastcall CmpFindSubKeyByNameWithStatus(
        _HHIVE *Hive,
        _CM_KEY_NODE *Parent,
        const _UNICODE_STRING *SearchName,
        UINT *Cell){
  __int64 v5; 
  unsigned int v9; 
  _CELL_DATA *v10; 
  unsigned int SubKeyByHashWithStatus; 
  int v13[4]; 
  UINT Index; 
  int v15; 

  Index = 0;
  v15 = 0;
  v5 = 0i64;
  v13[0] = -1;
  v9 = -1073741772;
  v13[1] = 0;
  *Cell = -1;
  if( Hive->StorageTypeCount )
  {
    while( 1 )
    {
      if( !Parent->SubKeyCounts[v5] )
        goto LABEL_13;
      v10 = Hive->GetCellRoutine(Hive, Parent->SubKeyLists[v5], v13);
      if( !v10 )
        return(unsigned int)-1073741670;
      if( v10->u.KeyNode.Signature != 26994 )
        goto LABEL_5;
      if( (int)CmpFindSubKeyInRoot(Hive, (_CM_KEY_INDEX *)v10, SearchName, 0i64) < 0 )
      {
        v9 = -1073741670;
        goto LABEL_10;
      }
      Hive->ReleaseCellRoutine(Hive, (_HV_GET_CELL_CONTEXT *)v13);
      if( Index != -1 )
        break;
LABEL_13:
      v5 = (unsigned int)(v5 + 1);
      if( (unsigned int)v5 >= Hive->StorageTypeCount )
        return v9;
    }
    v10 = Hive->GetCellRoutine(Hive, Index, v13);
    if( !v10 )
      return(unsigned int)-1073741670;
LABEL_5:
    if( v10->u.KeyNode.Signature == 26732 )
      SubKeyByHashWithStatus = CmpFindSubKeyByHashWithStatus((__int64)Hive, (__int64)v10, (__m128i *)SearchName, &Index);
    else
      SubKeyByHashWithStatus = CmpFindSubKeyInLeafWithStatus(Hive, (_CM_KEY_INDEX *)v10, SearchName, 0i64, &Index);
    v9 = SubKeyByHashWithStatus;
    if( (int)(SubKeyByHashWithStatus + 0x80000000) >= 0 && SubKeyByHashWithStatus != -1073741772 )
      goto LABEL_10;
    if( Index != -1 )
    {
      *Cell = Index;
      v9 = 0;
LABEL_10:
      Hive->ReleaseCellRoutine(Hive, (_HV_GET_CELL_CONTEXT *)v13);
      return v9;
    }
    Hive->ReleaseCellRoutine(Hive, (_HV_GET_CELL_CONTEXT *)v13);
    goto LABEL_13;
  }
  return v9;
}

Referenced by:

CmRenameKey
CmpCopySyncTree2
CmpFindControlSet
CmpFindPathByName
CmpFindSubKeyByName
CmpMarkCurrentValueDirty
CmpSyncSubKeysAfterDelete
CmpWalkUnicodeStringPath