KeCheckStackAndTargetAddress

NTSTATUS __stdcall KeCheckStackAndTargetAddress(PVOID BugCheckParameter4){
  UINT64 v1; 
  unsigned __int64 v2; 
  NTSTATUS result; 
  char v5; 
  struct _KPRCB *v6; 
  UINT64 v7; 

  v7 = 0i64;
  v2 = v1;
  v6 = 0i64;
  if( (__int64)BugCheckParameter4 >= 0
    || (LOBYTE(result) = KeQueryCurrentStackInformationEx(v1, &v5, &v6, &v7), !(_BYTE)result)
    || v2 < (unsigned __int64)v6
    || v2 >= v7 )
  {
    __debugbreak();
    guard_icall_bugcheck(BugCheckParameter4);
  }
  return result;
}

Referenced by:

RcFrameConsolidation
RtlRestoreContext
_C_specific_handler
longjmp