KiSetCacheInformation
VOID __stdcall KiSetCacheInformation(){
KPCR *Pcr;
struct _KPRCB *CurrentPrcb;
char v2;
unsigned int v3;
char *v4;
unsigned int i;
unsigned __int8 v6;
Pcr = KeGetPcr();
CurrentPrcb = KeGetCurrentPrcb();
v2 = *((_BYTE *)CurrentPrcb + 141);
if( v2 == 1 )
{
KiSetCacheInformationAmd();
}
else
{
if( (unsigned __int8)(v2 - 2) > 1u )
KeBugCheck(0x5Dui64);
KiSetCacheInformationIntel();
}
v3 = 0;
v4 = (char *)CurrentPrcb + 33496;
*((_DWORD *)Pcr + 47) = 0;
for( i = 0; i < *((_DWORD *)CurrentPrcb + 8389); ++i )
{
if( (unsigned __int8)*v4 >= 2u && (*((_DWORD *)v4 + 2) & 0xFFFFFFFD) == 0 )
{
v6 = v4[1];
if( v6 == 0xFF )
v6 = 16;
if( v6 && *((_DWORD *)v4 + 1) / (unsigned int)v6 > v3 )
{
v3 = *((_DWORD *)v4 + 1) / (unsigned int)v6;
*((_DWORD *)Pcr + 47) = *((_DWORD *)v4 + 1);
*((_BYTE *)Pcr + 81) = v6;
}
if( *((unsigned __int16 *)v4 + 1) > (unsigned int)KeLargestCacheLine )
KeLargestCacheLine = *((unsigned __int16 *)v4 + 1);
if( *((_DWORD *)v4 + 1) > (unsigned int)KiLargestCacheSize )
KiLargestCacheSize = *((_DWORD *)v4 + 1);
}
v4 += 12;
}
}Referenced by:
KiInitializeKernel