From e57efa86aa38089f72464ddfd21a6755d90f262a Mon Sep 17 00:00:00 2001 From: xtqqczze Date: Mon, 2 Nov 2020 04:46:07 +0000 Subject: [PATCH] Enable SA1106: Code should not contain empty statements https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1106.md --- .globalconfig | 2 +- .../NewCimSessionOptionCommand.cs | 2 +- .../PdhHelper.cs | 6 ++-- .../commands/management/Process.cs | 2 +- .../commands/management/Service.cs | 8 ++--- .../commands/utility/Get-PSBreakpoint.cs | 2 +- .../host/msh/ProgressNode.cs | 2 +- .../Eventing/UnsafeNativeMethods.cs | 2 +- .../ConfigProvider.cs | 4 +-- src/Microsoft.WSMan.Management/Interop.cs | 2 +- .../common/DisplayDatabase/XmlLoaderBase.cs | 2 +- .../displayResourceManagerCache.cs | 2 +- .../engine/ComInterop/ComEventDesc.cs | 2 +- .../engine/ExecutionContext.cs | 2 +- .../engine/LanguagePrimitives.cs | 2 +- .../MinishellParameterBinderController.cs | 2 +- .../engine/MshCommandRuntime.cs | 2 +- .../engine/NativeCommandProcessor.cs | 4 +-- .../engine/Pipe.cs | 2 +- .../engine/SerializationStrings.cs | 2 +- .../engine/debugger/debugger.cs | 12 +++---- .../engine/hostifaces/Connection.cs | 2 +- .../engine/parser/tokenizer.cs | 2 +- .../engine/regex.cs | 4 +-- .../remoting/client/ClientRemotePowerShell.cs | 2 +- .../remoting/common/RunspaceConnectionInfo.cs | 6 ++-- .../remoting/fanin/BaseTransportManager.cs | 2 +- .../engine/remoting/fanin/WSManNativeAPI.cs | 2 +- .../server/ServerRunspacePoolDriver.cs | 2 +- .../engine/serialization.cs | 2 +- .../help/CabinetNativeApi.cs | 8 ++--- .../logging/MshLog.cs | 6 ++-- .../namespaces/FileSystemContentStream.cs | 2 +- .../namespaces/FileSystemProvider.cs | 2 +- .../security/MshSignature.cs | 6 ++-- .../security/SecuritySupport.cs | 2 +- .../security/nativeMethods.cs | 36 +++++++++---------- .../utils/PlatformInvokes.cs | 2 +- 38 files changed, 77 insertions(+), 77 deletions(-) diff --git a/.globalconfig b/.globalconfig index ced5ff22453..e1ed8457d60 100644 --- a/.globalconfig +++ b/.globalconfig @@ -1115,7 +1115,7 @@ dotnet_diagnostic.SA1104.severity = none dotnet_diagnostic.SA1105.severity = none # SA1106: Code should not contain empty statements -dotnet_diagnostic.SA1106.severity = none +dotnet_diagnostic.SA1106.severity = warning # SA1107: Code should not contain multiple statements on one line dotnet_diagnostic.SA1107.severity = none diff --git a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs index 999cb3baecc..b0b9e06c3f0 100644 --- a/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs +++ b/src/Microsoft.Management.Infrastructure.CimCmdlets/NewCimSessionOptionCommand.cs @@ -24,7 +24,7 @@ public enum ProtocolType [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly")] Wsman - }; + } /// /// The Cmdlet allows the IT Pro to create a CimSessionOptions object that she/he diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs index 541aeabe7c6..f38803e7b26 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/PdhHelper.cs @@ -225,7 +225,7 @@ private struct PDH_FMT_COUNTERVALUE_LARGE // [FieldOffset(4), MarshalAs(UnmanagedType.LPWStr)] // public string WideStringValue; - }; + } [StructLayout(LayoutKind.Sequential)] private struct PDH_FMT_COUNTERVALUE_DOUBLE @@ -233,7 +233,7 @@ private struct PDH_FMT_COUNTERVALUE_DOUBLE public uint CStatus; public double doubleValue; - }; + } [StructLayout(LayoutKind.Sequential)] private struct PDH_FMT_COUNTERVALUE_UNICODE @@ -242,7 +242,7 @@ private struct PDH_FMT_COUNTERVALUE_UNICODE [MarshalAs(UnmanagedType.LPWStr)] public string WideStringValue; - }; + } [StructLayout(LayoutKind.Sequential)] private struct PDH_RAW_COUNTER diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs index 32e33d59d6a..44b885f56ec 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Process.cs @@ -54,7 +54,7 @@ internal enum MatchMode /// Select the processes specified as input. /// ByInput - }; + } /// /// The current process selection mode. /// diff --git a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs index 0f442b5e5e2..2a561094327 100644 --- a/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs +++ b/src/Microsoft.PowerShell.Commands.Management/commands/management/Service.cs @@ -179,7 +179,7 @@ internal enum SelectionMode /// Select services by Service name. /// ServiceName = 3 - }; + } /// /// Holds the selection mode setting. /// @@ -2706,7 +2706,7 @@ internal struct SERVICE_DESCRIPTIONW { [MarshalAs(UnmanagedType.LPWStr)] internal string lpDescription; - }; + } [StructLayout(LayoutKind.Sequential)] internal struct QUERY_SERVICE_CONFIG @@ -2720,13 +2720,13 @@ internal struct QUERY_SERVICE_CONFIG [MarshalAs(UnmanagedType.LPWStr)] internal string lpDependencies; [MarshalAs(UnmanagedType.LPWStr)] internal string lpServiceStartName; [MarshalAs(UnmanagedType.LPWStr)] internal string lpDisplayName; - }; + } [StructLayout(LayoutKind.Sequential)] internal struct SERVICE_DELAYED_AUTO_START_INFO { internal bool fDelayedAutostart; - }; + } [DllImport(PinvokeDllNames.CreateServiceWDllName, CharSet = CharSet.Unicode, SetLastError = true)] internal static extern diff --git a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-PSBreakpoint.cs b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-PSBreakpoint.cs index 133c03646f8..03525eca55f 100644 --- a/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-PSBreakpoint.cs +++ b/src/Microsoft.PowerShell.Commands.Utility/commands/utility/Get-PSBreakpoint.cs @@ -22,7 +22,7 @@ public enum BreakpointType /// Breakpoint on a command Command - }; + } /// /// This class implements Get-PSBreakpoint. diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressNode.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressNode.cs index f9f666e9725..165d1993bef 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressNode.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/ProgressNode.cs @@ -40,7 +40,7 @@ namespace Microsoft.PowerShell /// The node will be displayed the same as Full, plus, the whole StatusDescription and CurrentOperation will be displayed (in multiple lines if needed). /// FullPlus = 4, - }; + } /// /// Constructs an instance from a ProgressRecord. diff --git a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/UnsafeNativeMethods.cs b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/UnsafeNativeMethods.cs index b42efba9119..39644d7007a 100644 --- a/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/UnsafeNativeMethods.cs +++ b/src/Microsoft.PowerShell.CoreCLR.Eventing/DotNetCode/Eventing/UnsafeNativeMethods.cs @@ -865,7 +865,7 @@ internal struct EvtStringVariant [FieldOffset(12)] public UInt32 Type; - }; + } [DllImport(WEVTAPI, CharSet = CharSet.Unicode, SetLastError = true)] [SecurityCritical] diff --git a/src/Microsoft.WSMan.Management/ConfigProvider.cs b/src/Microsoft.WSMan.Management/ConfigProvider.cs index 7054766373d..1385989b0e9 100644 --- a/src/Microsoft.WSMan.Management/ConfigProvider.cs +++ b/src/Microsoft.WSMan.Management/ConfigProvider.cs @@ -5434,14 +5434,14 @@ private enum ProviderMethods { GetChildItems, GetChildNames - }; + } private enum WsManElementObjectTypes { WSManConfigElement, WSManConfigContainerElement, WSManConfigLeafElement - }; + } #region def private static readonly string[] WinrmRootName = new string[] { "winrm/Config" }; diff --git a/src/Microsoft.WSMan.Management/Interop.cs b/src/Microsoft.WSMan.Management/Interop.cs index 7084a111f2d..6685770b0ef 100644 --- a/src/Microsoft.WSMan.Management/Interop.cs +++ b/src/Microsoft.WSMan.Management/Interop.cs @@ -376,7 +376,7 @@ void SetProxy(int accessType, /// ProxyAuthenticationUseDigest method of IWSManConnectionOptionsEx2 interface. [DispId(11)] int ProxyAuthenticationUseDigest(); - }; + } #endregion IWSManConnectionOptions diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/XmlLoaderBase.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/XmlLoaderBase.cs index 773eb9d3777..9c0fbc90b66 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/XmlLoaderBase.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/XmlLoaderBase.cs @@ -44,7 +44,7 @@ internal class TooManyErrorsException : TypeInfoDataBaseLoaderException /// internal class XmlLoaderLoggerEntry { - internal enum EntryType { Error, Trace }; + internal enum EntryType { Error, Trace } /// /// Type of information being logged. diff --git a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayResourceManagerCache.cs b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayResourceManagerCache.cs index aafd09cc255..43e1d0ea6fc 100644 --- a/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayResourceManagerCache.cs +++ b/src/System.Management.Automation/FormatAndOutput/common/DisplayDatabase/displayResourceManagerCache.cs @@ -13,7 +13,7 @@ internal sealed class DisplayResourceManagerCache { internal enum LoadingResult { NoError, AssemblyNotFound, ResourceNotFound, StringNotFound } - internal enum AssemblyBindingStatus { NotFound, FoundInGac, FoundInPath }; + internal enum AssemblyBindingStatus { NotFound, FoundInGac, FoundInPath } internal string GetTextTokenString(TextToken tt) { diff --git a/src/System.Management.Automation/engine/ComInterop/ComEventDesc.cs b/src/System.Management.Automation/engine/ComInterop/ComEventDesc.cs index 13121b69698..961532a8a5e 100644 --- a/src/System.Management.Automation/engine/ComInterop/ComEventDesc.cs +++ b/src/System.Management.Automation/engine/ComInterop/ComEventDesc.cs @@ -9,5 +9,5 @@ internal class ComEventDesc { public Guid SourceIID; public int Dispid; - }; + } } diff --git a/src/System.Management.Automation/engine/ExecutionContext.cs b/src/System.Management.Automation/engine/ExecutionContext.cs index 3a726be8f73..7dcf1b6df5b 100644 --- a/src/System.Management.Automation/engine/ExecutionContext.cs +++ b/src/System.Management.Automation/engine/ExecutionContext.cs @@ -1698,5 +1698,5 @@ internal enum EngineState /// Engine is stopped. /// Stopped = 4 - }; + } } diff --git a/src/System.Management.Automation/engine/LanguagePrimitives.cs b/src/System.Management.Automation/engine/LanguagePrimitives.cs index 703fbcd46e4..4f4e946b0ac 100644 --- a/src/System.Management.Automation/engine/LanguagePrimitives.cs +++ b/src/System.Management.Automation/engine/LanguagePrimitives.cs @@ -5779,7 +5779,7 @@ internal static IConversionData FigureConversion(Type fromType, Type toType) return CacheConversion(fromType, toType, converter, rank); } - internal class Null { }; + internal class Null { } private static IConversionData FigureConversionFromNull(Type toType) { diff --git a/src/System.Management.Automation/engine/MinishellParameterBinderController.cs b/src/System.Management.Automation/engine/MinishellParameterBinderController.cs index bd23408fcfa..e19defd57a7 100644 --- a/src/System.Management.Automation/engine/MinishellParameterBinderController.cs +++ b/src/System.Management.Automation/engine/MinishellParameterBinderController.cs @@ -254,7 +254,7 @@ private enum MinishellParameters Arguments = 0x02, InputFormat = 0x04, OutputFormat = 0x08 - }; + } /// /// Handles error handling if some parameter is specified more than once. diff --git a/src/System.Management.Automation/engine/MshCommandRuntime.cs b/src/System.Management.Automation/engine/MshCommandRuntime.cs index 2709ba1384e..c783a33ddcb 100644 --- a/src/System.Management.Automation/engine/MshCommandRuntime.cs +++ b/src/System.Management.Automation/engine/MshCommandRuntime.cs @@ -3384,7 +3384,7 @@ internal enum ContinueStatus No, YesToAll, NoToAll - }; + } internal ContinueStatus lastShouldProcessContinueStatus = ContinueStatus.Yes; internal ContinueStatus lastErrorContinueStatus = ContinueStatus.Yes; diff --git a/src/System.Management.Automation/engine/NativeCommandProcessor.cs b/src/System.Management.Automation/engine/NativeCommandProcessor.cs index bcd42658d22..48c58d5683f 100644 --- a/src/System.Management.Automation/engine/NativeCommandProcessor.cs +++ b/src/System.Management.Automation/engine/NativeCommandProcessor.cs @@ -32,7 +32,7 @@ internal enum NativeCommandIOFormat { Text, Xml - }; + } /// /// Different streams produced by minishell output. @@ -1419,7 +1419,7 @@ private struct SHFILEINFO [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)] public string szTypeName; - }; + } private const uint SHGFI_EXETYPE = 0x000002000; // flag used to ask to return exe type diff --git a/src/System.Management.Automation/engine/Pipe.cs b/src/System.Management.Automation/engine/Pipe.cs index 98b55cf1105..e3405837007 100644 --- a/src/System.Management.Automation/engine/Pipe.cs +++ b/src/System.Management.Automation/engine/Pipe.cs @@ -16,7 +16,7 @@ internal enum VariableStreamKind Error, Warning, Information - }; + } /// /// Pipe provides a way to stitch two commands. diff --git a/src/System.Management.Automation/engine/SerializationStrings.cs b/src/System.Management.Automation/engine/SerializationStrings.cs index a06156086d7..81b0f9cb741 100644 --- a/src/System.Management.Automation/engine/SerializationStrings.cs +++ b/src/System.Management.Automation/engine/SerializationStrings.cs @@ -308,5 +308,5 @@ internal static class SerializationStrings internal const string MonadNamespacePrefix = "ps"; #endregion namespace values - }; + } } diff --git a/src/System.Management.Automation/engine/debugger/debugger.cs b/src/System.Management.Automation/engine/debugger/debugger.cs index c993f2ecfe8..dde672f6cb7 100644 --- a/src/System.Management.Automation/engine/debugger/debugger.cs +++ b/src/System.Management.Automation/engine/debugger/debugger.cs @@ -50,7 +50,7 @@ public enum DebuggerResumeAction /// Stop executing the script. /// Stop = 4, - }; + } /// /// Arguments for the DebuggerStop event. @@ -112,7 +112,7 @@ public DebuggerStopEventArgs( /// leave pending runspace debug sessions suspended until a debugger is attached. /// internal bool SuspendRemote { get; set; } - }; + } /// /// Kinds of breakpoint updates. @@ -135,7 +135,7 @@ public enum BreakpointUpdateType /// A breakpoint was disabled. /// Disabled = 3 - }; + } /// /// Arguments for the BreakpointUpdated event. @@ -166,7 +166,7 @@ internal BreakpointUpdatedEventArgs(Breakpoint breakpoint, BreakpointUpdateType /// Gets the current breakpoint count. /// public int BreakpointCount { get; } - }; + } #region PSJobStartEventArgs @@ -292,7 +292,7 @@ public enum DebugModes /// PowerShell remote script debugging. /// RemoteScript = 0x4 - }; + } /// /// Defines unhandled breakpoint processing behavior. @@ -1589,7 +1589,7 @@ private class CallStackInfo internal bool IsFrameHidden { get; set; } internal bool TopFrameAtBreakpoint { get; set; } - }; + } private struct CallStackList { diff --git a/src/System.Management.Automation/engine/hostifaces/Connection.cs b/src/System.Management.Automation/engine/hostifaces/Connection.cs index 29e86c91b9b..e5fbb6c79f0 100644 --- a/src/System.Management.Automation/engine/hostifaces/Connection.cs +++ b/src/System.Management.Automation/engine/hostifaces/Connection.cs @@ -226,7 +226,7 @@ public enum PSThreadOptions /// This option is not valid for asynchronous calls /// UseCurrentThread = 3 - }; + } /// /// Defines type which has information about RunspaceState and diff --git a/src/System.Management.Automation/engine/parser/tokenizer.cs b/src/System.Management.Automation/engine/parser/tokenizer.cs index 3d66362745c..ed2c8f57425 100644 --- a/src/System.Management.Automation/engine/parser/tokenizer.cs +++ b/src/System.Management.Automation/engine/parser/tokenizer.cs @@ -41,7 +41,7 @@ public enum DynamicKeywordNameMode /// Name may be optionally present, expression or bare word. /// OptionalName = 4, - }; + } /// /// Defines the body mode for a dynamic keyword. It can be a scriptblock, hashtable or command which means no body. diff --git a/src/System.Management.Automation/engine/regex.cs b/src/System.Management.Automation/engine/regex.cs index 06b9676c0e8..1ee6a3525ed 100644 --- a/src/System.Management.Automation/engine/regex.cs +++ b/src/System.Management.Automation/engine/regex.cs @@ -43,7 +43,7 @@ public enum WildcardOptions /// Specifies culture-invariant matching. /// CultureInvariant = 4 - }; + } /// /// Represents a wildcard pattern. @@ -729,7 +729,7 @@ internal static WildcardPatternException NewWildcardPatternException(string inva return e; } - }; + } /// /// Convert a string with wild cards into its equivalent regex. diff --git a/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs b/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs index 672fe188da7..f9c62c354b6 100644 --- a/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs +++ b/src/System.Management.Automation/engine/remoting/client/ClientRemotePowerShell.cs @@ -977,7 +977,7 @@ internal enum PSConnectionRetryStatus AutoDisconnectStarting = 4, AutoDisconnectSucceeded = 5, InternalErrorAbort = 6 - }; + } /// /// PSConnectionRetryStatusEventArgs. diff --git a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs index 6b4e91efae3..d173e24c070 100644 --- a/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs +++ b/src/System.Management.Automation/engine/remoting/common/RunspaceConnectionInfo.cs @@ -2297,7 +2297,7 @@ private static string[] ParseArgv(ProcessStartInfo psi) case '"': // Special case for arguments within quotes // Just return argument value within the quotes - while ((++i < argsLength) && argsToParse[i] != '"') { }; + while ((++i < argsLength) && argsToParse[i] != '"') { } if (iStart < argsLength - 1) { iStart++; @@ -2307,12 +2307,12 @@ private static string[] ParseArgv(ProcessStartInfo psi) default: // Common case for parsing arguments with space character delimiter - while ((++i < argsLength) && argsToParse[i] != ' ') { }; + while ((++i < argsLength) && argsToParse[i] != ' ') { } break; } argvList.Add(argsToParse.Substring(iStart, (i-iStart))); - while ((++i < argsLength) && argsToParse[i] == ' ') { }; + while ((++i < argsLength) && argsToParse[i] == ' ') { } } return argvList.ToArray(); diff --git a/src/System.Management.Automation/engine/remoting/fanin/BaseTransportManager.cs b/src/System.Management.Automation/engine/remoting/fanin/BaseTransportManager.cs index aa496990dd8..6896c8467e5 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/BaseTransportManager.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/BaseTransportManager.cs @@ -97,7 +97,7 @@ internal enum ConnectionStatus AutoDisconnectStarting = 4, AutoDisconnectSucceeded = 5, InternalErrorAbort = 6 - }; + } /// /// ConnectionStatusEventArgs. diff --git a/src/System.Management.Automation/engine/remoting/fanin/WSManNativeAPI.cs b/src/System.Management.Automation/engine/remoting/fanin/WSManNativeAPI.cs index 404dd3b576d..0c7e53b00ae 100644 --- a/src/System.Management.Automation/engine/remoting/fanin/WSManNativeAPI.cs +++ b/src/System.Management.Automation/engine/remoting/fanin/WSManNativeAPI.cs @@ -612,7 +612,7 @@ internal enum WSManDataType : uint WSMAN_DATA_TYPE_BINARY = 2, WSMAN_DATA_TYPE_WS_XML_READER = 3, WSMAN_DATA_TYPE_DWORD = 4 - }; + } [StructLayout(LayoutKind.Sequential)] internal class WSManDataStruct diff --git a/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs b/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs index bf235088a41..ae1424e7470 100644 --- a/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs +++ b/src/System.Management.Automation/engine/remoting/server/ServerRunspacePoolDriver.cs @@ -1246,7 +1246,7 @@ private enum PreProcessCommandResult /// The PreProcessCommandResult used for managing breakpoints. /// BreakpointManagement, - }; + } private class DebuggerCommandArgument { diff --git a/src/System.Management.Automation/engine/serialization.cs b/src/System.Management.Automation/engine/serialization.cs index 488b73d14fc..26ebcd88502 100644 --- a/src/System.Management.Automation/engine/serialization.cs +++ b/src/System.Management.Automation/engine/serialization.cs @@ -791,7 +791,7 @@ internal enum ContainerType List, Enumerable, None - }; + } /// /// This internal helper class provides methods for serializing mshObject. diff --git a/src/System.Management.Automation/help/CabinetNativeApi.cs b/src/System.Management.Automation/help/CabinetNativeApi.cs index 267317b11d0..4a213bc0478 100644 --- a/src/System.Management.Automation/help/CabinetNativeApi.cs +++ b/src/System.Management.Automation/help/CabinetNativeApi.cs @@ -164,7 +164,7 @@ private void CleanUpDelegates() _fdiNotifyHandle.Free(); } } - }; + } // CabinetExtractor loader implementation internal class CabinetExtractorLoader : ICabinetExtractorLoader @@ -188,7 +188,7 @@ internal override ICabinetExtractor GetCabinetExtractor() { return s_extractorInstance; } - }; + } internal static class CabinetNativeApi { @@ -589,7 +589,7 @@ internal class FdiNotification internal short iCabinet; // USHORT internal short iFolder; // USHORT internal int fdie; // FDIERROR - }; + } internal enum FdiNotificationType : int { @@ -607,7 +607,7 @@ internal class FdiERF internal int erfOper; internal int erfType; internal bool fError; - }; + } internal sealed class FdiContextHandle : SafeHandleZeroOrMinusOneIsInvalid { diff --git a/src/System.Management.Automation/logging/MshLog.cs b/src/System.Management.Automation/logging/MshLog.cs index 23c687b58ee..32de4db2af8 100644 --- a/src/System.Management.Automation/logging/MshLog.cs +++ b/src/System.Management.Automation/logging/MshLog.cs @@ -1085,7 +1085,7 @@ internal enum Severity /// Informational. /// Informational - }; + } /// /// Enum for command states. @@ -1103,7 +1103,7 @@ internal enum CommandState /// /// Terminated = 2 - }; + } /// /// Enum for provider states. @@ -1117,7 +1117,7 @@ internal enum ProviderState /// /// Stopped = 1, - }; + } #endregion } diff --git a/src/System.Management.Automation/namespaces/FileSystemContentStream.cs b/src/System.Management.Automation/namespaces/FileSystemContentStream.cs index 51349970709..3c627542b4b 100644 --- a/src/System.Management.Automation/namespaces/FileSystemContentStream.cs +++ b/src/System.Management.Automation/namespaces/FileSystemContentStream.cs @@ -1515,7 +1515,7 @@ internal struct CPINFO [MarshalAs(UnmanagedType.ByValArray, SizeConst = MAX_LEADBYTES)] public byte[] LeadBytes; - }; + } /// /// Get information on a named code page. diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index d39733bed49..8d77bc000d1 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -2721,7 +2721,7 @@ private enum ItemType SymbolicLink, Junction, HardLink - }; + } private static ItemType GetItemType(string input) { diff --git a/src/System.Management.Automation/security/MshSignature.cs b/src/System.Management.Automation/security/MshSignature.cs index 221472a12d2..96ff8a9638a 100644 --- a/src/System.Management.Automation/security/MshSignature.cs +++ b/src/System.Management.Automation/security/MshSignature.cs @@ -71,7 +71,7 @@ public enum SignatureStatus /// with the current system. /// Incompatible - }; + } /// /// Defines the valid types of signatures. @@ -92,7 +92,7 @@ public enum SignatureType /// The signature is a catalog signature. /// Catalog = 2 - }; + } /// /// Represents a digital signature on a signed @@ -389,5 +389,5 @@ private static string GetSignatureStatusMessage(SignatureStatus status, return message; } - }; + } } diff --git a/src/System.Management.Automation/security/SecuritySupport.cs b/src/System.Management.Automation/security/SecuritySupport.cs index 4303075d8eb..809c13efb3f 100644 --- a/src/System.Management.Automation/security/SecuritySupport.cs +++ b/src/System.Management.Automation/security/SecuritySupport.cs @@ -63,7 +63,7 @@ public enum ExecutionPolicy /// Default - The most restrictive policy available. /// Default = Restricted - }; + } /// /// Defines the available configuration scopes for an execution diff --git a/src/System.Management.Automation/security/nativeMethods.cs b/src/System.Management.Automation/security/nativeMethods.cs index e6ca212c274..a0bf1498daf 100644 --- a/src/System.Management.Automation/security/nativeMethods.cs +++ b/src/System.Management.Automation/security/nativeMethods.cs @@ -556,7 +556,7 @@ internal enum CryptUIFlags { CRYPTUI_WIZ_NO_UI = 0x0001 // other flags not used - }; + } [StructLayout(LayoutKind.Sequential)] internal struct CRYPTUI_WIZ_DIGITAL_SIGN_INFO @@ -575,14 +575,14 @@ internal struct CRYPTUI_WIZ_DIGITAL_SIGN_INFO internal DWORD dwAdditionalCertChoice; internal IntPtr pSignExtInfo; // PCCRYPTUI_WIZ_DIGITAL_SIGN_EXTENDED_INFO - }; + } [Flags] internal enum SignInfoSubjectChoice { CRYPTUI_WIZ_DIGITAL_SIGN_SUBJECT_FILE = 0x01 // CRYPTUI_WIZ_DIGITAL_SIGN_SUBJECT_BLOB = 0x02 NotUsed - }; + } [Flags] internal enum SignInfoCertChoice @@ -590,14 +590,14 @@ internal enum SignInfoCertChoice CRYPTUI_WIZ_DIGITAL_SIGN_CERT = 0x01 // CRYPTUI_WIZ_DIGITAL_SIGN_STORE = 0x02, NotUsed // CRYPTUI_WIZ_DIGITAL_SIGN_PVK = 0x03, NotUsed - }; + } [Flags] internal enum SignInfoAdditionalCertChoice { CRYPTUI_WIZ_DIGITAL_SIGN_ADD_CHAIN = 1, CRYPTUI_WIZ_DIGITAL_SIGN_ADD_CHAIN_NO_ROOT = 2 - }; + } [StructLayout(LayoutKind.Sequential)] internal struct CRYPTUI_WIZ_DIGITAL_SIGN_EXTENDED_INFO @@ -618,7 +618,7 @@ internal struct CRYPTUI_WIZ_DIGITAL_SIGN_EXTENDED_INFO internal IntPtr hAdditionalCertStoreNotUsed; // HCERTSTORE internal IntPtr psAuthenticatedNotUsed; // PCRYPT_ATTRIBUTES internal IntPtr psUnauthenticatedNotUsed; // PCRYPT_ATTRIBUTES - }; + } [ArchitectureSensitive] internal static CRYPTUI_WIZ_DIGITAL_SIGN_EXTENDED_INFO @@ -806,7 +806,7 @@ internal struct WINTRUST_FILE_INFO internal IntPtr hFileNotUsed; // optional, HANDLE to pcwszFilePath internal IntPtr pgKnownSubjectNotUsed; // optional: GUID* : fill if the // subject type is known - }; + } [StructLayoutAttribute(LayoutKind.Sequential)] internal struct WINTRUST_BLOB_INFO @@ -871,7 +871,7 @@ internal enum WintrustUIChoice WTD_UI_NONE = 2, WTD_UI_NOBAD = 3, WTD_UI_NOGOOD = 4 - }; + } [Flags] internal enum WintrustUnionChoice @@ -881,7 +881,7 @@ internal enum WintrustUnionChoice WTD_CHOICE_BLOB = 3, // WTD_CHOICE_SIGNER = 4, // WTD_CHOICE_CERT = 5, - }; + } [Flags] internal enum WintrustProviderFlags @@ -899,7 +899,7 @@ internal enum WintrustProviderFlags WTD_USE_DEFAULT_OSVER_CHECK = 0x00000400, WTD_LIFETIME_SIGNING_FLAG = 0x00000800, WTD_CACHE_ONLY_URL_RETRIEVAL = 0x00001000 - }; + } [Flags] internal enum WintrustAction @@ -909,7 +909,7 @@ internal enum WintrustAction WTD_STATEACTION_CLOSE = 0x00000002, WTD_STATEACTION_AUTO_CACHE = 0x00000003, WTD_STATEACTION_AUTO_CACHE_FLUSH = 0x00000004 - }; + } [StructLayoutAttribute(LayoutKind.Explicit)] internal struct WinTrust_Choice @@ -1103,7 +1103,7 @@ internal struct CRYPT_PROVIDER_CERT private DWORD _dwCtlError; private BOOL _fIsCyclic; private IntPtr _pChainElement; // PCERT_CHAIN_ELEMENT - }; + } [StructLayout(LayoutKind.Sequential)] internal struct CRYPT_PROVIDER_SGNR @@ -1118,7 +1118,7 @@ internal struct CRYPT_PROVIDER_SGNR internal DWORD csCounterSigners; internal IntPtr pasCounterSigners; // CRYPT_PROVIDER_SGNR* private IntPtr _pChainContext; // PCCERT_CHAIN_CONTEXT - }; + } [DllImport("wintrust.dll", SetLastError = true, CharSet = CharSet.Unicode)] internal static extern @@ -1210,7 +1210,7 @@ internal struct CERT_ENHKEY_USAGE // [MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStr, SizeParamIndex=0)] // internal string[] rgpszUsageIdentifier; // LPSTR* internal IntPtr rgpszUsageIdentifier; - }; + } internal enum SIGNATURE_STATE { @@ -1967,7 +1967,7 @@ internal struct CRYPTCATCDF private string _pwszResultDir; private IntPtr _hCATStore; - }; + } [StructLayout(LayoutKind.Sequential)] internal struct CRYPTCATMEMBER @@ -1988,7 +1988,7 @@ internal struct CRYPTCATMEMBER internal IntPtr hReserved; internal CRYPT_ATTR_BLOB sEncodedIndirectData; internal CRYPT_ATTR_BLOB sEncodedMemberInfo; - }; + } [StructLayout(LayoutKind.Sequential)] internal struct CRYPTCATATTRIBUTE @@ -2002,7 +2002,7 @@ internal struct CRYPTCATATTRIBUTE internal DWORD cbValue; internal System.IntPtr pbValue; private DWORD _dwReserved; - }; + } [StructLayout(LayoutKind.Sequential)] internal struct CRYPTCATSTORE @@ -2020,7 +2020,7 @@ internal struct CRYPTCATSTORE private IntPtr _hAttrs; private IntPtr _hCryptMsg; private IntPtr _hSorted; - }; + } [DllImport("wintrust.dll", CharSet = CharSet.Unicode)] internal static extern IntPtr CryptCATCDFOpen( diff --git a/src/System.Management.Automation/utils/PlatformInvokes.cs b/src/System.Management.Automation/utils/PlatformInvokes.cs index 6d76f8feb1a..c8dc6290511 100644 --- a/src/System.Management.Automation/utils/PlatformInvokes.cs +++ b/src/System.Management.Automation/utils/PlatformInvokes.cs @@ -32,7 +32,7 @@ public long ToTicks() { return ((long)dwHighDateTime << 32) + dwLowDateTime; } - }; + } [Flags] // dwDesiredAccess of CreateFile