HvlRetargetDeviceInterrupt

__int64 __fastcall HvlRetargetDeviceInterrupt(__int64 a1, _OWORD *a2, _OWORD *a3, __int64 *a4, _OWORD *a5){
  _OWORD *v9; 
  char *v10; 
  __int64 v11; 
  __int64 v12; 
  int v13; 
  UINT16 v14; 
  unsigned int v15; 
  __int128 PageInfo_8; 
  __int128 v18; 
  PHYSICAL_ADDRESS v19[5]; 
  _KAFFINITY_EX Affinity; 
  char v21[32]; 
  char StackBuffer[256]; 

  PageInfo_8 = 0i64;
  v18 = 0i64;
  memset(v19, 0, 32);
  memset(Affinity.Bitmap, 0i64, sizeof(Affinity.Bitmap));
  v9 = 0i64;
  v10 = (char *)HvlpAcquireHypercallPage((PHYSICAL_ADDRESS *)&PageInfo_8, 1ui64, StackBuffer, 0x80ui64);
  *(_OWORD *)v10 = 0i64;
  *((_OWORD *)v10 + 1) = 0i64;
  *((_OWORD *)v10 + 2) = 0i64;
  *((_QWORD *)v10 + 6) = 0i64;
  *(_OWORD *)(v10 + 40) = *a3;
  *(_DWORD *)&Affinity.Count = 1310721;
  memset(&Affinity.Reserved, 0i64, 0xA4u);
  v11 = *((unsigned __int16 *)a4 + 4);
  v12 = *a4;
  if( (_WORD)v11 )
    Affinity.Count = v11 + 1;
  Affinity.Bitmap[v11] |= v12;
  HvlpAffinityToHvProcessorSet(&Affinity, (_HV_GENERIC_SET *)v10 + 3, (PageInfo_8 & 2) != 0 ? 64 : 4032);
  if( v13 == -1 )
  {
    HvlpReleaseHypercallPage((_HVLP_HYPERCALL_PAGE_INFO *)&PageInfo_8);
    v10 = (char *)HvlpAcquireHypercallPage((PHYSICAL_ADDRESS *)&PageInfo_8, 1ui64, 0i64, 0i64);
    *(_OWORD *)v10 = 0i64;
    *((_OWORD *)v10 + 1) = 0i64;
    *((_OWORD *)v10 + 2) = 0i64;
    *((_QWORD *)v10 + 6) = 0i64;
    *(_OWORD *)(v10 + 40) = *a3;
    HvlpAffinityToHvProcessorSet(&Affinity, (_HV_GENERIC_SET *)v10 + 3, 0xFC0ui64);
  }
  *((_DWORD *)v10 + 11) |= 2u;
  *(_QWORD *)v10 = -1i64;
  *((_QWORD *)v10 + 1) = a1;
  *((_OWORD *)v10 + 1) = *a2;
  if( a5 )
    v9 = HvlpAcquireHypercallPage(v19, 2ui64, v21, 0x10ui64);
  HvcallInitiateHypercall();
  if( v14 )
  {
    v15 = HvlpHvToNtStatus(v14);
  }
  else
  {
    v15 = 0;
    if( !a5 )
      goto LABEL_13;
    *a5 = *v9;
  }
  if( a5 )
    HvlpReleaseHypercallPage((_HVLP_HYPERCALL_PAGE_INFO *)v19);
LABEL_13:
  HvlpReleaseHypercallPage((_HVLP_HYPERCALL_PAGE_INFO *)&PageInfo_8);
  return v15;
}

Referenced by:

No references.