MiCloneNoChange

NTSTATUS __stdcall MiCloneNoChange(_MMVAD_SHORT *ParentVad, _MMVAD_SHORT *ChildVad){
  _MI_VAD_EVENT_BLOCK *i; 
  unsigned int v4; 
  unsigned int v5; 
  int v6; 
  int v7; 

  for( i = ParentVad->EventList; i; i = i->Next )
  {
    if( i->WaitReason == 2 )
    {
      v4 = *(_DWORD *)i->gap8;
      if( (v4 & 0x80u) == 0 )
      {
        v5 = (*(_DWORD *)i->gap8 & 4) != 0 ? 0x80000000 : 0;
        if( (v4 & 8) != 0 )
        {
          if( (v4 & 4) == 0 && (v4 & 3) != 0 )
            continue;
          v5 |= 1u;
        }
        v6 = v5 | 0x20000000;
        if( (v4 & 0x100) == 0 )
          v6 = v5;
        if( v6 )
        {
          v7 = (v4 >> 5) & 1 | 4;
          if( (v4 & 0x40) == 0 )
            v7 = (v4 >> 5) & 1;
          if( !MiAddSecureEntry(
                  (_MI_PARTITION *)ChildVad,
                  (ChildVad->StartingVpn | ((unsigned __int64)ChildVad->StartingVpnHigh << 32)) << 12,
                  ((ChildVad->EndingVpn | ((unsigned __int64)ChildVad->EndingVpnHigh << 32)) << 12) | 0xFFF,
                  v6,
                  v7) )
            return -1073741670;
          return 0;
        }
      }
    }
  }
  return 0;
}

Referenced by:

MiAllocateChildVads