KiRspInIstStack

BOOL __stdcall KiRspInIstStack(UINT64 a1, UINT64 a2){
  UINT64 v2; 
  __int64 v3; 
  UINT64 v4; 
  BOOL result; 

  v2 = *(_QWORD *)((char *)KeGetPcr()->NtTib.StackBase + 8 * (unsigned int)a1 + 28);
  v3 = 24576i64;
  if( KiKvaShadow )
    v3 = 464i64;
  result = 1;
  if( a2 > v2 || a2 < v2 - v3 )
  {
    if( !KiKvaShadow )
      return 0;
    v4 = *(_QWORD *)(v2 + 8);
    if( a2 > v4 || a2 < v4 - 24544 )
      return 0;
  }
  return result;
}

Referenced by:

KeInvalidAccessAllowed
KeQueryCurrentStackInformationEx
KiMcheckFastForward
MiComputeMaximumFaultCluster
MiDispatchFault
MiSystemFault