diff options
author | Viktor Hofer <viktor.hofer@microsoft.com> | 2017-10-17 21:06:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-17 21:06:43 +0300 |
commit | 4c0dde3a8178b4d2201c56c656c9c0ad5a34ac64 (patch) | |
tree | aa4d638330cb613f7e6ec096d5ad01f18a5a1888 /src/System.Private.Interop | |
parent | 223550f005d45c997d1dfb22e5e08c4a2777e91b (diff) |
Mirror changes from coreclr exception serialization (#4744)
Diffstat (limited to 'src/System.Private.Interop')
6 files changed, 12 insertions, 7 deletions
diff --git a/src/System.Private.Interop/src/Shared/ComException.cs b/src/System.Private.Interop/src/Shared/ComException.cs index aa325f2a2..0d78808a8 100644 --- a/src/System.Private.Interop/src/Shared/ComException.cs +++ b/src/System.Private.Interop/src/Shared/ComException.cs @@ -20,7 +20,8 @@ using System.Globalization; namespace System.Runtime.InteropServices { // Exception for COM Interop errors where we don't recognize the HResult. - // + [Serializable] + [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] public class COMException : ExternalException { internal COMException(int hr) @@ -50,7 +51,6 @@ namespace System.Runtime.InteropServices protected COMException(SerializationInfo info, StreamingContext context) : base(info, context) { - throw new PlatformNotSupportedException(); } public override String ToString() diff --git a/src/System.Private.Interop/src/System/Runtime/InteropServices/InvalidComObjectException.cs b/src/System.Private.Interop/src/System/Runtime/InteropServices/InvalidComObjectException.cs index 6837a7131..3d62cfc5e 100644 --- a/src/System.Private.Interop/src/System/Runtime/InteropServices/InvalidComObjectException.cs +++ b/src/System.Private.Interop/src/System/Runtime/InteropServices/InvalidComObjectException.cs @@ -17,6 +17,8 @@ using System.Runtime.Serialization; namespace System.Runtime.InteropServices { + [Serializable] + [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] public class InvalidComObjectException : SystemException { public InvalidComObjectException() @@ -40,7 +42,6 @@ namespace System.Runtime.InteropServices protected InvalidComObjectException(SerializationInfo info, StreamingContext context) : base(info, context) { - throw new PlatformNotSupportedException(); } } } diff --git a/src/System.Private.Interop/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs b/src/System.Private.Interop/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs index 6776e5923..d74ac6d38 100644 --- a/src/System.Private.Interop/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs +++ b/src/System.Private.Interop/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs @@ -20,6 +20,8 @@ using System.Runtime.Serialization; namespace System.Runtime.InteropServices { + [Serializable] + [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] public class InvalidOleVariantTypeException : SystemException { public InvalidOleVariantTypeException() @@ -43,7 +45,6 @@ namespace System.Runtime.InteropServices protected InvalidOleVariantTypeException(SerializationInfo info, StreamingContext context) : base(info, context) { - throw new PlatformNotSupportedException(); } } } diff --git a/src/System.Private.Interop/src/System/Runtime/InteropServices/SEHException.cs b/src/System.Private.Interop/src/System/Runtime/InteropServices/SEHException.cs index b53b60388..24f0f0455 100644 --- a/src/System.Private.Interop/src/System/Runtime/InteropServices/SEHException.cs +++ b/src/System.Private.Interop/src/System/Runtime/InteropServices/SEHException.cs @@ -17,6 +17,8 @@ using System.Runtime.Serialization; namespace System.Runtime.InteropServices { + [Serializable] + [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] public class SEHException : ExternalException { public SEHException() @@ -39,7 +41,6 @@ namespace System.Runtime.InteropServices protected SEHException(SerializationInfo info, StreamingContext context) : base(info, context) { - throw new PlatformNotSupportedException(); } // Exceptions can be resumable, meaning a filtered exception diff --git a/src/System.Private.Interop/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs b/src/System.Private.Interop/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs index 078897105..1f295686e 100644 --- a/src/System.Private.Interop/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs +++ b/src/System.Private.Interop/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs @@ -16,6 +16,8 @@ using System.Runtime.Serialization; namespace System.Runtime.InteropServices { + [Serializable] + [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] public class SafeArrayRankMismatchException : SystemException { public SafeArrayRankMismatchException() @@ -38,7 +40,6 @@ namespace System.Runtime.InteropServices protected SafeArrayRankMismatchException(SerializationInfo info, StreamingContext context) : base(info, context) { - throw new PlatformNotSupportedException(); } } } diff --git a/src/System.Private.Interop/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs b/src/System.Private.Interop/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs index 9d8178144..24e95836c 100644 --- a/src/System.Private.Interop/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs +++ b/src/System.Private.Interop/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs @@ -17,6 +17,8 @@ using System.Runtime.Serialization; namespace System.Runtime.InteropServices { + [Serializable] + [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] public class SafeArrayTypeMismatchException : SystemException { public SafeArrayTypeMismatchException() @@ -39,7 +41,6 @@ namespace System.Runtime.InteropServices protected SafeArrayTypeMismatchException(SerializationInfo info, StreamingContext context) : base(info, context) { - throw new PlatformNotSupportedException(); } } } |