RasieException是SEH API,SEH != 进内核,RasieException并不必然导致用户态内核态切换。事实上这个API被调用以后会首 

先尝试在用户态进行处理,如果没有任何处理者可用,则直接调用ExitProcess退出进程,这个调用倒是要进内核。 





Raising an exception causes the exception dispatcher to go through the following search for an exception handler: 





 1.The system first attempts to notify the process's debugger, if any. 





 2.If the process is not being debugged, or if the associated debugger does not handle the exception, the system attempts to locate a frame-based exception handler by searching the stack frames of the thread in which the exception occurred. The system searches
the current stack frame first, then proceeds backward through preceding stack frames. 





 3.If no frame-based handler can be found, or no frame-based handler handles the exception, the system makes a second attempt to notify the process's debugger. 





 4.If the process is not being debugged, or if the associated debugger does not handle the exception, the system provides default handling based on the exception type. For most exceptions, the default action is to call the ExitProcess function.

。 





软件异常登记 





软件异常是通过直接或者间接调用内核服务NtRaiseException而产生的。而用户态中可以通过RaiseException API,或者Try-catch等高级语言来调用这个内核服务,而通过RaiseException来登记软件异常的过程可以简单表述如下: 





RaiseException在初始化一个EXCEPTION_RECORD结构体之后,开始调用NTDLL中的RtlRaiseException; RtlRaiseException在初始化CONTEXT结构体之后,开始调用内核中NtRaiseException, NtRaiseException再调用另外一个内核函数KiRaiseException。接下来KiRaiseException会调用KiDispatchException开始异常的分发。 





如果是由 KiDispatchException 进行那4步处理的话,显然 Ki 前缀已经进内核态了。

最新文章

  1. 【C#进阶系列】26 计算限制的异步操作
  2. AE笔记
  3. Linux TC (traffic control)
  4. chrome性能测试框架webpagereplay
  5. 学习使用Free RTOS ,移植最新的STM32 v3.5固件库
  6. C# 堆栈的数据结构 (二)
  7. 扩展欧几里德算法解二元一次方程之B - 青蛙的约会
  8. 基于visual Studio2013解决C语言竞赛题之1084完全平方数
  9. Dom2016/4/20
  10. 从.src.rpm包中提取出完整的源码的方法
  11. MongoDB基本命令操作
  12. 织梦在服务器上面安装的时候一直提示data文件没有权限,可我已经写了权限,还是提示
  13. 【iOS】OC-Quartz2D简单使用
  14. Mysql双主热备+LVS+Keepalived高可用部署实施手册
  15. 6.4 SpringData JPA的使用
  16. Android Studio Gradle依赖冲突
  17. hibernate框架(3)---持久化对象
  18. js 数组拷贝与深拷贝
  19. SVN Error:请求的名称有效并且在数据库中找到,但是它没有相关的正确的数据来被解析
  20. 【字符串区别】SQLServer中char、varchar、nchar、nvarchar的区别:

热门文章

  1. SpringMVC(AbstractController,拦截器,注解)
  2. 关于a[::-1]
  3. C++之运算符_算数运算符
  4. POJ 2763 /// 基于边权的树链剖分
  5. 在线文库解决方案Jacob+SwfTools+FlexPaper
  6. HLS 视频加密小记
  7. postman连接不了localhost问题解决
  8. hdu多校第四场1001 (hdu6614) AND Minimum Spanning Tree 签到
  9. 141 x的平方根
  10. Docker系列(六):Docker网络机制(下)