Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
372 lines (343 sloc) 21.5 KB
<Type Name="SEHException" FullName="System.Runtime.InteropServices.SEHException">
<TypeSignature Language="C#" Value="public class SEHException : System.Runtime.InteropServices.ExternalException" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi serializable beforefieldinit SEHException extends System.Runtime.InteropServices.ExternalException" />
<TypeSignature Language="DocId" Value="T:System.Runtime.InteropServices.SEHException" />
<TypeSignature Language="VB.NET" Value="Public Class SEHException&#xA;Inherits ExternalException" />
<TypeSignature Language="C++ CLI" Value="public ref class SEHException : System::Runtime::InteropServices::ExternalException" />
<TypeSignature Language="F#" Value="type SEHException = class&#xA; inherit ExternalException" />
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Exception</BaseTypeName>
<BaseTypeName FrameworkAlternate="netframework-4.5">System.Runtime.InteropServices.ExternalException</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0">
<AttributeName>System.Serializable</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Represents structured exception handling (SEH) errors.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Runtime.InteropServices.SEHException> class handles SEH errors that are thrown from unmanaged code, but that have not been mapped to another .NET Framework exception. The <xref:System.Runtime.InteropServices.SEHException> class also corresponds to the `HRESULT` `E_FAIL` (0x80004005).
The .NET Framework often encounters unmanaged SEH exceptions that are automatically mapped to managed equivalents. There are two common unmanaged SEH exceptions:
- `STATUS_NO_MEMORY` exceptions are automatically mapped to the <xref:System.OutOfMemoryException> class.
- `STATUS_ACCESS_VIOLATION` exceptions are automatically mapped as follows:
- If `legacyNullReferencePolicy` is applied, all access violations are mapped to the <xref:System.NullReferenceException> class.
- If the address at which the read/write was attempted is not in JIT-compiled code, the exception is mapped to the <xref:System.AccessViolationException> class.
- If the address at which the read/write was attempted is in JIT-compiled code, but it is not in the OS Null partition area, the exception is mapped to the <xref:System.AccessViolationException> class.
- If there is no `legacyNullReferencePolicy`, and the address at which the read/write was attempted is in JIT-compiled code and in the OS Null partition area, the exception is mapped to the <xref:System.NullReferenceException> class.
Any SEH exception that is not automatically mapped to a specific exception is mapped to the <xref:System.Runtime.InteropServices.SEHException> class by default.
Note that the <xref:System.Runtime.InteropServices.SEHException> class does not cause unmanaged C++ exception destructors to be called. To ensure that unmanaged C++ exception destructors are called, use the following syntax in the `catch` block.
```vb
Catch
' Handle catch here.
End Try
```
```csharp
catch
{
// Handle catch here.
}
```
```cpp
catch(…)
{
// Handle catch here.
}
```
]]></format>
</remarks>
<altmember cref="T:System.Exception" />
<related type="Article" href="~/docs/standard/exceptions/index.md">Handling and throwing exceptions in .NET</related>
<related type="Article" href="~/docs/framework/interop/how-to-map-hresults-and-exceptions.md">How to: Map HRESULTs and Exceptions</related>
<related type="Article" href="/cpp/cpp/structured-exception-handling-c-cpp">Structured Exception Handling (C/C++)</related>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.SEHException" /> class.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public SEHException ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Runtime.InteropServices.SEHException.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; SEHException();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.SEHException" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Runtime.InteropServices.SEHException> class inherits from the <xref:System.Runtime.InteropServices.ExternalException> class. This constructor sets the properties of the <xref:System.Exception> object to the values in the following table.
|Property|Value|
|--------------|-----------|
|<xref:System.Exception.InnerException%2A>|A null reference (`Nothing` in Visual Basic).|
|<xref:System.Exception.Message%2A>|A localized error message string.|
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public SEHException (string message);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Runtime.InteropServices.SEHException.#ctor(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (message As String)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; SEHException(System::String ^ message);" />
<MemberSignature Language="F#" Value="new System.Runtime.InteropServices.SEHException : string -&gt; System.Runtime.InteropServices.SEHException" Usage="new System.Runtime.InteropServices.SEHException message" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="message" Type="System.String" />
</Parameters>
<Docs>
<param name="message">The message that indicates the reason for the exception.</param>
<summary>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.SEHException" /> class with a specified message.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Runtime.InteropServices.SEHException> inherits from <xref:System.Runtime.InteropServices.ExternalException>. This constructor sets the properties of the <xref:System.Exception> object as shown in the following table.
|Property|Value|
|--------------|-----------|
|<xref:System.Exception.InnerException%2A>|A null reference (`Nothing` in Visual Basic).|
|<xref:System.Exception.Message%2A>|`message`.|
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected SEHException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(class System.Runtime.Serialization.SerializationInfo info, valuetype System.Runtime.Serialization.StreamingContext context) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Runtime.InteropServices.SEHException.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />
<MemberSignature Language="VB.NET" Value="Protected Sub New (info As SerializationInfo, context As StreamingContext)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; SEHException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);" />
<MemberSignature Language="F#" Value="new System.Runtime.InteropServices.SEHException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -&gt; System.Runtime.InteropServices.SEHException" Usage="new System.Runtime.InteropServices.SEHException (info, context)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Security.SecuritySafeCritical</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="info" Type="System.Runtime.Serialization.SerializationInfo" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1;netcore-3.1" />
<Parameter Name="context" Type="System.Runtime.Serialization.StreamingContext" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1;netcore-3.1" />
</Parameters>
<Docs>
<param name="info">The object that holds the serialized object data.</param>
<param name="context">The contextual information about the source or destination.</param>
<summary>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.SEHException" /> class from serialization data.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This constructor is called during deserialization to reconstitute the exception object transmitted over a stream. For more information, see the <xref:System.Runtime.Serialization> namespace.
<xref:System.Runtime.InteropServices.SEHException> inherits from <xref:System.Runtime.InteropServices.ExternalException>.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="info" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public SEHException (string message, Exception inner);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(string message, class System.Exception inner) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Runtime.InteropServices.SEHException.#ctor(System.String,System.Exception)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (message As String, inner As Exception)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; SEHException(System::String ^ message, Exception ^ inner);" />
<MemberSignature Language="F#" Value="new System.Runtime.InteropServices.SEHException : string * Exception -&gt; System.Runtime.InteropServices.SEHException" Usage="new System.Runtime.InteropServices.SEHException (message, inner)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="message" Type="System.String" />
<Parameter Name="inner" Type="System.Exception" />
</Parameters>
<Docs>
<param name="message">The error message that explains the reason for the exception.</param>
<param name="inner">The exception that is the cause of the current exception. If the <paramref name="inner" /> parameter is not <see langword="null" />, the current exception is raised in a <see langword="catch" /> block that handles the inner exception.</param>
<summary>Initializes a new instance of the <see cref="T:System.Runtime.InteropServices.SEHException" /> class with a specified error message and a reference to the inner exception that is the cause of this exception.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
An exception that is thrown as a direct result of a previous exception should include a reference to the previous exception in the <xref:System.Exception.InnerException%2A> property. The <xref:System.Exception.InnerException%2A> property returns the same value that is passed into the constructor, or `null` if the <xref:System.Exception.InnerException%2A> property does not supply the inner exception value to the constructor.
The following table shows the initial property values for an instance of <xref:System.Runtime.InteropServices.SEHException>.
|Property|Value|
|--------------|-----------|
|<xref:System.Exception.InnerException%2A>|The inner exception reference.|
|<xref:System.Exception.Message%2A>|The error message string.|
]]></format>
</remarks>
<altmember cref="T:System.Exception" />
<related type="Article" href="~/docs/standard/exceptions/index.md">Handling and throwing exceptions in .NET</related>
</Docs>
</Member>
<Member MemberName="CanResume">
<MemberSignature Language="C#" Value="public virtual bool CanResume ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance bool CanResume() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Runtime.InteropServices.SEHException.CanResume" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function CanResume () As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual bool CanResume();" />
<MemberSignature Language="F#" Value="abstract member CanResume : unit -&gt; bool&#xA;override this.CanResume : unit -&gt; bool" Usage="sEHException.CanResume " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Runtime.InteropServices</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.0.20.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.2.1.0</AssemblyVersion>
<AssemblyVersion>4.2.2.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>mscorlib</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Indicates whether the exception can be recovered from, and whether the code can continue from the point at which the exception was thrown.</summary>
<returns>Always <see langword="false" />, because resumable exceptions are not implemented.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If <xref:System.Runtime.InteropServices.SEHException.CanResume%2A> returns `true`, then a filtered exception handler can correct the problem that caused the exception, and the code will continue from the point at which the exception was thrown.
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.