From 6c049d0cb3f19e0d47857396bacb3c74420268be Mon Sep 17 00:00:00 2001 From: Staffan Gustafsson Date: Mon, 11 Mar 2019 10:42:41 +0100 Subject: [PATCH] Using supported syntax for restoring warnings - VS2019 complains about enable. (#9107) --- src/Microsoft.PowerShell.Security/security/AclCommands.cs | 2 +- src/System.Management.Automation/engine/COM/ComUtil.cs | 2 +- src/System.Management.Automation/security/Authenticode.cs | 8 ++++---- .../security/nativeMethods.cs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Microsoft.PowerShell.Security/security/AclCommands.cs b/src/Microsoft.PowerShell.Security/security/AclCommands.cs index 576b0018e..731ff5dd7 100644 --- a/src/Microsoft.PowerShell.Security/security/AclCommands.cs +++ b/src/Microsoft.PowerShell.Security/security/AclCommands.cs @@ -188,7 +188,7 @@ namespace Microsoft.PowerShell.Commands // Get path return instance.Properties["PSPath"].Value.ToString(); -#pragma warning enable 56506 +#pragma warning restore 56506 } } diff --git a/src/System.Management.Automation/engine/COM/ComUtil.cs b/src/System.Management.Automation/engine/COM/ComUtil.cs index e23839c6f..73a184e15 100644 --- a/src/System.Management.Automation/engine/COM/ComUtil.cs +++ b/src/System.Management.Automation/engine/COM/ComUtil.cs @@ -315,7 +315,7 @@ namespace System.Management.Automation ElementDescriptionPointer = (IntPtr)(ElementDescriptionArrayPtr.ToInt64() + ElementDescriptionArrayByteOffset); } -#pragma warning enable 56515 +#pragma warning restore 56515 ElementDescription = Marshal.PtrToStructure(ElementDescriptionPointer); diff --git a/src/System.Management.Automation/security/Authenticode.cs b/src/System.Management.Automation/security/Authenticode.cs index 92ec5c5cf..1b809231c 100644 --- a/src/System.Management.Automation/security/Authenticode.cs +++ b/src/System.Management.Automation/security/Authenticode.cs @@ -190,7 +190,7 @@ namespace System.Management.Automation IntPtr.Zero, pSignInfo, IntPtr.Zero); -#pragma warning enable 56523 +#pragma warning restore 56523 if (si.pSignExtInfo != null) { @@ -513,7 +513,7 @@ namespace System.Management.Automation IntPtr.Zero, WINTRUST_ACTION_GENERIC_VERIFY_V2, wtdBuffer); -#pragma warning enable 56523 +#pragma warning restore 56523 wtData = Marshal.PtrToStructure(wtdBuffer); } @@ -538,7 +538,7 @@ namespace System.Management.Automation #pragma warning disable 56523 IntPtr pCert = NativeMethods.WTHelperGetProvCertFromChain(pSigner, 0); -#pragma warning enable 56523 +#pragma warning restore 56523 if (pCert != IntPtr.Zero) { @@ -608,7 +608,7 @@ namespace System.Management.Automation #pragma warning disable 56523 IntPtr pProvData = NativeMethods.WTHelperProvDataFromStateData(wvtStateData); -#pragma warning enable 56523 +#pragma warning restore 56523 if (pProvData != IntPtr.Zero) { diff --git a/src/System.Management.Automation/security/nativeMethods.cs b/src/System.Management.Automation/security/nativeMethods.cs index 8feee7f26..6b027579f 100644 --- a/src/System.Management.Automation/security/nativeMethods.cs +++ b/src/System.Management.Automation/security/nativeMethods.cs @@ -1067,7 +1067,7 @@ namespace System.Management.Automation.Security IntPtr.Zero, WINTRUST_ACTION_GENERIC_VERIFY_V2, wtdBuffer); -#pragma warning enable 56523 +#pragma warning restore 56523 wtd = Marshal.PtrToStructure(wtdBuffer); } @@ -1202,7 +1202,7 @@ namespace System.Management.Automation.Security IntPtr.Zero, WINTRUST_ACTION_GENERIC_VERIFY_V2, wtdBuffer); -#pragma warning enable 56523 +#pragma warning restore 56523 } finally {