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 前缀已经进内核态了。

RasieException的更多相关文章

  1. SEH结构

    首先有几点问题 1.在后文中看到的PE的节中的配置信息表Load configuration是对SEH回调函数的注册,那么Exception Table是加载的什么信息. 2.什么时候走进系统异常,什 ...

随机推荐

  1. 面试总结【css篇】- 盒子模型

    题目:谈谈你对CSS盒模型的认识 (1) 基本概念:标准模型+IE模型   (2) 标准模型和IE模型区别 标准模型和IE模型的区别,就是宽度和高度的计算方式不同. 标准模型的宽度指的就是conten ...

  2. 逻辑回归,多分类推广算法softmax回归中

    转自http://ufldl.stanford.edu/wiki/index.php/Softmax%E5%9B%9E%E5%BD%92 简介 在本节中,我们介绍Softmax回归模型,该模型是log ...

  3. 《转》python数据类型

    转自 http://www.cnblogs.com/BeginMan/archive/2013/06/08/3125876.html 一.标准类型函数 cmp():比较大小 str():转换为字符串 ...

  4. 9.ActiveMQ理论

    一.首先说下什么是消息队列? 1.消息队列是在消息的传输过程中保存消息的容器. 二.为什么要用到消息队列? 主要原因是由于在高并发环境下,由于来不及同步处理,请求往往会发生堵塞,比如说,大量的inse ...

  5. docker删除常见命令

    $ docker stop $(docker ps -a | grep "Exited" | awk '{print $1 }') //停止容器 1b7067e19d6f a840 ...

  6. 计算a,b,c的排列组合

    递归实现,思路的确有点难得想: public void SortAll(List<string> list,int start,int end) { if (start==end) { f ...

  7. vba取局域网电脑共享文件夹下的Excel文件

    Private Sub CommandButton1_Click()    Dim xlapp1 As Excel.Application    Dim xlbook1 As Excel.Workbo ...

  8. [JZOJ3400] 【GDOI2014模拟】旅行

    题目 题目大意 给你一个图,让你选择权值和最小的边,使得\(1\)和\(n\),\(2\)和\(n-1\),--,\(K\)和\(n-K+1\)联通. \(K\leq 4\) 思考历程 一看到这题就觉 ...

  9. 深入解读阿里云数据库POLARDB核心功能会话读一致性

    POLARDB架构 我们知道,POLARDB是一个由多个节点构成的数据库集群,一个主节点,多个读节点.对外默认提供两个地址,一个是集群地址,一个是主地址,推荐使用集群地址,因为它具备读写分离功能可以把 ...

  10. BZOJ 1296(SCOI 2009) 粉刷匠

    1296: [SCOI2009]粉刷匠 Time Limit: 10 Sec Memory Limit: 162 MB Submit: 2544 Solved: 1466 [Submit][Statu ...