ExpInitializeSvm

VOID __stdcall ExpInitializeSvm(){
  unsigned int v0; 
  bool v1; 
  char *v2; 
  unsigned int i; 
  __int64 v4; 
  __int64 v5; 
  _QWORD *v6; 
  VOID **PoolWithTag; 
  unsigned int v8; 

  v8 = 0;
  (*((void(__fastcall **)(_QWORD, unsigned int *, char *, char *))HalIommuDispatch + 1))(
    0i64,
    &v8,
    (char *)&WheapDeferredInternalLogsEventLock + 2304,
    (char *)&WheapDeferredInternalLogsEventLock + 2384);
  v0 = v8;
  v1 = v8 == 1;
  if( v8 > 1 )
  {
    PoolWithTag = ExAllocatePoolWithTag(0x200ui64, 104i64 * v8, 1985181765i64);
    v0 = v8;
    v1 = v8 == 1;
    *(&WheapDeferredInternalLogsEventLock + 297) = PoolWithTag;
  }
  if( v1 || (v2 = (char *)*(&WheapDeferredInternalLogsEventLock + 297)) == 0i64 )
  {
    v2 = (char *)&WheapDeferredInternalLogsEventLock + 2400;
    v0 = 1;
    *(&WheapDeferredInternalLogsEventLock + 297) = (char *)&WheapDeferredInternalLogsEventLock + 2400;
  }
  *(&WheapDeferredInternalLogsEventLock + 592) = v0;
  for( i = 0; i < v0; *(_DWORD *)&v2[v5 + 96] = 0 )
  {
    v4 = i;
    v5 = 104i64 * i++;
    *(_QWORD *)&v2[v5 + 16] = ExpSvmWorkerThread;
    *(_QWORD *)&v2[v5 + 24] = v4;
    *(_QWORD *)&v2[v5] = 0i64;
    *(_QWORD *)&v2[v5 + 56] = ExpSvmDpcRoutine;
    *(_DWORD *)&v2[v5 + 32] = 275;
    *(_QWORD *)&v2[v5 + 64] = v4;
    *(_QWORD *)&v2[v5 + 88] = 0i64;
    *(_QWORD *)&v2[v5 + 48] = 0i64;
  }
  v6 = HalIommuDispatch;
  *((_QWORD *)HalIommuDispatch + 12) = ExpSvmFaultRoutine;
  v6[13] = ExpSvmReferenceAsid;
  v6[14] = ExpSvmDereferenceAsid;
  v6[15] = ExpSvmServicePageFault;
  *(&WheapDeferredInternalLogsEventLock + 295) = (char *)&WheapDeferredInternalLogsEventLock + 2352;
  *(&WheapDeferredInternalLogsEventLock + 294) = (char *)&WheapDeferredInternalLogsEventLock + 2352;
  *(&WheapDeferredInternalLogsEventLock + 291) = 0i64;
  *(&WheapDeferredInternalLogsEventLock + 285) = 0i64;
}

Referenced by:

ExpInitSystemPhase1