KdpReport

VOID __fastcall 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; 
  _FILETIME *Context; 
  DWORD dwLowDateTime; 

  ExceptionCode = ExceptionRecord->ExceptionCode;
  if( ExceptionRecord->ExceptionCode != -1073740768
    && (unsigned int)(ExceptionCode + 2147483645) > 1
    && (unsigned int)(ExceptionCode - 1073741854) > 1
    && (NtGlobalFlag & 1) == 0 )
  {
    v9 = SecondChance;
    if( !SecondChance )
      return;
    goto LABEL_6;
  }
  v9 = SecondChance;
  if( SecondChance
    || (unsigned int)ExceptionCode > 0x4000001D && ExceptionCode != -1073741769 && ExceptionCode < 1073741856 )
  {
LABEL_6:
    v10 = KdEnterDebugger(TrapFrame, (_KTRAP_FRAME *)ExceptionFrame);
    CurrentPrcb = KeGetCurrentPrcb();
    v12 = v10;
    KdpCopyContext(CurrentPrcb->Context, ContextRecord->ContextFlags, ContextRecord);
    KiSaveProcessorControlState(&CurrentPrcb->ProcessorState);
    Context = (_FILETIME *)CurrentPrcb->Context;
    dwLowDateTime = Context[6].dwLowDateTime;
    KdpReportExceptionStateChange(ExceptionRecord, Context, v9);
    KdpCopyContext(ContextRecord, dwLowDateTime, CurrentPrcb->Context);
    KiRestoreProcessorControlState(&CurrentPrcb->ProcessorState);
    KdExitDebugger(v12);
    KdpControlCPressed = 0;
  }
}

Referenced by:

KdpTrap