KdpReport

UINT8 __stdcall KdpReport(
        _KTRAP_FRAME *TrapFrame,
        _KEXCEPTION_FRAME *ExceptionFrame,
        _EXCEPTION_RECORD *ExceptionRecord,
        _CONTEXT *ContextRecord,
        CHAR PreviousMode,
        UINT8 SecondChance){
  int ExceptionCode; 
  UINT8 v9; 
  UINT8 v10; 
  struct _KPRCB *CurrentPrcb; 
  UINT8 v12; 
  _CONTEXT *v13; 
  unsigned int ContextFlags; 
  UINT8 v15; 
  UINT8 result; 
  ExceptionCode = ExceptionRecord->ExceptionCode;
  if( ExceptionRecord->ExceptionCode == -1073740768
    || (unsigned int)(ExceptionCode + 2147483645) <= 1
    || (unsigned int)(ExceptionCode - 1073741854) <= 1
    || (NtGlobalFlag & 1) != 0 )
  {
    v9 = SecondChance;
    if( SecondChance
      || (unsigned int)ExceptionCode > 0x4000001D && ExceptionCode != -1073741769 && ExceptionCode < 1073741856 )
    {
      goto LABEL_6;
    }
  }
  else
  {
    v9 = SecondChance;
    if( SecondChance )
    {
LABEL_6:
      v10 = KdEnterDebugger(TrapFrame, (KTRAP_FRAME *)ExceptionFrame);
      CurrentPrcb = KeGetCurrentPrcb();
      v12 = v10;
      KdpCopyContext(*((_CONTEXT **)CurrentPrcb + 4280), ContextRecord->ContextFlags, ContextRecord);
      KiSaveProcessorControlState((_KPROCESSOR_STATE *)((char *)CurrentPrcb + 256));
      v13 = (_CONTEXT *)*((_QWORD *)CurrentPrcb + 4280);
      ContextFlags = v13->ContextFlags;
      v15 = KdpReportExceptionStateChange(ExceptionRecord, v13, v9);
      KdpCopyContext(ContextRecord, ContextFlags, *((_CONTEXT **)CurrentPrcb + 4280));
      KiRestoreProcessorControlState((INT64)CurrentPrcb + 256);
      KdExitDebugger(v12);
      result = v15;
      KdpControlCPressed = 0;
      return result;
    }
  }
  return 0;
}

Referenced by:

KdpTrap