From: Stephen Toub Date: Sun, 9 Aug 2020 09:32:44 +0000 (-0400) Subject: Update Microsoft.CodeAnalysis.NetAnalyzers to 3.3.0-beta3.20407.4 (#40560) X-Git-Tag: submit/tizen/20210909.063632~6123 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa5fdab9654d74bc6274c0b5d820272c8e859621;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Update Microsoft.CodeAnalysis.NetAnalyzers to 3.3.0-beta3.20407.4 (#40560) --- diff --git a/eng/Analyzers.props b/eng/Analyzers.props index 2c9b1c8..c14a869 100644 --- a/eng/Analyzers.props +++ b/eng/Analyzers.props @@ -6,7 +6,7 @@ - + diff --git a/eng/CodeAnalysis.ruleset b/eng/CodeAnalysis.ruleset index 42ea385..3726904 100644 --- a/eng/CodeAnalysis.ruleset +++ b/eng/CodeAnalysis.ruleset @@ -64,6 +64,7 @@ + @@ -112,6 +113,8 @@ + + @@ -174,6 +177,15 @@ + + + + + + + + + @@ -239,6 +251,8 @@ + + diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateProcessWithLogon.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateProcessWithLogon.cs index 7d4fc64..61e28bd 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateProcessWithLogon.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CreateProcessWithLogon.cs @@ -18,7 +18,9 @@ internal partial class Interop IntPtr password, LogonFlags logonFlags, string? appName, +#pragma warning disable CA1838 // reasonable use of StringBuilder to build up a command line [In] StringBuilder cmdLine, +#pragma warning restore CA1838 int creationFlags, IntPtr environmentBlock, string lpCurrentDirectory, diff --git a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetDefaultProvider.cs b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetDefaultProvider.cs index 8b3a702..3a26433 100644 --- a/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetDefaultProvider.cs +++ b/src/libraries/Common/src/Interop/Windows/Advapi32/Interop.CryptGetDefaultProvider.cs @@ -20,7 +20,9 @@ internal partial class Interop int dwProvType, IntPtr pdwReserved, GetDefaultProviderFlags dwFlags, - StringBuilder? pszProvName, +#pragma warning disable CA1838 // not on a hot path + [Out] StringBuilder? pszProvName, +#pragma warning restore CA1838 ref int pcbProvName); } } diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateProcess.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateProcess.cs index 104bfe0..95a17f1 100644 --- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateProcess.cs +++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.CreateProcess.cs @@ -15,7 +15,9 @@ internal partial class Interop [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true, BestFitMapping = false, EntryPoint = "CreateProcessW")] internal static extern bool CreateProcess( string? lpApplicationName, +#pragma warning disable CA1838 // reasonable use of StringBuilder to build up a command line [In] StringBuilder lpCommandLine, +#pragma warning restore CA1838 ref SECURITY_ATTRIBUTES procSecAttrs, ref SECURITY_ATTRIBUTES threadSecAttrs, bool bInheritHandles, diff --git a/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.cs b/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.cs index c56d91b..ddaaf8a 100644 --- a/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.cs +++ b/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp.cs @@ -43,7 +43,9 @@ internal partial class Interop [return: MarshalAs(UnmanagedType.Bool)] public static extern bool WinHttpAddRequestHeaders( SafeWinHttpHandle requestHandle, +#pragma warning disable CA1838 // Uses pooled StringBuilder [In] StringBuilder headers, +#pragma warning restore CA1838 uint headersLength, uint modifiers); @@ -59,7 +61,7 @@ internal partial class Interop [return: MarshalAs(UnmanagedType.Bool)] public static extern bool WinHttpSendRequest( SafeWinHttpHandle requestHandle, - [In] StringBuilder headers, + IntPtr headers, uint headersLength, IntPtr optional, uint optionalLength, diff --git a/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj b/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj index b9c7252..e118672 100644 --- a/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj +++ b/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj @@ -3,7 +3,7 @@ true $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-Solaris;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent);netcoreapp2.0-FreeBSD;netcoreapp2.0-Linux;netcoreapp2.0-OSX;netcoreapp2.0-Windows_NT;netstandard2.0;net461-Windows_NT true - $(NoWarn);CA2249 + $(NoWarn);CA2249;CA1838 enable diff --git a/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj b/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj index 42937d1..a22f890 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj +++ b/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj @@ -3,6 +3,7 @@ true $(NetCoreAppCurrent)-Windows_NT;netcoreapp2.0-Windows_NT;net461;netstandard2.0 true + $(NoWarn);CA1838 diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/LibcupsNative.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/LibcupsNative.cs index f741f0a..cc3e39f 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/LibcupsNative.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/LibcupsNative.cs @@ -33,7 +33,9 @@ namespace System.Drawing.Printing internal static extern void cupsFreeDests(int num_dests, IntPtr dests); [DllImport(LibraryName, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr cupsTempFd(StringBuilder sb, int len); +#pragma warning disable CA1838 // not hot-path enough to worry about the overheads of StringBuilder marshaling + internal static extern IntPtr cupsTempFd([Out] StringBuilder sb, int len); +#pragma warning restore CA1838 [DllImport(LibraryName, ExactSpelling = true)] internal static extern IntPtr cupsGetDefault(); diff --git a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs index c2b405d..40cd1d5 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs +++ b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpHandler.cs @@ -1406,7 +1406,7 @@ namespace System.Net.Http state.Pin(); if (!Interop.WinHttp.WinHttpSendRequest( state.RequestHandle, - null, + IntPtr.Zero, 0, IntPtr.Zero, 0, diff --git a/src/libraries/System.Net.Http.WinHttpHandler/tests/UnitTests/FakeInterop.cs b/src/libraries/System.Net.Http.WinHttpHandler/tests/UnitTests/FakeInterop.cs index 728aacd..24e4b71 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/tests/UnitTests/FakeInterop.cs +++ b/src/libraries/System.Net.Http.WinHttpHandler/tests/UnitTests/FakeInterop.cs @@ -157,7 +157,7 @@ internal static partial class Interop public static bool WinHttpSendRequest( SafeWinHttpHandle requestHandle, - StringBuilder headers, + IntPtr headers, uint headersLength, IntPtr optional, uint optionalLength,