MiArbitraryCodeBlocked

__int64 __fastcall MiArbitraryCodeBlocked(__int64 a1){
  _ETHREAD *CurrentThread; 
  int v3; 
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  v3 = *(_DWORD *)(a1 + 2512);
  if( (v3 & 0x100) == 0 || (*((_DWORD *)CurrentThread + 324) & 0x40000) != 0 )
  {
    if( (v3 & 0x800) != 0 && (*((_DWORD *)CurrentThread + 324) & 0x40000) == 0 )
      EtwTimLogProhibitDynamicCode(1i64, a1);
    EtwTraceMemoryAcg(0i64);
    return 0i64;
  }
  else
  {
    EtwTraceMemoryAcg(0x80000000ui64);
    EtwTimLogProhibitDynamicCode(2i64, a1);
    return 3221227012i64;
  }
}

Referenced by:

MiAllowProtectionChange
MiMapViewOfImageSection
MiMapViewOfSection
MiReserveUserMemory