| 816 | static char s_crashText[1024]; |
| 817 | |
| 818 | LONG WINAPI CrashFilter( PEXCEPTION_POINTERS pExp ) |
| 819 | { |
| 820 | if( !GetProfiler().IsConnected() ) return EXCEPTION_CONTINUE_SEARCH; |
| 821 | |
| 822 | const unsigned ec = pExp->ExceptionRecord->ExceptionCode; |
| 823 | auto msgPtr = s_crashText; |
| 824 | switch( ec ) |
| 825 | { |
| 826 | case EXCEPTION_ACCESS_VIOLATION: |
| 827 | msgPtr += sprintf( msgPtr, "Exception EXCEPTION_ACCESS_VIOLATION (0x%x). ", ec ); |
| 828 | switch( pExp->ExceptionRecord->ExceptionInformation[0] ) |
| 829 | { |
| 830 | case 0: |
| 831 | msgPtr += sprintf( msgPtr, "Read violation at address 0x%" PRIxPTR ".", pExp->ExceptionRecord->ExceptionInformation[1] ); |
| 832 | break; |
| 833 | case 1: |
| 834 | msgPtr += sprintf( msgPtr, "Write violation at address 0x%" PRIxPTR ".", pExp->ExceptionRecord->ExceptionInformation[1] ); |
| 835 | break; |
| 836 | case 8: |
| 837 | msgPtr += sprintf( msgPtr, "DEP violation at address 0x%" PRIxPTR ".", pExp->ExceptionRecord->ExceptionInformation[1] ); |
| 838 | break; |
| 839 | default: |
| 840 | break; |
| 841 | } |
| 842 | break; |
| 843 | case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: |
| 844 | msgPtr += sprintf( msgPtr, "Exception EXCEPTION_ARRAY_BOUNDS_EXCEEDED (0x%x). ", ec ); |
| 845 | break; |
| 846 | case EXCEPTION_DATATYPE_MISALIGNMENT: |
| 847 | msgPtr += sprintf( msgPtr, "Exception EXCEPTION_DATATYPE_MISALIGNMENT (0x%x). ", ec ); |
| 848 | break; |
| 849 | case EXCEPTION_FLT_DIVIDE_BY_ZERO: |
| 850 | msgPtr += sprintf( msgPtr, "Exception EXCEPTION_FLT_DIVIDE_BY_ZERO (0x%x). ", ec ); |
| 851 | break; |
| 852 | case EXCEPTION_ILLEGAL_INSTRUCTION: |
| 853 | msgPtr += sprintf( msgPtr, "Exception EXCEPTION_ILLEGAL_INSTRUCTION (0x%x). ", ec ); |
| 854 | break; |
| 855 | case EXCEPTION_IN_PAGE_ERROR: |
| 856 | msgPtr += sprintf( msgPtr, "Exception EXCEPTION_IN_PAGE_ERROR (0x%x). ", ec ); |
| 857 | break; |
| 858 | case EXCEPTION_INT_DIVIDE_BY_ZERO: |
| 859 | msgPtr += sprintf( msgPtr, "Exception EXCEPTION_INT_DIVIDE_BY_ZERO (0x%x). ", ec ); |
| 860 | break; |
| 861 | case EXCEPTION_PRIV_INSTRUCTION: |
| 862 | msgPtr += sprintf( msgPtr, "Exception EXCEPTION_PRIV_INSTRUCTION (0x%x). ", ec ); |
| 863 | break; |
| 864 | case EXCEPTION_STACK_OVERFLOW: |
| 865 | msgPtr += sprintf( msgPtr, "Exception EXCEPTION_STACK_OVERFLOW (0x%x). ", ec ); |
| 866 | break; |
| 867 | default: |
| 868 | return EXCEPTION_CONTINUE_SEARCH; |
| 869 | } |
| 870 | |
| 871 | { |
| 872 | GetProfiler().SendCallstack( 60, "KiUserExceptionDispatcher" ); |
| 873 | |
| 874 | TracyQueuePrepare( QueueType::CrashReport ); |
| 875 | item->crashReport.time = Profiler::GetTime(); |
nothing calls this directly
no test coverage detected