English 中文(简体)
特殊处理环境转换和SEH
原标题:Exception Handling Context Switching and SEH

我最近对“例外处理”和“网络框架”进行了一些阅读,这似乎在我开始的时候使我更加感到困惑。

在《刑法》中,《刑法》第4条第1款改为:

Also, the .NET Framework exception-handling mechanism is built using the Structured Exception Handling (SEH) mechanism offered by Microsoft Windows. SEH has been discussed in many resources, including my own book, Windows via C/C++, 5th ed. (Microsoft Press, 2007), which contains three chapters devoted to SEH.

现在,正是我开始混淆的地方。 如果“网络框架”是利用“SEH”建立起来的,但这一框架仅用于无操作的例外情况,或用于处理所有例外情形。 NET 如果是这样的话,该中心在什么地方适合、正在从SEH那里获得询问,还是自行行事,并且使用,如果和当unhandled例Occurs?

第二次 从Kerrnal模式向用户模式转变的情况如何合适? 我知道在什么时候形成了它(从中途经C#)

Thread environment block (TEB) The TEB is a block of memory allocated and initialized in user mode (address space that application code can quickly access). The TEB consumes 1 page of memory (4 KB on x86 and x64 CPUs, 8 KB on an IA64 CPU). The TEB contains the head of the thread’s exception-handling chain. Each try block that the thread enters inserts a node in the head of this chain; the node is removed from the chain when the thread exists in the try block. In addition, the TEB contains the thread’s thread-local storage data as well as some data structures for use by Graphics Device Interface (GDI) and OpenGL graphics.

AS, and theuser Mode Stack and The Kernel tempack. 但是,为什么在任何时刻都需要改变环境,因为它们需要一切才能处理?

问题回答

is [SEH] used right off the bat for all exception handling in .NET

是的。 排入“NET”的例外情况造成Win32的结构性例外。

为什么要改变环境,就必须在什么时候发生,因为需要处理的所有事情都处于同样的边缘?

When you throw an exception, your thread transitions to kernel mode and back, but only one thread is involved. Kernel mode is not a separate thread; it s a place that your thread can visit.

所有Win32例外情形均须通过斜体过渡。 例如,变幻莫测的基础设施生活在油轮式中,在你的用户模式代码看到这一例外之前,变幻器可能要拦截。





相关问题
Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How do I compare two decimals to 10 decimal places?

I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....

Exception practices when creating a SynchronizationContext?

I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...

Show running instance in single instance application

I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签