添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
public ref class SEHException : Exception
public ref class SEHException : System::Runtime::InteropServices::ExternalException
public class SEHException : Exception
public class SEHException : System.Runtime.InteropServices.ExternalException
[System.Serializable]
public class SEHException : System.Runtime.InteropServices.ExternalException
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public class SEHException : System.Runtime.InteropServices.ExternalException
type SEHException = class
    inherit Exception
type SEHException = class
    inherit ExternalException
[<System.Serializable>]
type SEHException = class
    inherit ExternalException
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type SEHException = class
    inherit ExternalException
Public Class SEHException
Inherits Exception
Public Class SEHException
Inherits ExternalException
SEHException

SEHException 处理从非托管代码引发但尚未映射到其他.NET Framework异常的 SEH 错误。 类 SEHException 还对应于 HRESULT E_FAIL (0x80004005) 。

.NET Framework经常遇到自动映射到托管等效项的非托管 SEH 异常。 有两种常见的非托管 SEH 异常:

  • STATUS_NO_MEMORY 异常会自动映射到 OutOfMemoryException 类。

  • STATUS_ACCESS_VIOLATION 异常自动映射,如下所示:

  • 如果 legacyNullReferencePolicy 应用 ,则所有访问冲突都映射到 NullReferenceException 类。

  • 如果尝试读取/写入的地址不在 JIT 编译的代码中,则会将异常映射到 AccessViolationException 类。

  • 如果尝试读取/写入的地址位于 JIT 编译的代码中,但它不在 OS Null 分区区域中,则会将异常映射到 AccessViolationException 类。

  • legacyNullReferencePolicy 如果没有 ,并且尝试读取/写入的地址位于 JIT 编译的代码和 OS Null 分区区域中,则会将异常映射到 NullReferenceException 类。

    默认情况下,任何未自动映射到特定异常的 SEH 异常都会映射到 SEHException 类。

    请注意, SEHException 类不会导致调用非托管 C++ 异常析构函数。 若要确保调用非托管 C++ 异常析构函数,请在 块中 catch 使用以下语法。

    Catch
         ' Handle catch here.
    End Try
    
    catch
         // Handle catch here.
    
    catch(…)
         // Handle catch here.
    			即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:https://aka.ms/ContentUserFeedback

    提交和查看相关反馈

  •