PnprAddProcessorResources

INT64 __stdcall PnprAddProcessorResources(
        UINT64 ProcessorIndex,
        UINT64 ApicId,
        PNP_REPLACE_PROCESSOR_LIST **ProcessorListOut){
  UINT8 **v3; 
  UINT8 *v4; 
  UINT8 **v5; 
  int v6; 
  ULONG v7; 
  int v8; 
  int v9; 
  unsigned int v10; 
  UINT8 *PoolWithTag; 
  UINT8 *v12; 
  UINT64 v13; 
  int v14; 
  int v15; 
  INT64 result; 
  UINT64 ProcNumber; 
  ProcNumber = ProcessorIndex;
  v4 = *v3;
  v5 = v3;
  LODWORD(ProcNumber) = 0;
  v6 = (int)ProcessorListOut;
  v7 = ApicId;
  v8 = *((_DWORD *)v4 + 4);
  if( v8 == *((_DWORD *)v4 + 3) )
  {
    v9 = v8 + 4;
    v10 = 4 * v8 + 20;
    PoolWithTag = (UINT8 *)ExAllocatePoolWithTag(NonPagedPoolNx, (unsigned int)(4 * (v8 + 4) + 20), 0x51706E50ui64);
    v12 = PoolWithTag;
    if( !PoolWithTag )
    {
      v13 = PnprContext;
      v14 = *(_DWORD *)(PnprContext + 20984);
      if( !v14 )
        v14 = 816;
      *(_DWORD *)(PnprContext + 20984) = v14;
      v15 = *(_DWORD *)(v13 + 20988);
      if( !v15 )
        v15 = 10;
      *(_DWORD *)(v13 + 20988) = v15;
      return 3221225626i64;
    }
    memmove(PoolWithTag, v4, v10);
    ExFreePoolWithTag(v4, 0x51706E50u);
    v4 = v12;
    *((_DWORD *)v12 + 3) = v9;
  }
  if( v7 != -1 )
  {
    KeGetProcessorNumberFromIndex(v7, (PPROCESSOR_NUMBER)&ProcNumber);
    *(_QWORD *)(*(_QWORD *)v4 + 8i64 * (unsigned __int16)ProcNumber) |= 1i64 << SBYTE2(ProcNumber);
  }
  *(_DWORD *)&v4[4 * (*((_DWORD *)v4 + 4))++ + 20] = v6;
  result = 0i64;
  *v5 = v4;
  return result;
}

Referenced by:

PnprAddDeviceResources