MiMakeSecureExclusive

INT64 __fastcall MiMakeSecureExclusive(INT64 a1){
  unsigned int v2; 
  __int64 *v3; 
  __int64 v4; 
  INT64 *SharedVm; 
  KIRQL v6; 
  __int64 *i; 
  v2 = 0;
  v3 = 0i64;
  v4 = *((_QWORD *)KeGetCurrentThread() + 23);
  SharedVm = MiGetSharedVm(v4 + 1664);
  v6 = ExAcquireSpinLockExclusive((PEX_SPIN_LOCK)SharedVm);
  *((_DWORD *)SharedVm + 1) = 0;
  for( i = *(__int64 **)(a1 + 56); i; i = (__int64 *)*i )
  {
    if( *((_DWORD *)i + 16) == 2 )
    {
      if( v3 )
        goto LABEL_8;
      v3 = i;
    }
  }
  *((_DWORD *)v3 + 2) |= 0x20u;
  v2 = 1;
LABEL_8:
  MiUnlockWorkingSetExclusive(v4 + 1664, v6);
  return v2;
}

Referenced by:

MmStoreAllocateVirtualMemory