Find & replace Exception.SetErrorCode with Exception.HResult setter (dotnet/coreclr...
authorJan Kotas <jkotas@microsoft.com>
Fri, 7 Apr 2017 23:49:58 +0000 (16:49 -0700)
committerGitHub <noreply@github.com>
Fri, 7 Apr 2017 23:49:58 +0000 (16:49 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/a66ba16df26f1c8a311e2e2c2923e74f980f21f5

41 files changed:
src/coreclr/src/mscorlib/shared/System/TypeUnloadedException.cs
src/coreclr/src/mscorlib/src/System/AppDomainUnloadedException.cs
src/coreclr/src/mscorlib/src/System/ArgumentOutOfRangeException.cs
src/coreclr/src/mscorlib/src/System/BadImageFormatException.cs
src/coreclr/src/mscorlib/src/System/DllNotFoundException.cs
src/coreclr/src/mscorlib/src/System/Exception.cs
src/coreclr/src/mscorlib/src/System/IO/DirectoryNotFoundException.cs
src/coreclr/src/mscorlib/src/System/IO/DriveNotFoundException.cs
src/coreclr/src/mscorlib/src/System/IO/EndOfStreamException.cs
src/coreclr/src/mscorlib/src/System/IO/FileLoadException.CoreCLR.cs
src/coreclr/src/mscorlib/src/System/IO/FileNotFoundException.CoreCLR.cs
src/coreclr/src/mscorlib/src/System/IO/IOException.cs
src/coreclr/src/mscorlib/src/System/IO/PathTooLongException.cs
src/coreclr/src/mscorlib/src/System/InsufficientMemoryException.cs
src/coreclr/src/mscorlib/src/System/MissingFieldException.cs
src/coreclr/src/mscorlib/src/System/MissingMemberException.cs
src/coreclr/src/mscorlib/src/System/MissingMethodException.cs
src/coreclr/src/mscorlib/src/System/OperationCanceledException.cs
src/coreclr/src/mscorlib/src/System/OutOfMemoryException.cs
src/coreclr/src/mscorlib/src/System/Resources/MissingManifestResourceException.cs
src/coreclr/src/mscorlib/src/System/Resources/MissingSatelliteAssemblyException.cs
src/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs
src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/COMException.cs
src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/ExternalException.cs
src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/InvalidComObjectException.cs
src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs
src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/MarshalDirectiveException.cs
src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/SEHException.cs
src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs
src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs
src/coreclr/src/mscorlib/src/System/Runtime/Serialization/SerializationException.cs
src/coreclr/src/mscorlib/src/System/Security/VerificationException.cs
src/coreclr/src/mscorlib/src/System/Text/DecoderExceptionFallback.cs
src/coreclr/src/mscorlib/src/System/Text/EncoderExceptionFallback.cs
src/coreclr/src/mscorlib/src/System/Threading/AbandonedMutexException.cs
src/coreclr/src/mscorlib/src/System/Threading/SynchronizationLockException.cs
src/coreclr/src/mscorlib/src/System/Threading/ThreadInterruptedException.cs
src/coreclr/src/mscorlib/src/System/Threading/ThreadStartException.cs
src/coreclr/src/mscorlib/src/System/Threading/ThreadStateException.cs
src/coreclr/src/mscorlib/src/System/Threading/WaitHandleCannotBeOpenedException.cs
src/coreclr/src/mscorlib/src/System/TypeLoadException.cs

index a4fb452..33e4687 100644 (file)
@@ -12,19 +12,19 @@ namespace System
         public TypeUnloadedException()
             : base(SR.Arg_TypeUnloadedException)
         {
-            SetErrorCode(__HResults.COR_E_TYPEUNLOADED);
+            HResult = __HResults.COR_E_TYPEUNLOADED;
         }
 
         public TypeUnloadedException(string message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_TYPEUNLOADED);
+            HResult = __HResults.COR_E_TYPEUNLOADED;
         }
 
         public TypeUnloadedException(string message, Exception innerException)
             : base(message, innerException)
         {
-            SetErrorCode(__HResults.COR_E_TYPEUNLOADED);
+            HResult = __HResults.COR_E_TYPEUNLOADED;
         }
 
         //
index b11ae33..52cbb98 100644 (file)
@@ -22,7 +22,7 @@ namespace System
         public AppDomainUnloadedException()
             : base(SR.Arg_AppDomainUnloadedException)
         {
-            SetErrorCode(__HResults.COR_E_APPDOMAINUNLOADED);
+            HResult = __HResults.COR_E_APPDOMAINUNLOADED;
         }
 
         //
index a5f838a..9083781 100644 (file)
@@ -43,25 +43,25 @@ namespace System
         public ArgumentOutOfRangeException()
             : base(RangeMessage)
         {
-            SetErrorCode(__HResults.COR_E_ARGUMENTOUTOFRANGE);
+            HResult = __HResults.COR_E_ARGUMENTOUTOFRANGE;
         }
 
         public ArgumentOutOfRangeException(String paramName)
             : base(RangeMessage, paramName)
         {
-            SetErrorCode(__HResults.COR_E_ARGUMENTOUTOFRANGE);
+            HResult = __HResults.COR_E_ARGUMENTOUTOFRANGE;
         }
 
         public ArgumentOutOfRangeException(String paramName, String message)
             : base(message, paramName)
         {
-            SetErrorCode(__HResults.COR_E_ARGUMENTOUTOFRANGE);
+            HResult = __HResults.COR_E_ARGUMENTOUTOFRANGE;
         }
 
         public ArgumentOutOfRangeException(String message, Exception innerException)
             : base(message, innerException)
         {
-            SetErrorCode(__HResults.COR_E_ARGUMENTOUTOFRANGE);
+            HResult = __HResults.COR_E_ARGUMENTOUTOFRANGE;
         }
 
         // We will not use this in the classlibs, but we'll provide it for
@@ -71,7 +71,7 @@ namespace System
             : base(message, paramName)
         {
             m_actualValue = actualValue;
-            SetErrorCode(__HResults.COR_E_ARGUMENTOUTOFRANGE);
+            HResult = __HResults.COR_E_ARGUMENTOUTOFRANGE;
         }
 
         public override String Message
index 9cb692f..42005cc 100644 (file)
@@ -28,31 +28,31 @@ namespace System
         public BadImageFormatException()
             : base(SR.Arg_BadImageFormatException)
         {
-            SetErrorCode(__HResults.COR_E_BADIMAGEFORMAT);
+            HResult = __HResults.COR_E_BADIMAGEFORMAT;
         }
 
         public BadImageFormatException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_BADIMAGEFORMAT);
+            HResult = __HResults.COR_E_BADIMAGEFORMAT;
         }
 
         public BadImageFormatException(String message, Exception inner)
             : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_BADIMAGEFORMAT);
+            HResult = __HResults.COR_E_BADIMAGEFORMAT;
         }
 
         public BadImageFormatException(String message, String fileName) : base(message)
         {
-            SetErrorCode(__HResults.COR_E_BADIMAGEFORMAT);
+            HResult = __HResults.COR_E_BADIMAGEFORMAT;
             _fileName = fileName;
         }
 
         public BadImageFormatException(String message, String fileName, Exception inner)
             : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_BADIMAGEFORMAT);
+            HResult = __HResults.COR_E_BADIMAGEFORMAT;
             _fileName = fileName;
         }
 
@@ -130,7 +130,7 @@ namespace System
         private BadImageFormatException(String fileName, String fusionLog, int hResult)
             : base(null)
         {
-            SetErrorCode(hResult);
+            HResult = hResult;
             _fileName = fileName;
             _fusionLog = fusionLog;
             SetMessageField();
index dd0f27e..a3b46c7 100644 (file)
@@ -23,19 +23,19 @@ namespace System
         public DllNotFoundException()
             : base(SR.Arg_DllNotFoundException)
         {
-            SetErrorCode(__HResults.COR_E_DLLNOTFOUND);
+            HResult = __HResults.COR_E_DLLNOTFOUND;
         }
 
         public DllNotFoundException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_DLLNOTFOUND);
+            HResult = __HResults.COR_E_DLLNOTFOUND;
         }
 
         public DllNotFoundException(String message, Exception inner)
             : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_DLLNOTFOUND);
+            HResult = __HResults.COR_E_DLLNOTFOUND;
         }
 
         protected DllNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
index 61e8a41..263b6b3 100644 (file)
@@ -864,7 +864,7 @@ namespace System
         public CrossAppDomainMarshaledException(String message, int errorCode)
             : base(message)
         {
-            SetErrorCode(errorCode);
+            HResult = errorCode;
         }
 
         // Normally, only Telesto's UEF will see these exceptions.
index 1cc6cc4..83ddf60 100644 (file)
@@ -30,19 +30,19 @@ namespace System.IO
         public DirectoryNotFoundException()
             : base(SR.Arg_DirectoryNotFoundException)
         {
-            SetErrorCode(__HResults.COR_E_DIRECTORYNOTFOUND);
+            HResult = __HResults.COR_E_DIRECTORYNOTFOUND;
         }
 
         public DirectoryNotFoundException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_DIRECTORYNOTFOUND);
+            HResult = __HResults.COR_E_DIRECTORYNOTFOUND;
         }
 
         public DirectoryNotFoundException(String message, Exception innerException)
             : base(message, innerException)
         {
-            SetErrorCode(__HResults.COR_E_DIRECTORYNOTFOUND);
+            HResult = __HResults.COR_E_DIRECTORYNOTFOUND;
         }
 
         protected DirectoryNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
index c48d7ac..27b6f90 100644 (file)
@@ -23,13 +23,13 @@ namespace System.IO
         public DriveNotFoundException()
             : base(SR.Arg_DriveNotFoundException)
         {
-            SetErrorCode(__HResults.COR_E_DIRECTORYNOTFOUND);
+            HResult = __HResults.COR_E_DIRECTORYNOTFOUND;
         }
 
         public DriveNotFoundException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_DIRECTORYNOTFOUND);
+            HResult = __HResults.COR_E_DIRECTORYNOTFOUND;
         }
 
         protected DriveNotFoundException(SerializationInfo info, StreamingContext context) : base(info, context)
index 1eb1664..a0e197a 100644 (file)
@@ -24,19 +24,19 @@ namespace System.IO
         public EndOfStreamException()
             : base(SR.Arg_EndOfStreamException)
         {
-            SetErrorCode(__HResults.COR_E_ENDOFSTREAM);
+            HResult = __HResults.COR_E_ENDOFSTREAM;
         }
 
         public EndOfStreamException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_ENDOFSTREAM);
+            HResult = __HResults.COR_E_ENDOFSTREAM;
         }
 
         public EndOfStreamException(String message, Exception innerException)
             : base(message, innerException)
         {
-            SetErrorCode(__HResults.COR_E_ENDOFSTREAM);
+            HResult = __HResults.COR_E_ENDOFSTREAM;
         }
 
         protected EndOfStreamException(SerializationInfo info, StreamingContext context) : base(info, context)
index 18bd82f..f641567 100644 (file)
@@ -15,7 +15,7 @@ namespace System.IO
         private FileLoadException(string fileName, string fusionLog, int hResult)
             : base(null)
         {
-            SetErrorCode(hResult);
+            HResult = hResult;
             FileName = fileName;
             FusionLog = fusionLog;
             _message = FormatFileLoadExceptionMessage(FileName, HResult);
index dbcc690..99645f0 100644 (file)
@@ -10,7 +10,7 @@ namespace System.IO
         private FileNotFoundException(string fileName, string fusionLog, int hResult)
             : base(null)
         {
-            SetErrorCode(hResult);
+            HResult = hResult;
             FileName = fileName;
             FusionLog = fusionLog;
             SetMessageField();
index a91d891..2628f7b 100644 (file)
@@ -35,19 +35,19 @@ namespace System.IO
         public IOException()
             : base(SR.Arg_IOException)
         {
-            SetErrorCode(__HResults.COR_E_IO);
+            HResult = __HResults.COR_E_IO;
         }
 
         public IOException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_IO);
+            HResult = __HResults.COR_E_IO;
         }
 
         public IOException(String message, int hresult)
             : base(message)
         {
-            SetErrorCode(hresult);
+            HResult = hresult;
         }
 
         // Adding this for debuggers when looking at exceptions in partial
@@ -56,14 +56,14 @@ namespace System.IO
         internal IOException(String message, int hresult, String maybeFullPath)
             : base(message)
         {
-            SetErrorCode(hresult);
+            HResult = hresult;
             _maybeFullPath = maybeFullPath;
         }
 
         public IOException(String message, Exception innerException)
             : base(message, innerException)
         {
-            SetErrorCode(__HResults.COR_E_IO);
+            HResult = __HResults.COR_E_IO;
         }
 
         protected IOException(SerializationInfo info, StreamingContext context) : base(info, context)
index a0f176c..156c836 100644 (file)
@@ -25,19 +25,19 @@ namespace System.IO
         public PathTooLongException()
             : base(SR.IO_PathTooLong)
         {
-            SetErrorCode(__HResults.COR_E_PATHTOOLONG);
+            HResult = __HResults.COR_E_PATHTOOLONG;
         }
 
         public PathTooLongException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_PATHTOOLONG);
+            HResult = __HResults.COR_E_PATHTOOLONG;
         }
 
         public PathTooLongException(String message, Exception innerException)
             : base(message, innerException)
         {
-            SetErrorCode(__HResults.COR_E_PATHTOOLONG);
+            HResult = __HResults.COR_E_PATHTOOLONG;
         }
 
         protected PathTooLongException(SerializationInfo info, StreamingContext context) : base(info, context)
index cd963e8..eb5e4d7 100644 (file)
@@ -28,19 +28,19 @@ namespace System
         public InsufficientMemoryException()
             : base(GetMessageFromNativeResources(ExceptionMessageKind.OutOfMemory))
         {
-            SetErrorCode(__HResults.COR_E_INSUFFICIENTMEMORY);
+            HResult = __HResults.COR_E_INSUFFICIENTMEMORY;
         }
 
         public InsufficientMemoryException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_INSUFFICIENTMEMORY);
+            HResult = __HResults.COR_E_INSUFFICIENTMEMORY;
         }
 
         public InsufficientMemoryException(String message, Exception innerException)
             : base(message, innerException)
         {
-            SetErrorCode(__HResults.COR_E_INSUFFICIENTMEMORY);
+            HResult = __HResults.COR_E_INSUFFICIENTMEMORY;
         }
 
         private InsufficientMemoryException(SerializationInfo info, StreamingContext context) : base(info, context)
index 65a9726..5668f9e 100644 (file)
@@ -24,19 +24,19 @@ namespace System
         public MissingFieldException()
             : base(SR.Arg_MissingFieldException)
         {
-            SetErrorCode(__HResults.COR_E_MISSINGFIELD);
+            HResult = __HResults.COR_E_MISSINGFIELD;
         }
 
         public MissingFieldException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_MISSINGFIELD);
+            HResult = __HResults.COR_E_MISSINGFIELD;
         }
 
         public MissingFieldException(String message, Exception inner)
             : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_MISSINGFIELD);
+            HResult = __HResults.COR_E_MISSINGFIELD;
         }
 
         protected MissingFieldException(SerializationInfo info, StreamingContext context) : base(info, context)
index d40aa53..51150e1 100644 (file)
@@ -28,19 +28,19 @@ namespace System
         public MissingMemberException()
             : base(SR.Arg_MissingMemberException)
         {
-            SetErrorCode(__HResults.COR_E_MISSINGMEMBER);
+            HResult = __HResults.COR_E_MISSINGMEMBER;
         }
 
         public MissingMemberException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_MISSINGMEMBER);
+            HResult = __HResults.COR_E_MISSINGMEMBER;
         }
 
         public MissingMemberException(String message, Exception inner)
             : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_MISSINGMEMBER);
+            HResult = __HResults.COR_E_MISSINGMEMBER;
         }
 
         protected MissingMemberException(SerializationInfo info, StreamingContext context) : base(info, context)
index c17ab8e..580ec42 100644 (file)
@@ -26,19 +26,19 @@ namespace System
         public MissingMethodException()
             : base(SR.Arg_MissingMethodException)
         {
-            SetErrorCode(__HResults.COR_E_MISSINGMETHOD);
+            HResult = __HResults.COR_E_MISSINGMETHOD;
         }
 
         public MissingMethodException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_MISSINGMETHOD);
+            HResult = __HResults.COR_E_MISSINGMETHOD;
         }
 
         public MissingMethodException(String message, Exception inner)
             : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_MISSINGMETHOD);
+            HResult = __HResults.COR_E_MISSINGMETHOD;
         }
 
         protected MissingMethodException(SerializationInfo info, StreamingContext context) : base(info, context)
index 1afd59b..8265617 100644 (file)
@@ -32,19 +32,19 @@ namespace System
         public OperationCanceledException()
             : base(SR.OperationCanceled)
         {
-            SetErrorCode(__HResults.COR_E_OPERATIONCANCELED);
+            HResult = __HResults.COR_E_OPERATIONCANCELED;
         }
 
         public OperationCanceledException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_OPERATIONCANCELED);
+            HResult = __HResults.COR_E_OPERATIONCANCELED;
         }
 
         public OperationCanceledException(String message, Exception innerException)
             : base(message, innerException)
         {
-            SetErrorCode(__HResults.COR_E_OPERATIONCANCELED);
+            HResult = __HResults.COR_E_OPERATIONCANCELED;
         }
 
 
index a432758..154d0f9 100644 (file)
@@ -23,19 +23,19 @@ namespace System
         public OutOfMemoryException()
             : base(GetMessageFromNativeResources(ExceptionMessageKind.OutOfMemory))
         {
-            SetErrorCode(__HResults.COR_E_OUTOFMEMORY);
+            HResult = __HResults.COR_E_OUTOFMEMORY;
         }
 
         public OutOfMemoryException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_OUTOFMEMORY);
+            HResult = __HResults.COR_E_OUTOFMEMORY;
         }
 
         public OutOfMemoryException(String message, Exception innerException)
             : base(message, innerException)
         {
-            SetErrorCode(__HResults.COR_E_OUTOFMEMORY);
+            HResult = __HResults.COR_E_OUTOFMEMORY;
         }
 
         protected OutOfMemoryException(SerializationInfo info, StreamingContext context) : base(info, context)
index fd3c5b9..c2a55cd 100644 (file)
@@ -24,19 +24,19 @@ namespace System.Resources
         public MissingManifestResourceException()
             : base(SR.Arg_MissingManifestResourceException)
         {
-            SetErrorCode(System.__HResults.COR_E_MISSINGMANIFESTRESOURCE);
+            HResult = System.__HResults.COR_E_MISSINGMANIFESTRESOURCE;
         }
 
         public MissingManifestResourceException(String message)
             : base(message)
         {
-            SetErrorCode(System.__HResults.COR_E_MISSINGMANIFESTRESOURCE);
+            HResult = System.__HResults.COR_E_MISSINGMANIFESTRESOURCE;
         }
 
         public MissingManifestResourceException(String message, Exception inner)
             : base(message, inner)
         {
-            SetErrorCode(System.__HResults.COR_E_MISSINGMANIFESTRESOURCE);
+            HResult = System.__HResults.COR_E_MISSINGMANIFESTRESOURCE;
         }
 
         protected MissingManifestResourceException(SerializationInfo info, StreamingContext context) : base(info, context)
index 5f927f4..df94f9e 100644 (file)
@@ -28,26 +28,26 @@ namespace System.Resources
         public MissingSatelliteAssemblyException()
             : base(SR.MissingSatelliteAssembly_Default)
         {
-            SetErrorCode(System.__HResults.COR_E_MISSINGSATELLITEASSEMBLY);
+            HResult = System.__HResults.COR_E_MISSINGSATELLITEASSEMBLY;
         }
 
         public MissingSatelliteAssemblyException(String message)
             : base(message)
         {
-            SetErrorCode(System.__HResults.COR_E_MISSINGSATELLITEASSEMBLY);
+            HResult = System.__HResults.COR_E_MISSINGSATELLITEASSEMBLY;
         }
 
         public MissingSatelliteAssemblyException(String message, String cultureName)
             : base(message)
         {
-            SetErrorCode(System.__HResults.COR_E_MISSINGSATELLITEASSEMBLY);
+            HResult = System.__HResults.COR_E_MISSINGSATELLITEASSEMBLY;
             _cultureName = cultureName;
         }
 
         public MissingSatelliteAssemblyException(String message, Exception inner)
             : base(message, inner)
         {
-            SetErrorCode(System.__HResults.COR_E_MISSINGSATELLITEASSEMBLY);
+            HResult = System.__HResults.COR_E_MISSINGSATELLITEASSEMBLY;
         }
 
         protected MissingSatelliteAssemblyException(SerializationInfo info, StreamingContext context) : base(info, context)
index dc27a65..c050000 100644 (file)
@@ -24,7 +24,7 @@ namespace System.Runtime.CompilerServices
         private RuntimeWrappedException(Object thrownObject)
             : base(SR.RuntimeWrappedException)
         {
-            SetErrorCode(System.__HResults.COR_E_RUNTIMEWRAPPED);
+            HResult = System.__HResults.COR_E_RUNTIMEWRAPPED;
             m_wrappedException = thrownObject;
         }
 
index f8fcfb5..889a74f 100644 (file)
@@ -28,25 +28,25 @@ namespace System.Runtime.InteropServices
         public COMException()
             : base(SR.Arg_COMException)
         {
-            SetErrorCode(__HResults.E_FAIL);
+            HResult = __HResults.E_FAIL;
         }
 
         public COMException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.E_FAIL);
+            HResult = __HResults.E_FAIL;
         }
 
         public COMException(String message, Exception inner)
             : base(message, inner)
         {
-            SetErrorCode(__HResults.E_FAIL);
+            HResult = __HResults.E_FAIL;
         }
 
         public COMException(String message, int errorCode)
             : base(message)
         {
-            SetErrorCode(errorCode);
+            HResult = errorCode;
         }
 
         protected COMException(SerializationInfo info, StreamingContext context) : base(info, context)
index 323a9a6..bd6b2f8 100644 (file)
@@ -28,25 +28,25 @@ namespace System.Runtime.InteropServices
         public ExternalException()
             : base(SR.Arg_ExternalException)
         {
-            SetErrorCode(__HResults.E_FAIL);
+            HResult = __HResults.E_FAIL;
         }
 
         public ExternalException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.E_FAIL);
+            HResult = __HResults.E_FAIL;
         }
 
         public ExternalException(String message, Exception inner)
             : base(message, inner)
         {
-            SetErrorCode(__HResults.E_FAIL);
+            HResult = __HResults.E_FAIL;
         }
 
         public ExternalException(String message, int errorCode)
             : base(message)
         {
-            SetErrorCode(errorCode);
+            HResult = errorCode;
         }
 
         protected ExternalException(SerializationInfo info, StreamingContext context) : base(info, context)
index 5e26352..2fae2b6 100644 (file)
@@ -23,19 +23,19 @@ namespace System.Runtime.InteropServices
         public InvalidComObjectException()
             : base(SR.Arg_InvalidComObjectException)
         {
-            SetErrorCode(__HResults.COR_E_INVALIDCOMOBJECT);
+            HResult = __HResults.COR_E_INVALIDCOMOBJECT;
         }
 
         public InvalidComObjectException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_INVALIDCOMOBJECT);
+            HResult = __HResults.COR_E_INVALIDCOMOBJECT;
         }
 
         public InvalidComObjectException(String message, Exception inner)
             : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_INVALIDCOMOBJECT);
+            HResult = __HResults.COR_E_INVALIDCOMOBJECT;
         }
 
         protected InvalidComObjectException(SerializationInfo info, StreamingContext context) : base(info, context)
index 6e64418..5154a02 100644 (file)
@@ -22,19 +22,19 @@ namespace System.Runtime.InteropServices
         public InvalidOleVariantTypeException()
             : base(SR.Arg_InvalidOleVariantTypeException)
         {
-            SetErrorCode(__HResults.COR_E_INVALIDOLEVARIANTTYPE);
+            HResult = __HResults.COR_E_INVALIDOLEVARIANTTYPE;
         }
 
         public InvalidOleVariantTypeException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_INVALIDOLEVARIANTTYPE);
+            HResult = __HResults.COR_E_INVALIDOLEVARIANTTYPE;
         }
 
         public InvalidOleVariantTypeException(String message, Exception inner)
             : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_INVALIDOLEVARIANTTYPE);
+            HResult = __HResults.COR_E_INVALIDOLEVARIANTTYPE;
         }
 
         protected InvalidOleVariantTypeException(SerializationInfo info, StreamingContext context) : base(info, context)
index 4634ea8..6fe7574 100644 (file)
@@ -23,19 +23,19 @@ namespace System.Runtime.InteropServices
         public MarshalDirectiveException()
             : base(SR.Arg_MarshalDirectiveException)
         {
-            SetErrorCode(__HResults.COR_E_MARSHALDIRECTIVE);
+            HResult = __HResults.COR_E_MARSHALDIRECTIVE;
         }
 
         public MarshalDirectiveException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_MARSHALDIRECTIVE);
+            HResult = __HResults.COR_E_MARSHALDIRECTIVE;
         }
 
         public MarshalDirectiveException(String message, Exception inner)
             : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_MARSHALDIRECTIVE);
+            HResult = __HResults.COR_E_MARSHALDIRECTIVE;
         }
 
         protected MarshalDirectiveException(SerializationInfo info, StreamingContext context) : base(info, context)
index 915a194..5595fad 100644 (file)
@@ -25,19 +25,19 @@ namespace System.Runtime.InteropServices
         public SEHException()
             : base()
         {
-            SetErrorCode(__HResults.E_FAIL);
+            HResult = __HResults.E_FAIL;
         }
 
         public SEHException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.E_FAIL);
+            HResult = __HResults.E_FAIL;
         }
 
         public SEHException(String message, Exception inner)
             : base(message, inner)
         {
-            SetErrorCode(__HResults.E_FAIL);
+            HResult = __HResults.E_FAIL;
         }
 
         protected SEHException(SerializationInfo info, StreamingContext context) : base(info, context)
index 96bbdd7..f39f1f3 100644 (file)
@@ -22,19 +22,19 @@ namespace System.Runtime.InteropServices
         public SafeArrayRankMismatchException()
             : base(SR.Arg_SafeArrayRankMismatchException)
         {
-            SetErrorCode(__HResults.COR_E_SAFEARRAYRANKMISMATCH);
+            HResult = __HResults.COR_E_SAFEARRAYRANKMISMATCH;
         }
 
         public SafeArrayRankMismatchException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_SAFEARRAYRANKMISMATCH);
+            HResult = __HResults.COR_E_SAFEARRAYRANKMISMATCH;
         }
 
         public SafeArrayRankMismatchException(String message, Exception inner)
             : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_SAFEARRAYRANKMISMATCH);
+            HResult = __HResults.COR_E_SAFEARRAYRANKMISMATCH;
         }
 
         protected SafeArrayRankMismatchException(SerializationInfo info, StreamingContext context) : base(info, context)
index 2ec2f9e..2283263 100644 (file)
@@ -23,19 +23,19 @@ namespace System.Runtime.InteropServices
         public SafeArrayTypeMismatchException()
             : base(SR.Arg_SafeArrayTypeMismatchException)
         {
-            SetErrorCode(__HResults.COR_E_SAFEARRAYTYPEMISMATCH);
+            HResult = __HResults.COR_E_SAFEARRAYTYPEMISMATCH;
         }
 
         public SafeArrayTypeMismatchException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_SAFEARRAYTYPEMISMATCH);
+            HResult = __HResults.COR_E_SAFEARRAYTYPEMISMATCH;
         }
 
         public SafeArrayTypeMismatchException(String message, Exception inner)
             : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_SAFEARRAYTYPEMISMATCH);
+            HResult = __HResults.COR_E_SAFEARRAYTYPEMISMATCH;
         }
 
         protected SafeArrayTypeMismatchException(SerializationInfo info, StreamingContext context) : base(info, context)
index 7f2d275..48de8a7 100644 (file)
@@ -28,18 +28,18 @@ namespace System.Runtime.Serialization
         public SerializationException()
             : base(_nullMessage)
         {
-            SetErrorCode(__HResults.COR_E_SERIALIZATION);
+            HResult = __HResults.COR_E_SERIALIZATION;
         }
 
         public SerializationException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_SERIALIZATION);
+            HResult = __HResults.COR_E_SERIALIZATION;
         }
 
         public SerializationException(String message, Exception innerException) : base(message, innerException)
         {
-            SetErrorCode(__HResults.COR_E_SERIALIZATION);
+            HResult = __HResults.COR_E_SERIALIZATION;
         }
 
         protected SerializationException(SerializationInfo info, StreamingContext context) : base(info, context)
index 6f70dcd..0cea0ec 100644 (file)
@@ -16,19 +16,19 @@ namespace System.Security
         public VerificationException()
             : base(SR.Verification_Exception)
         {
-            SetErrorCode(__HResults.COR_E_VERIFICATION);
+            HResult = __HResults.COR_E_VERIFICATION;
         }
 
         public VerificationException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_VERIFICATION);
+            HResult = __HResults.COR_E_VERIFICATION;
         }
 
         public VerificationException(String message, Exception innerException)
             : base(message, innerException)
         {
-            SetErrorCode(__HResults.COR_E_VERIFICATION);
+            HResult = __HResults.COR_E_VERIFICATION;
         }
 
         protected VerificationException(SerializationInfo info, StreamingContext context) : base(info, context)
index e319e15..b98ef74 100644 (file)
@@ -108,19 +108,19 @@ namespace System.Text
         public DecoderFallbackException()
             : base(SR.Arg_ArgumentException)
         {
-            SetErrorCode(__HResults.COR_E_ARGUMENT);
+            HResult = __HResults.COR_E_ARGUMENT;
         }
 
         public DecoderFallbackException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_ARGUMENT);
+            HResult = __HResults.COR_E_ARGUMENT;
         }
 
         public DecoderFallbackException(String message, Exception innerException)
             : base(message, innerException)
         {
-            SetErrorCode(__HResults.COR_E_ARGUMENT);
+            HResult = __HResults.COR_E_ARGUMENT;
         }
 
         internal DecoderFallbackException(SerializationInfo info, StreamingContext context) : base(info, context)
index 251b4b4..b75847d 100644 (file)
@@ -110,19 +110,19 @@ namespace System.Text
         public EncoderFallbackException()
             : base(SR.Arg_ArgumentException)
         {
-            SetErrorCode(__HResults.COR_E_ARGUMENT);
+            HResult = __HResults.COR_E_ARGUMENT;
         }
 
         public EncoderFallbackException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_ARGUMENT);
+            HResult = __HResults.COR_E_ARGUMENT;
         }
 
         public EncoderFallbackException(String message, Exception innerException)
             : base(message, innerException)
         {
-            SetErrorCode(__HResults.COR_E_ARGUMENT);
+            HResult = __HResults.COR_E_ARGUMENT;
         }
 
         internal EncoderFallbackException(SerializationInfo info, StreamingContext context) : base(info, context)
index bbc1a67..60808ad 100644 (file)
@@ -27,39 +27,39 @@ namespace System.Threading
         public AbandonedMutexException()
             : base(SR.Threading_AbandonedMutexException)
         {
-            SetErrorCode(__HResults.COR_E_ABANDONEDMUTEX);
+            HResult = __HResults.COR_E_ABANDONEDMUTEX;
         }
 
         public AbandonedMutexException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_ABANDONEDMUTEX);
+            HResult = __HResults.COR_E_ABANDONEDMUTEX;
         }
 
         public AbandonedMutexException(String message, Exception inner)
             : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_ABANDONEDMUTEX);
+            HResult = __HResults.COR_E_ABANDONEDMUTEX;
         }
 
         public AbandonedMutexException(int location, WaitHandle handle)
             : base(SR.Threading_AbandonedMutexException)
         {
-            SetErrorCode(__HResults.COR_E_ABANDONEDMUTEX);
+            HResult = __HResults.COR_E_ABANDONEDMUTEX;
             SetupException(location, handle);
         }
 
         public AbandonedMutexException(String message, int location, WaitHandle handle)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_ABANDONEDMUTEX);
+            HResult = __HResults.COR_E_ABANDONEDMUTEX;
             SetupException(location, handle);
         }
 
         public AbandonedMutexException(String message, Exception inner, int location, WaitHandle handle)
             : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_ABANDONEDMUTEX);
+            HResult = __HResults.COR_E_ABANDONEDMUTEX;
             SetupException(location, handle);
         }
 
index a3b8cb4..42892fe 100644 (file)
@@ -25,19 +25,19 @@ namespace System.Threading
         public SynchronizationLockException()
             : base(SR.Arg_SynchronizationLockException)
         {
-            SetErrorCode(__HResults.COR_E_SYNCHRONIZATIONLOCK);
+            HResult = __HResults.COR_E_SYNCHRONIZATIONLOCK;
         }
 
         public SynchronizationLockException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_SYNCHRONIZATIONLOCK);
+            HResult = __HResults.COR_E_SYNCHRONIZATIONLOCK;
         }
 
         public SynchronizationLockException(String message, Exception innerException)
             : base(message, innerException)
         {
-            SetErrorCode(__HResults.COR_E_SYNCHRONIZATIONLOCK);
+            HResult = __HResults.COR_E_SYNCHRONIZATIONLOCK;
         }
 
         protected SynchronizationLockException(SerializationInfo info, StreamingContext context) : base(info, context)
index 2a0772d..9122df0 100644 (file)
@@ -25,19 +25,19 @@ namespace System.Threading
         public ThreadInterruptedException()
             : base(GetMessageFromNativeResources(ExceptionMessageKind.ThreadInterrupted))
         {
-            SetErrorCode(__HResults.COR_E_THREADINTERRUPTED);
+            HResult = __HResults.COR_E_THREADINTERRUPTED;
         }
 
         public ThreadInterruptedException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_THREADINTERRUPTED);
+            HResult = __HResults.COR_E_THREADINTERRUPTED;
         }
 
         public ThreadInterruptedException(String message, Exception innerException)
             : base(message, innerException)
         {
-            SetErrorCode(__HResults.COR_E_THREADINTERRUPTED);
+            HResult = __HResults.COR_E_THREADINTERRUPTED;
         }
 
         protected ThreadInterruptedException(SerializationInfo info, StreamingContext context) : base(info, context)
index 27a0d57..54ec4ba 100644 (file)
@@ -16,13 +16,13 @@ namespace System.Threading
         private ThreadStartException()
             : base(SR.Arg_ThreadStartException)
         {
-            SetErrorCode(__HResults.COR_E_THREADSTART);
+            HResult = __HResults.COR_E_THREADSTART;
         }
 
         private ThreadStartException(Exception reason)
             : base(SR.Arg_ThreadStartException, reason)
         {
-            SetErrorCode(__HResults.COR_E_THREADSTART);
+            HResult = __HResults.COR_E_THREADSTART;
         }
 
         //required for serialization
index 9e1cc1d..a2b8b15 100644 (file)
@@ -24,19 +24,19 @@ namespace System.Threading
         public ThreadStateException()
             : base(SR.Arg_ThreadStateException)
         {
-            SetErrorCode(__HResults.COR_E_THREADSTATE);
+            HResult = __HResults.COR_E_THREADSTATE;
         }
 
         public ThreadStateException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_THREADSTATE);
+            HResult = __HResults.COR_E_THREADSTATE;
         }
 
         public ThreadStateException(String message, Exception innerException)
             : base(message, innerException)
         {
-            SetErrorCode(__HResults.COR_E_THREADSTATE);
+            HResult = __HResults.COR_E_THREADSTATE;
         }
 
         protected ThreadStateException(SerializationInfo info, StreamingContext context) : base(info, context)
index 7bc6e28..a6f0267 100644 (file)
@@ -17,17 +17,17 @@ namespace System.Threading
     {
         public WaitHandleCannotBeOpenedException() : base(SR.Threading_WaitHandleCannotBeOpenedException)
         {
-            SetErrorCode(__HResults.COR_E_WAITHANDLECANNOTBEOPENED);
+            HResult = __HResults.COR_E_WAITHANDLECANNOTBEOPENED;
         }
 
         public WaitHandleCannotBeOpenedException(String message) : base(message)
         {
-            SetErrorCode(__HResults.COR_E_WAITHANDLECANNOTBEOPENED);
+            HResult = __HResults.COR_E_WAITHANDLECANNOTBEOPENED;
         }
 
         public WaitHandleCannotBeOpenedException(String message, Exception innerException) : base(message, innerException)
         {
-            SetErrorCode(__HResults.COR_E_WAITHANDLECANNOTBEOPENED);
+            HResult = __HResults.COR_E_WAITHANDLECANNOTBEOPENED;
         }
 
         protected WaitHandleCannotBeOpenedException(SerializationInfo info, StreamingContext context) : base(info, context)
index c09d3e1..85e1da5 100644 (file)
@@ -29,19 +29,19 @@ namespace System
         public TypeLoadException()
             : base(SR.Arg_TypeLoadException)
         {
-            SetErrorCode(__HResults.COR_E_TYPELOAD);
+            HResult = __HResults.COR_E_TYPELOAD;
         }
 
         public TypeLoadException(String message)
             : base(message)
         {
-            SetErrorCode(__HResults.COR_E_TYPELOAD);
+            HResult = __HResults.COR_E_TYPELOAD;
         }
 
         public TypeLoadException(String message, Exception inner)
             : base(message, inner)
         {
-            SetErrorCode(__HResults.COR_E_TYPELOAD);
+            HResult = __HResults.COR_E_TYPELOAD;
         }
 
         public override String Message
@@ -93,7 +93,7 @@ namespace System
                                   int resourceId)
         : base(null)
         {
-            SetErrorCode(__HResults.COR_E_TYPELOAD);
+            HResult = __HResults.COR_E_TYPELOAD;
             ClassName = className;
             AssemblyName = assemblyName;
             MessageArg = messageArg;