HvlLpReadMultipleMsr

NTSTATUS __stdcall HvlLpReadMultipleMsr(UINT64 LpIndex, UINT64 Count, UINT64 *MsrIndices, UINT64 *MsrValues){
  unsigned int v4; 
  int v7; 
  __int64 v8; 
  UINT64 *v9; 
  __int64 v10; 
  _DWORD *v11; 
  int v12; 
  __int16 v13; 
  NTSTATUS v14; 
  UINT64 v15; 
  char *v17; 
  PHYSICAL_ADDRESS v18[2]; 
  __int128 v19; 
  PHYSICAL_ADDRESS PageInfo[2]; 
  __int128 v21; 

  v4 = Count;
  v7 = LpIndex;
  *(_OWORD *)&PageInfo[0].anonymous_0.LowPart = 0i64;
  v21 = 0i64;
  *(_OWORD *)&v18[0].anonymous_0.LowPart = 0i64;
  v19 = 0i64;
  if( (unsigned int)(16 * Count) > 0x1000 )
    return -1073741811;
  v8 = (unsigned int)Count;
  v17 = (char *)HvlpAcquireHypercallPage(PageInfo, 1ui64, 0i64, 16i64 * (unsigned int)Count);
  v9 = (UINT64 *)HvlpAcquireHypercallPage(v18, 2ui64, 0i64, 16i64 * v4);
  if( v4 )
  {
    v10 = v4;
    v11 = v17 + 8;
    do
    {
      *(v11 - 2) = v7;
      *(v11 - 1) = 65537;
      v12 = *(_DWORD *)MsrIndices;
      MsrIndices = (UINT64 *)((char *)MsrIndices + 4);
      *v11 = v12;
      v11 += 4;
      --v10;
    }
    while( v10 );
  }
  HvcallInitiateHypercall();
  v14 = v13 != 0 ? 0xC0000001 : 0;
  if( v4 )
  {
    do
    {
      v15 = *v9;
      v9 += 2;
      *MsrValues++ = v15;
      --v8;
    }
    while( v8 );
  }
  HvlpReleaseHypercallPage((_HVLP_HYPERCALL_PAGE_INFO *)v18);
  HvlpReleaseHypercallPage((_HVLP_HYPERCALL_PAGE_INFO *)PageInfo);
  return v14;
}

Referenced by:

No references.