KiVmbusInterrupt0

NTSTATUS __stdcall KiVmbusInterrupt0(UINT64 SecurityDomain, UINT64 BpbState, UINT64 a3, UINT64 a4){
  unsigned __int64 v4; 
  unsigned __int64 v5; 
  unsigned __int64 v6; 
  _M128A v7; 
  _M128A v8; 
  _M128A v9; 
  _M128A v10; 
  _M128A v11; 
  _M128A v12; 
  _KTRAP_FRAME *__shifted(_KTRAP_FRAME,0x80) TrapFrame; 
  _ETHREAD *CurrentThread; 
  unsigned __int8 BpbKernelSpecCtrl; 
  unsigned __int8 v16; 
  bool v17; 

  TrapFrame = KeGetTrapFrame();
  ADJ(TrapFrame)->ExceptionActive = 0;
  ADJ(TrapFrame)->_Rax = v4;
  ADJ(TrapFrame)->_Rcx = SecurityDomain;
  ADJ(TrapFrame)->_Rdx = BpbState;
  ADJ(TrapFrame)->_R8 = a3;
  ADJ(TrapFrame)->_R9 = a4;
  ADJ(TrapFrame)->_R10 = v5;
  ADJ(TrapFrame)->_R11 = v6;
  if( (ADJ(TrapFrame)->SegCs & 1) != 0 )
  {
    if( (KiKvaShadow & 1) == 0 )
      __swapgs();
    _mm_lfence();
    CurrentThread = (_ETHREAD *)KeGetCurrentThread();
    __writegsqword(0x270u, CurrentThread->Tcb.Process->SecurityDomain);
    __writegsbyte(0x851u, KeGetPcr()->Prcb.BpbRetpolineExitSpecCtrl);
    __writegsbyte(0x852u, KeGetPcr()->Prcb.BpbState);
    BpbKernelSpecCtrl = KeGetPcr()->Prcb.BpbKernelSpecCtrl;
    if( KeGetPcr()->Prcb.BpbCurrentSpecCtrl != BpbKernelSpecCtrl )
    {
      __writegsbyte(0x27Au, BpbKernelSpecCtrl);
      __writemsr(0x48u, BpbKernelSpecCtrl);
    }
    v16 = KeGetPcr()->Prcb.BpbState;
    if( (v16 & 8) != 0 )
    {
      __writemsr(0x49u, 1ui64);
      v16 = KeGetPcr()->Prcb.BpbState;
    }
    if( (v16 & 2) != 0 )
      __flush_rsb();
    _mm_lfence();
    __writegsbyte(0x853u, 0);
    v17 = (CurrentThread->Tcb.gap0[3] & 3) == 0;
    LOWORD(ADJ(TrapFrame)->Dr7) = 0;
    if( !v17 )
      KiSaveDebugRegisterState();
  }
  else
  {
    _mm_lfence();
    if( (KeGetPcr()->Prcb.BpbState & 1) != 0 )
      __writemsr(0x48u, KeGetPcr()->Prcb.BpbCurrentSpecCtrl);
    else
      _mm_lfence();
  }
  ADJ(TrapFrame)->_MxCsr = _mm_getcsr();
  _mm_setcsr(KeGetPcr()->Prcb._MxCsr);
  ADJ(TrapFrame)->_Xmm0 = v7;
  ADJ(TrapFrame)->_Xmm1 = v8;
  ADJ(TrapFrame)->_Xmm2 = v9;
  ADJ(TrapFrame)->_Xmm3 = v10;
  ADJ(TrapFrame)->_Xmm4 = v11;
  ADJ(TrapFrame)->_Xmm5 = v12;
  if( KeGetPcr()->Prcb.DeepSleep )
    KeWakeProcessor();
  if( (unsigned __int64)&ExpInterlockedPopEntrySListResume < ADJ(TrapFrame)->_Rip
    && (unsigned __int64)&ExpInterlockedPopEntrySListEnd >= ADJ(TrapFrame)->_Rip )
  {
    KiCheckForSListAddress(ADJ(TrapFrame));
  }
  __incgsdword(0x8000u);
  return KiVmbusInterruptDispatch();
}

Referenced by:

KiVmbusInterrupt0Shadow