From 33fc3843b550dab61b9f54ba25c1c5535c7a4133 Mon Sep 17 00:00:00 2001 From: xtqqczze Date: Sun, 8 Nov 2020 23:25:39 +0000 Subject: [PATCH 1/2] Revert changes to ComInterop src/System.Management.Automation/engine/ComInterop/ --- .../engine/ComInterop/ComInvokeBinder.cs | 2 +- .../engine/ComInterop/ExcepInfo.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/System.Management.Automation/engine/ComInterop/ComInvokeBinder.cs b/src/System.Management.Automation/engine/ComInterop/ComInvokeBinder.cs index ffa122e594e..6876425acf7 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComInvokeBinder.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComInvokeBinder.cs @@ -23,7 +23,7 @@ internal sealed class ComInvokeBinder private readonly bool[] _isByRef; private readonly Expression _instance; - private readonly BindingRestrictions _restrictions; + private BindingRestrictions _restrictions; private VarEnumSelector _varEnumSelector; private string[] _keywordArgNames; diff --git a/src/System.Management.Automation/engine/ComInterop/ExcepInfo.cs b/src/System.Management.Automation/engine/ComInterop/ExcepInfo.cs index a652e34a09d..4f829b6241d 100644 --- a/src/System.Management.Automation/engine/ComInterop/ExcepInfo.cs +++ b/src/System.Management.Automation/engine/ComInterop/ExcepInfo.cs @@ -15,15 +15,15 @@ namespace System.Management.Automation.ComInterop [StructLayout(LayoutKind.Sequential)] internal struct ExcepInfo { - private readonly short _wCode; + private short _wCode; private short _wReserved; private IntPtr _bstrSource; private IntPtr _bstrDescription; private IntPtr _bstrHelpFile; - private readonly int _dwHelpContext; - private readonly IntPtr _pvReserved; - private readonly IntPtr _pfnDeferredFillIn; - private readonly int _scode; + private int _dwHelpContext; + private IntPtr _pvReserved; + private IntPtr _pfnDeferredFillIn; + private int _scode; #if DEBUG static ExcepInfo() From 74258de34138e8c18a780e0bce65f9705645835d Mon Sep 17 00:00:00 2001 From: xtqqczze Date: Sun, 8 Nov 2020 23:26:10 +0000 Subject: [PATCH 2/2] Disable code analysis in ComInterop --- .../engine/ComInterop/.globalconfig | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/System.Management.Automation/engine/ComInterop/.globalconfig diff --git a/src/System.Management.Automation/engine/ComInterop/.globalconfig b/src/System.Management.Automation/engine/ComInterop/.globalconfig new file mode 100644 index 00000000000..fdb956e8529 --- /dev/null +++ b/src/System.Management.Automation/engine/ComInterop/.globalconfig @@ -0,0 +1,3 @@ +is_global = true + +dotnet_analyzer_diagnostic.severity = none