PsChangeQuantumTable
VOID __stdcall PsChangeQuantumTable(UINT8 ModifyActiveProcesses, UINT64 PrioritySeparation){
unsigned int v3;
const CHAR *v4;
char v5;
int v6;
char *v7;
char v8;
int v9;
char v10;
char v11;
_ETHREAD *CurrentThread;
__int64 *i;
char v14;
__int64 v15;
v3 = PrioritySeparation & 3;
LOBYTE(v4) = 2;
v5 = PrioritySeparation;
if( v3 >= 2 )
v3 = 2;
PsPrioritySeparation = v3;
v6 = PrioritySeparation & 0xC;
if( v6 == 4 )
{
v7 = (char *)PspVariableQuantums;
}
else if( v6 == 8 )
{
v7 = PspFixedQuantums;
}
else
{
MmIsThisAnNtAsSystem(2, PrioritySeparation);
v7 = PspFixedQuantums;
v4 = PspVariableQuantums;
if( !v8 )
v7 = (char *)PspVariableQuantums;
}
v9 = v5 & 0x30;
if( v9 == 16 || v9 != 32 && (MmIsThisAnNtAsSystem((CHAR)v4, PrioritySeparation), v10) )
v7 += 3;
*(_WORD *)PspForegroundQuantum = *(_WORD *)v7;
v11 = v7[2];
PspUseJobSchedulingClasses = v7 == &byte_140983727;
byte_140D2D876 = v11;
if( ModifyActiveProcesses )
{
CurrentThread = (_ETHREAD *)KeGetCurrentThread();
--*((_WORD *)CurrentThread + 243);
ExAcquirePushLockSharedEx((UINT64)&PspActiveProcessLock, 0i64);
for( i = (__int64 *)PsActiveProcessHead; i != &PsActiveProcessHead; i = (__int64 *)*i )
{
v14 = PspComputeQuantum((__int64)(i - 137), *((_BYTE *)i + 754));
KeSetQuantumProcess(v15, v14);
}
PspUnlockProcessListShared((__int64)CurrentThread);
}
}Referenced by:
NtSetSystemInformation
PspInitPhase0