HvlpEnableNextLogicalProcessor
INT64 __stdcall HvlpEnableNextLogicalProcessor(UINT64 ApicId, UINT16 Node){
int v2;
int v3;
__int64 v4;
WCHAR *v5;
INT64 result;
__int64 v7;
__int64 v8;
WCHAR v9;
__int128 v10;
UINT64 VpIndex;
_LARGE_INTEGER PhysicalAddress;
v2 = HvlpLogicalProcessorCount;
LODWORD(VpIndex) = 0;
v3 = ApicId;
PhysicalAddress.QuadPart = 0i64;
v4 = Node;
v5 = &HvlpLogicalProcessorRegions + 60 * (unsigned int)HvlpLogicalProcessorCount;
if( (HvlpRootFlags & 0x20) != 0 )
{
LODWORD(VpIndex) = HvlpLogicalProcessorCount;
LODWORD(result) = HvlpStartLogicalProcessor(
(unsigned int)HvlpLogicalProcessorCount,
(unsigned int)ApicId,
Node,
(INT64)(v5 + 28));
if( (int)result < 0 )
return result;
}
else
{
LODWORD(result) = HvlpGetVpIndexFromApicId(ApicId, &VpIndex);
if( (int)result < 0 )
return result;
v2 = VpIndex;
}
if( (HvlpRootFlags & 0x10) != 0 )
{
v10 = 0i64;
LODWORD(v10) = v2;
result = HvlpMapStatisticsPage(2, &v10, &PhysicalAddress);
if( (int)result < 0 )
return result;
MmMapIoSpaceEx(PhysicalAddress, 0x1000ui64, 2ui64);
if( !v7 )
return 3221225626i64;
*((_QWORD *)v5 + 4) = v7;
}
*((_DWORD *)v5 + 1) = v2;
v8 = *((_QWORD *)&KeNodeBlock + v4);
*((_DWORD *)v5 + 2) = v3;
v5[6] = v4;
v9 = *(_WORD *)(v8 + 148);
*((_DWORD *)v5 + 6) = -1;
v5[7] = v9;
result = 0i64;
*(_DWORD *)v5 = 1;
return result;
}Referenced by:
HvlStartBootLogicalProcessors