Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public Guid InstanceId
}
}

private Guid instanceId;
private readonly Guid instanceId;

/// <summary>
/// Name of the cimsession.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1920,7 +1920,7 @@ internal class ImplicitRemotingCodeGenerator
#region Constructor and shared private data

private readonly PSSession _remoteRunspaceInfo;
private Guid _moduleGuid;
private readonly Guid _moduleGuid;
private readonly InvocationInfo _invocationInfo;

internal ImplicitRemotingCodeGenerator(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class EventProvider : IDisposable
private long _anyKeywordMask; // Trace Enable Flags
private long _allKeywordMask; // Match all keyword
private int _enabled; // Enabled flag from Trace callback
private Guid _providerId; // Control Guid
private readonly Guid _providerId; // Control Guid
private int _disposed; // when 1, provider has unregister

[ThreadStatic]
Expand Down Expand Up @@ -99,7 +99,7 @@ private unsafe void EtwRegister()

_etwCallback = new UnsafeNativeMethods.EtwEnableCallback(EtwEnableCallBack);

status = UnsafeNativeMethods.EventRegister(ref _providerId, _etwCallback, null, ref _regHandle);
status = UnsafeNativeMethods.EventRegister(in _providerId, _etwCallback, null, ref _regHandle);
if (status != 0)
{
throw new Win32Exception((int)status);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ [In] void* callbackContext
[DllImport(EventProviderDllName, ExactSpelling = true, EntryPoint = "EventRegister", CharSet = System.Runtime.InteropServices.CharSet.Unicode)]
[SecurityCritical]
internal static extern unsafe uint EventRegister(
[In] ref Guid providerId,
[In] in Guid providerId,
[In] EtwEnableCallback enableCallback,
[In] void* callbackContext,
[In][Out] ref long registrationHandle
Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/engine/EventManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,7 @@ internal class PSRemoteEventManager : PSEventManager
private readonly string _computerName;

/// <summary>Runspace on which the event was generated</summary>
private Guid _runspaceId;
private readonly Guid _runspaceId;

/// <summary>
/// Creates an event manager for the given runspace.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1996,7 +1996,7 @@ void IDisposable.Dispose()
/// </summary>
internal sealed class PSInformationalBuffers
{
private Guid _psInstanceId;
private readonly Guid _psInstanceId;

/// <summary>
/// Default constructor.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ internal class ClientMethodExecutor
/// <summary>
/// Client runspace pool id.
/// </summary>
private Guid _clientRunspacePoolId;
private readonly Guid _clientRunspacePoolId;

/// <summary>
/// Client power shell id.
/// </summary>
private Guid _clientPowerShellId;
private readonly Guid _clientPowerShellId;

/// <summary>
/// Remote host call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public Guid RunspaceID
}

[DataMemberAttribute()]
private Guid _runspaceID;
private readonly Guid _runspaceID;

/// <summary>
/// Error record source instance ID.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ private void HandleSessionCreateCompleted(object sender, CreateCompleteEventArgs

#region Private Members

private Guid _clientRunspacePoolId;
private readonly Guid _clientRunspacePoolId;
private readonly object _syncObject = new object();
private bool _createRunspaceCalled = false;
private Exception _closingReason;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private void RaiseStateMachineEvents()
/// Unique identifier for this state machine. Used
/// in tracing.
/// </summary>
private Guid _id;
private readonly Guid _id;

/// <summary>
/// Handler to be used in cases, where setting the state is the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal class RemotePipeline : Pipeline
private PipelineStateInfo _pipelineStateInfo = new PipelineStateInfo(PipelineState.NotStarted);
private readonly CommandCollection _commands = new CommandCollection();
private readonly string _computerName;
private Guid _runspaceId;
private readonly Guid _runspaceId;
private readonly ConnectCommandInfo _connectCmdInfo = null;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2008,7 +2008,7 @@ private void PreProcessStreamObject(PSStreamObject streamObject)
private readonly List<PipelineWriter> _inputWriters = new List<PipelineWriter>();
private readonly object _jobSyncObject = new object();
private bool _nojob = false;
private Guid _instanceId = Guid.NewGuid();
private readonly Guid _instanceId = Guid.NewGuid();
private bool _propagateErrors = false;

private static readonly RobustConnectionProgress s_RCProgress = new RobustConnectionProgress();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,7 @@ internal sealed class VMHyperVSocketClientSessionTransportManager : HyperVSocket
{
#region Private Data

private Guid _vmGuid;
private readonly Guid _vmGuid;
private readonly string _configurationName;
private readonly VMConnectionInfo _connectionInfo;
private readonly NetworkCredential _networkCredential;
Expand Down Expand Up @@ -1512,7 +1512,7 @@ internal sealed class ContainerHyperVSocketClientSessionTransportManager : Hyper
{
#region Private Data

private Guid _targetGuid; // currently this is the utility vm guid in HyperV container scenario
private readonly Guid _targetGuid; // currently this is the utility vm guid in HyperV container scenario
private readonly ContainerConnectionInfo _connectionInfo;

#endregion
Expand Down Expand Up @@ -2525,7 +2525,7 @@ internal class OutOfProcessServerTransportManager : AbstractServerTransportManag

private readonly OutOfProcessTextWriter _stdOutWriter;
private readonly OutOfProcessTextWriter _stdErrWriter;
private Guid _powershellInstanceId;
private readonly Guid _powershellInstanceId;
private bool _isDataAckSendPending;

#endregion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ internal class ServerMethodExecutor
/// <summary>
/// Client runspace pool id.
/// </summary>
private Guid _clientRunspacePoolId;
private readonly Guid _clientRunspacePoolId;

/// <summary>
/// Client power shell id.
/// </summary>
private Guid _clientPowerShellId;
private readonly Guid _clientPowerShellId;

/// <summary>
/// Server dispatch table.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ internal class ServerRemoteHost : PSHost, IHostSupportsInteractiveSession
/// <summary>
/// Client runspace pool id.
/// </summary>
private Guid _clientRunspacePoolId;
private readonly Guid _clientRunspacePoolId;

/// <summary>
/// Client power shell id.
/// </summary>
private Guid _clientPowerShellId;
private readonly Guid _clientPowerShellId;

/// <summary>
/// Transport manager.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ private void HandleRemoveAssociation(object sender, EventArgs e)

#region Private Members

private Guid _clientRunspacePoolId;
private readonly Guid _clientRunspacePoolId;
// transport manager using which this
// runspace pool driver handles all client
// communication
Expand All @@ -436,8 +436,8 @@ internal class ServerPowerShellDataStructureHandler
// powershell driver handles all client
// communication
private readonly AbstractServerTransportManager _transportManager;
private Guid _clientRunspacePoolId;
private Guid _clientPowerShellId;
private readonly Guid _clientRunspacePoolId;
private readonly Guid _clientPowerShellId;
private readonly RemoteStreamOptions _streamSerializationOptions;
private Runspace _rsUsedToInvokePowerShell;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ internal Guid ModuleGuid
}
}

private Guid _moduleGuid;
private readonly Guid _moduleGuid;

/// <summary>
/// Module path.
Expand Down
2 changes: 1 addition & 1 deletion src/System.Management.Automation/utils/ObjectStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1552,7 +1552,7 @@ internal sealed class PSDataCollectionStream<T> : ObjectStreamBase
#region Private Fields

private readonly PSDataCollection<T> _objects;
private Guid _psInstanceId;
private readonly Guid _psInstanceId;
private bool _isOpen;
private PipelineWriter _writer;
private PipelineReader<object> _objectReader;
Expand Down