mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
spelling: locals in src/System.Management.Automation/engine/remoting
This commit is contained in:
@@ -873,9 +873,9 @@ namespace System.Management.Automation
|
||||
// Check to see expected behavior if one child job fails to start.
|
||||
}
|
||||
|
||||
if (ExcecutionError.Count == 1)
|
||||
if (ExecutionError.Count == 1)
|
||||
{
|
||||
throw ExcecutionError[0];
|
||||
throw ExecutionError[0];
|
||||
} */
|
||||
_tracer.WriteMessage(TraceClassName, "StartJob", Guid.Empty, this, "Exiting method", null);
|
||||
}
|
||||
|
||||
@@ -397,7 +397,7 @@ namespace System.Management.Automation
|
||||
// in the same invocation. Return once the job object is returned and
|
||||
// used to initialize the proxy.
|
||||
DoStartAsync(dataAdded, stateChanged, input);
|
||||
_jobInitialiedWaitHandle.WaitOne();
|
||||
_jobInitializedWaitHandle.WaitOne();
|
||||
}
|
||||
catch (Exception error)
|
||||
{
|
||||
@@ -1344,7 +1344,7 @@ namespace System.Management.Automation
|
||||
// remove it.
|
||||
// Do this within the Try/Finally block so that the wait handle will be set
|
||||
// on exit.
|
||||
_jobInitialiedWaitHandle.WaitOne();
|
||||
_jobInitializedWaitHandle.WaitOne();
|
||||
if (_remoteJobInstanceId == Guid.Empty) return;
|
||||
|
||||
// Stop the receive-job command if it's in progress.
|
||||
@@ -1567,7 +1567,7 @@ namespace System.Management.Automation
|
||||
JobSuspendedOrFinished.Set();
|
||||
OnSuspendJobCompleted(new AsyncCompletedEventArgs(e.JobStateInfo.Reason, false, null));
|
||||
|
||||
_jobInitialiedWaitHandle.Set();
|
||||
_jobInitializedWaitHandle.Set();
|
||||
OnStartJobCompleted(new AsyncCompletedEventArgs(e.JobStateInfo.Reason, false, null));
|
||||
|
||||
OnStopJobCompleted(new AsyncCompletedEventArgs(e.JobStateInfo.Reason, false, null));
|
||||
@@ -2058,7 +2058,7 @@ namespace System.Management.Automation
|
||||
? PSTraceSource.NewNotSupportedException(PowerShellStrings.CommandDoesNotWriteJob)
|
||||
: _receivePowerShell.Streams.Error[0].Exception;
|
||||
DoSetJobState(JobState.Failed, reason);
|
||||
_jobInitialiedWaitHandle.Set();
|
||||
_jobInitializedWaitHandle.Set();
|
||||
OnStartJobCompleted(new AsyncCompletedEventArgs(reason, false, null));
|
||||
return;
|
||||
}
|
||||
@@ -2079,7 +2079,7 @@ namespace System.Management.Automation
|
||||
}
|
||||
|
||||
// Release any thread waiting start.
|
||||
_jobInitialiedWaitHandle.Set();
|
||||
_jobInitializedWaitHandle.Set();
|
||||
_tracer.WriteMessage(ClassNameTrace, "DataAddedToOutput", Guid.Empty, this,
|
||||
"BEGIN Invoke StartJobCompleted event", null);
|
||||
OnStartJobCompleted(new AsyncCompletedEventArgs(null, false, null));
|
||||
@@ -2377,7 +2377,7 @@ namespace System.Management.Automation
|
||||
|
||||
if (_removeComplete != null) _removeComplete.Dispose();
|
||||
if (_jobRunningOrFinished != null) _jobRunningOrFinished.Dispose();
|
||||
_jobInitialiedWaitHandle.Dispose();
|
||||
_jobInitializedWaitHandle.Dispose();
|
||||
if (_jobSuspendedOrFinished != null) _jobSuspendedOrFinished.Dispose();
|
||||
|
||||
if (ChildJobs != null && ChildJobs.Count > 0)
|
||||
@@ -2448,7 +2448,7 @@ namespace System.Management.Automation
|
||||
}
|
||||
}
|
||||
|
||||
private readonly ManualResetEvent _jobInitialiedWaitHandle = new ManualResetEvent(false);
|
||||
private readonly ManualResetEvent _jobInitializedWaitHandle = new ManualResetEvent(false);
|
||||
|
||||
private ManualResetEvent _jobSuspendedOrFinished;
|
||||
private ManualResetEvent JobSuspendedOrFinished
|
||||
|
||||
+1
-1
@@ -179,7 +179,7 @@ namespace System.Management.Automation.Runspaces.Internal
|
||||
new EventHandler<RemoteDataEventArgs<Exception>>(HandleSessionClosing);
|
||||
DataStructureHandler.SessionClosed +=
|
||||
new EventHandler<RemoteDataEventArgs<Exception>>(HandleSessionClosed);
|
||||
DataStructureHandler.SetMaxMinRunspacesResponseRecieved +=
|
||||
DataStructureHandler.SetMaxMinRunspacesResponseReceived +=
|
||||
new EventHandler<RemoteDataEventArgs<PSObject>>(HandleResponseReceived);
|
||||
DataStructureHandler.URIRedirectionReported +=
|
||||
new EventHandler<RemoteDataEventArgs<Uri>>(HandleURIDirectionReported);
|
||||
|
||||
@@ -180,10 +180,10 @@ namespace System.Management.Automation.Internal
|
||||
|
||||
case RemotingDataType.RunspacePoolOperationResponse:
|
||||
{
|
||||
Dbg.Assert(SetMaxMinRunspacesResponseRecieved != null,
|
||||
Dbg.Assert(SetMaxMinRunspacesResponseReceived != null,
|
||||
"RemoteRunspacePoolInternal should subscribe to all data structure handler events");
|
||||
|
||||
SetMaxMinRunspacesResponseRecieved.SafeInvoke(this, new RemoteDataEventArgs<PSObject>(receivedData.Data));
|
||||
SetMaxMinRunspacesResponseReceived.SafeInvoke(this, new RemoteDataEventArgs<PSObject>(receivedData.Data));
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -209,12 +209,12 @@ namespace System.Management.Automation.Internal
|
||||
internal ClientPowerShellDataStructureHandler CreatePowerShellDataStructureHandler(
|
||||
ClientRemotePowerShell shell)
|
||||
{
|
||||
BaseClientCommandTransportManager clientTrsptMgr =
|
||||
BaseClientCommandTransportManager clientTransportMgr =
|
||||
RemoteSession.SessionDataStructureHandler.
|
||||
CreateClientCommandTransportManager(shell, shell.NoInput);
|
||||
|
||||
return new ClientPowerShellDataStructureHandler(
|
||||
clientTrsptMgr, _clientRunspacePoolId, shell.InstanceId);
|
||||
clientTransportMgr, _clientRunspacePoolId, shell.InstanceId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -397,7 +397,7 @@ namespace System.Management.Automation.Internal
|
||||
/// Event raised when a response to a SetMaxRunspaces or SetMinRunspaces call
|
||||
/// is received
|
||||
/// </summary>
|
||||
internal event EventHandler<RemoteDataEventArgs<PSObject>> SetMaxMinRunspacesResponseRecieved;
|
||||
internal event EventHandler<RemoteDataEventArgs<PSObject>> SetMaxMinRunspacesResponseReceived;
|
||||
|
||||
/// <summary>
|
||||
/// EventHandler used to report connection URI redirections to the application
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace System.Management.Automation.Remoting
|
||||
// Fall-back to traditional approach if runspace is not pushed.
|
||||
if (!this.IsRunspaceOverridden)
|
||||
{
|
||||
return CreatePsCommandNotOverriden(line, isScript, useNewScope);
|
||||
return CreatePsCommandNotOverridden(line, isScript, useNewScope);
|
||||
}
|
||||
|
||||
// Try to parse commands as script-block.
|
||||
@@ -127,7 +127,7 @@ namespace System.Management.Automation.Remoting
|
||||
// If that didn't work fall back to traditional approach.
|
||||
if (psCommand == null)
|
||||
{
|
||||
return CreatePsCommandNotOverriden(line, isScript, useNewScope);
|
||||
return CreatePsCommandNotOverridden(line, isScript, useNewScope);
|
||||
}
|
||||
|
||||
// Otherwise return the psCommandCollection we got.
|
||||
@@ -137,7 +137,7 @@ namespace System.Management.Automation.Remoting
|
||||
/// <summary>
|
||||
/// Creates the PSCommand when the runspace is not overridden
|
||||
/// </summary>
|
||||
private PSCommand CreatePsCommandNotOverriden(string line, bool isScript, bool? useNewScope)
|
||||
private PSCommand CreatePsCommandNotOverridden(string line, bool isScript, bool? useNewScope)
|
||||
{
|
||||
PSCommand command = new PSCommand();
|
||||
|
||||
|
||||
@@ -999,13 +999,13 @@ namespace System.Management.Automation
|
||||
private void UpdatePoolDisconnectOptions()
|
||||
{
|
||||
WSManConnectionInfo runspaceWSManConnectionInfo = RunspacePool.ConnectionInfo as WSManConnectionInfo;
|
||||
WSManConnectionInfo wsManconnectionInfo = ConnectionInfo as WSManConnectionInfo;
|
||||
WSManConnectionInfo wsManConnectionInfo = ConnectionInfo as WSManConnectionInfo;
|
||||
|
||||
Dbg.Assert(runspaceWSManConnectionInfo != null, "Disconnect-Connect feature is currently only supported for WSMan transport");
|
||||
Dbg.Assert(wsManconnectionInfo != null, "Disconnect-Connect feature is currently only supported for WSMan transport");
|
||||
Dbg.Assert(wsManConnectionInfo != null, "Disconnect-Connect feature is currently only supported for WSMan transport");
|
||||
|
||||
runspaceWSManConnectionInfo.IdleTimeout = wsManconnectionInfo.IdleTimeout;
|
||||
runspaceWSManConnectionInfo.OutputBufferingMode = wsManconnectionInfo.OutputBufferingMode;
|
||||
runspaceWSManConnectionInfo.IdleTimeout = wsManConnectionInfo.IdleTimeout;
|
||||
runspaceWSManConnectionInfo.OutputBufferingMode = wsManConnectionInfo.OutputBufferingMode;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -2617,7 +2617,7 @@ namespace System.Management.Automation
|
||||
_runspace = runspace;
|
||||
}
|
||||
|
||||
private Exception _isInNoLangugeModeException = null;
|
||||
private Exception _isInNoLanguageModeException = null;
|
||||
private Exception _getVariableCommandNotFoundException = null;
|
||||
private Exception _setVariableCommandNotFoundException = null;
|
||||
|
||||
@@ -2778,8 +2778,8 @@ namespace System.Management.Automation
|
||||
{
|
||||
// Verify the runspace has is not in NoLanguage mode. For performance, throw if we got an error
|
||||
// before.
|
||||
if (_isInNoLangugeModeException != null)
|
||||
throw _isInNoLangugeModeException;
|
||||
if (_isInNoLanguageModeException != null)
|
||||
throw _isInNoLanguageModeException;
|
||||
|
||||
// Since these are implemented as pipelines, we don't need to do our own
|
||||
// locking of sessionStateCallInProgress like we do with local runspaces.
|
||||
@@ -2798,8 +2798,8 @@ namespace System.Management.Automation
|
||||
{
|
||||
if (e.ErrorRecord.CategoryInfo.Category == ErrorCategory.ParserError)
|
||||
{
|
||||
_isInNoLangugeModeException = new PSNotSupportedException(RunspaceStrings.NotSupportedOnRestrictedRunspace, e);
|
||||
throw _isInNoLangugeModeException;
|
||||
_isInNoLanguageModeException = new PSNotSupportedException(RunspaceStrings.NotSupportedOnRestrictedRunspace, e);
|
||||
throw _isInNoLanguageModeException;
|
||||
}
|
||||
else throw;
|
||||
}
|
||||
@@ -2825,8 +2825,8 @@ namespace System.Management.Automation
|
||||
{
|
||||
// Verify the runspace has is not in NoLanguage mode. For performance, throw if we got an error
|
||||
// before.
|
||||
if (_isInNoLangugeModeException != null)
|
||||
throw _isInNoLangugeModeException;
|
||||
if (_isInNoLanguageModeException != null)
|
||||
throw _isInNoLanguageModeException;
|
||||
|
||||
// Since these are implemented as pipelines, we don't need to do our own
|
||||
// locking of sessionStateCallInProgress like we do with local runspaces.
|
||||
@@ -2845,8 +2845,8 @@ namespace System.Management.Automation
|
||||
{
|
||||
if (e.ErrorRecord.CategoryInfo.Category == ErrorCategory.ParserError)
|
||||
{
|
||||
_isInNoLangugeModeException = new PSNotSupportedException(RunspaceStrings.NotSupportedOnRestrictedRunspace, e);
|
||||
throw _isInNoLangugeModeException;
|
||||
_isInNoLanguageModeException = new PSNotSupportedException(RunspaceStrings.NotSupportedOnRestrictedRunspace, e);
|
||||
throw _isInNoLanguageModeException;
|
||||
}
|
||||
else throw;
|
||||
}
|
||||
@@ -2891,7 +2891,7 @@ namespace System.Management.Automation
|
||||
{
|
||||
// Verify the runspace has is not in NoLanguage mode. For performance, return our
|
||||
// cached value if we got an error before.
|
||||
if (_isInNoLangugeModeException != null)
|
||||
if (_isInNoLanguageModeException != null)
|
||||
return PSLanguageMode.NoLanguage;
|
||||
|
||||
// Since these are implemented as pipelines, we don't need to do our own
|
||||
@@ -2909,7 +2909,7 @@ namespace System.Management.Automation
|
||||
{
|
||||
if (e.ErrorRecord.CategoryInfo.Category == ErrorCategory.ParserError)
|
||||
{
|
||||
_isInNoLangugeModeException = new PSNotSupportedException(RunspaceStrings.NotSupportedOnRestrictedRunspace, e);
|
||||
_isInNoLanguageModeException = new PSNotSupportedException(RunspaceStrings.NotSupportedOnRestrictedRunspace, e);
|
||||
return PSLanguageMode.NoLanguage;
|
||||
}
|
||||
else throw;
|
||||
|
||||
@@ -1129,7 +1129,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
int throttleLimit, SessionFilterState filterState,
|
||||
Guid[] matchIds, string[] matchNames, string configurationName)
|
||||
{
|
||||
Collection<PSSession> filteredPSSesions = new Collection<PSSession>();
|
||||
Collection<PSSession> filteredPSSessions = new Collection<PSSession>();
|
||||
|
||||
// Create a query operation for each connection information object.
|
||||
foreach (WSManConnectionInfo connectionInfo in connectionInfos)
|
||||
@@ -1210,25 +1210,25 @@ namespace Microsoft.PowerShell.Commands
|
||||
{
|
||||
if (TestRunspaceState(existingPSSession.Runspace, filterState))
|
||||
{
|
||||
filteredPSSesions.Add(existingPSSession);
|
||||
filteredPSSessions.Add(existingPSSession);
|
||||
}
|
||||
}
|
||||
else if (TestRunspaceState(runspace, filterState))
|
||||
{
|
||||
filteredPSSesions.Add(new PSSession(runspace as RemoteRunspace));
|
||||
filteredPSSessions.Add(new PSSession(runspace as RemoteRunspace));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Return only PSSessions that match provided Ids or Names.
|
||||
if ((matchIds != null) && (filteredPSSesions.Count > 0))
|
||||
if ((matchIds != null) && (filteredPSSessions.Count > 0))
|
||||
{
|
||||
Collection<PSSession> matchIdsSessions = new Collection<PSSession>();
|
||||
foreach (Guid id in matchIds)
|
||||
{
|
||||
bool matchFound = false;
|
||||
foreach (PSSession psSession in filteredPSSesions)
|
||||
foreach (PSSession psSession in filteredPSSessions)
|
||||
{
|
||||
if (_stopProcessing)
|
||||
{
|
||||
@@ -1255,14 +1255,14 @@ namespace Microsoft.PowerShell.Commands
|
||||
// Return all found sessions.
|
||||
return matchIdsSessions;
|
||||
}
|
||||
else if ((matchNames != null) && (filteredPSSesions.Count > 0))
|
||||
else if ((matchNames != null) && (filteredPSSessions.Count > 0))
|
||||
{
|
||||
Collection<PSSession> matchNamesSessions = new Collection<PSSession>();
|
||||
foreach (string name in matchNames)
|
||||
{
|
||||
WildcardPattern namePattern = WildcardPattern.Get(name, WildcardOptions.IgnoreCase);
|
||||
bool matchFound = false;
|
||||
foreach (PSSession psSession in filteredPSSesions)
|
||||
foreach (PSSession psSession in filteredPSSessions)
|
||||
{
|
||||
if (_stopProcessing)
|
||||
{
|
||||
@@ -1290,7 +1290,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
else
|
||||
{
|
||||
// Return all collected sessions.
|
||||
return filteredPSSesions;
|
||||
return filteredPSSessions;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2952,8 +2952,8 @@ Set-SessionPluginQuota $args[0]
|
||||
";
|
||||
|
||||
private const string setSessionConfigurationTimeoutQuotasSbFormat = @"
|
||||
function Set-SessionPluginIdleTimeoutQuotas([int] $maxIdleTimeoutms, [int] $idleTimeoutms, [bool] $setMaxIdleTimoutFirst) {{
|
||||
if ($setMaxIdleTimoutFirst) {{
|
||||
function Set-SessionPluginIdleTimeoutQuotas([int] $maxIdleTimeoutms, [int] $idleTimeoutms, [bool] $setMaxIdleTimeoutFirst) {{
|
||||
if ($setMaxIdleTimeoutFirst) {{
|
||||
set-item -WarningAction SilentlyContinue 'WSMan:\localhost\Plugin\{0}\Quotas\MaxIdleTimeoutms' -Value $maxIdleTimeoutms -confirm:$false
|
||||
set-item -WarningAction SilentlyContinue 'WSMan:\localhost\Plugin\{0}\Quotas\IdleTimeoutms' -Value $idleTimeoutms -confirm:$false
|
||||
}}
|
||||
@@ -3571,7 +3571,7 @@ Set-PSSessionConfiguration $args[0] $args[1] $args[2] $args[3] $args[4] $args[5]
|
||||
|
||||
if (idleTimeOut != 0 && quotas.ContainsKey(WSManConfigurationOption.AttribMaxIdleTimeout))
|
||||
{
|
||||
bool setMaxIdleTimoutFirst = true;
|
||||
bool setMaxIdleTimeoutFirst = true;
|
||||
int maxIdleTimeOut;
|
||||
|
||||
if (LanguagePrimitives.TryConvertTo<int>(quotas[WSManConfigurationOption.AttribMaxIdleTimeout], out maxIdleTimeOut))
|
||||
@@ -3594,7 +3594,7 @@ Set-PSSessionConfiguration $args[0] $args[1] $args[2] $args[3] $args[4] $args[5]
|
||||
|
||||
if (currentIdleTimeoutms >= maxIdleTimeOut && currentIdleTimeoutms >= idleTimeOut)
|
||||
{
|
||||
setMaxIdleTimoutFirst = false;
|
||||
setMaxIdleTimeoutFirst = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3609,7 +3609,7 @@ Set-PSSessionConfiguration $args[0] $args[1] $args[2] $args[3] $args[4] $args[5]
|
||||
dollarUnder: AutomationNull.Value,
|
||||
input: Utils.EmptyArray<object>(),
|
||||
scriptThis: AutomationNull.Value,
|
||||
args: new object[] { maxIdleTimeOut, idleTimeOut, setMaxIdleTimoutFirst });
|
||||
args: new object[] { maxIdleTimeOut, idleTimeOut, setMaxIdleTimeoutFirst });
|
||||
|
||||
// Remove Idle timeout values as we have set them above
|
||||
//
|
||||
@@ -4410,7 +4410,7 @@ $_ | Enable-PSSessionConfiguration -force $args[0] -sddl $args[1] -isSDDLSpecifi
|
||||
|
||||
string qcCaptionMessage = StringUtil.Format(RemotingErrorIdStrings.EcsWSManQCCaption);
|
||||
string qcQueryMessage = StringUtil.Format(RemotingErrorIdStrings.EcsWSManQCQuery, setWSManConfigCommand);
|
||||
string qcShoudProcessDesc = StringUtil.Format(RemotingErrorIdStrings.EcsWSManShouldProcessDesc, setWSManConfigCommand);
|
||||
string qcShouldProcessDesc = StringUtil.Format(RemotingErrorIdStrings.EcsWSManShouldProcessDesc, setWSManConfigCommand);
|
||||
string setCaptionMessage = StringUtil.Format(RemotingErrorIdStrings.CSShouldProcessAction,
|
||||
"Set-PSSessionConfiguration");
|
||||
string setQueryMessage = RemotingErrorIdStrings.EcsShouldProcessTarget;
|
||||
@@ -4434,7 +4434,7 @@ $_ | Enable-PSSessionConfiguration -force $args[0] -sddl $args[1] -isSDDLSpecifi
|
||||
qcCaptionMessage,
|
||||
whatIf,
|
||||
confirm,
|
||||
qcShoudProcessDesc,
|
||||
qcShouldProcessDesc,
|
||||
setEnabledTarget,
|
||||
setEnabledAction,
|
||||
_skipNetworkProfileCheck,
|
||||
|
||||
+3
-3
@@ -1915,7 +1915,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
{
|
||||
for (int i = 0; i < values.Length;)
|
||||
{
|
||||
WriteRequriedGroup(values[i++], sb);
|
||||
WriteRequiredGroup(values[i++], sb);
|
||||
|
||||
if (i < values.Length)
|
||||
{
|
||||
@@ -1925,7 +1925,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
WriteRequriedGroup(keyObject, sb);
|
||||
WriteRequiredGroup(keyObject, sb);
|
||||
}
|
||||
|
||||
sb.Append(" }");
|
||||
@@ -1933,7 +1933,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static void WriteRequriedGroup(object value, StringBuilder sb)
|
||||
private static void WriteRequiredGroup(object value, StringBuilder sb)
|
||||
{
|
||||
string strValue = value as string;
|
||||
if (strValue != null)
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
}
|
||||
}
|
||||
|
||||
private void InvokeEndProcesingAction()
|
||||
private void InvokeEndProcessingAction()
|
||||
{
|
||||
_endProcessingActionIsReady.Wait();
|
||||
|
||||
@@ -270,7 +270,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
}
|
||||
}
|
||||
|
||||
private void CleanUpTimoutTracking()
|
||||
private void CleanUpTimeoutTracking()
|
||||
{
|
||||
lock (_timerLock)
|
||||
{
|
||||
@@ -346,7 +346,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
protected override void EndProcessing()
|
||||
{
|
||||
this.StartJobChangesTracking();
|
||||
this.InvokeEndProcesingAction();
|
||||
this.InvokeEndProcessingAction();
|
||||
if (_warnNotTerminal)
|
||||
{
|
||||
WriteWarning(RemotingErrorIdStrings.JobSuspendedDisconnectedWaitWithForce);
|
||||
@@ -420,7 +420,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
{
|
||||
_isDisposed = true;
|
||||
|
||||
this.CleanUpTimoutTracking();
|
||||
this.CleanUpTimeoutTracking();
|
||||
this.CleanUpJobChangesTracking();
|
||||
this.CleanUpEndProcessing(); // <- has to be last
|
||||
}
|
||||
|
||||
@@ -487,9 +487,9 @@ namespace Microsoft.PowerShell.Commands
|
||||
}
|
||||
|
||||
// add host identification information in data structure handler message
|
||||
PSRemotingDataStructureException protoExeption = reason as PSRemotingDataStructureException;
|
||||
PSRemotingDataStructureException protoException = reason as PSRemotingDataStructureException;
|
||||
|
||||
if (protoExeption != null)
|
||||
if (protoException != null)
|
||||
{
|
||||
OpenRunspaceOperation senderAsOp = sender as OpenRunspaceOperation;
|
||||
|
||||
@@ -497,7 +497,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
{
|
||||
String host = senderAsOp.OperatedRunspace.ConnectionInfo.ComputerName;
|
||||
|
||||
errorDetails = "[" + host + "] " + protoExeption.Message;
|
||||
errorDetails = "[" + host + "] " + protoException.Message;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ namespace System.Management.Automation.Remoting
|
||||
internal const uint TRUNCATE_EXISTING = 5;
|
||||
|
||||
internal const uint SECURITY_IMPERSONATIONLEVEL_ANONYMOUS = 0;
|
||||
internal const uint SECURITY_IMPERSONATIONLEVEL_IDENTIFCATION = 1;
|
||||
internal const uint SECURITY_IMPERSONATIONLEVEL_IDENTIFICATION = 1;
|
||||
internal const uint SECURITY_IMPERSONATIONLEVEL_IMPERSONATION = 2;
|
||||
internal const uint SECURITY_IMPERSONATIONLEVEL_DELEGATION = 3;
|
||||
|
||||
@@ -579,10 +579,10 @@ namespace System.Management.Automation.Remoting
|
||||
IsListenerRunning = true;
|
||||
|
||||
// Create listener thread.
|
||||
Thread listenterThread = new Thread(ProcessListeningThread);
|
||||
listenterThread.Name = _threadName;
|
||||
listenterThread.IsBackground = true;
|
||||
listenterThread.Start(clientConnectCallback);
|
||||
Thread listenerThread = new Thread(ProcessListeningThread);
|
||||
listenerThread.Name = _threadName;
|
||||
listenerThread.IsBackground = true;
|
||||
listenerThread.Start(clientConnectCallback);
|
||||
} // Lock _syncObject.
|
||||
}
|
||||
|
||||
|
||||
@@ -2710,7 +2710,7 @@ namespace System.Management.Automation.Runspaces
|
||||
string processParameters,
|
||||
ref HCS_PROCESS_INFORMATION processInformation,
|
||||
ref IntPtr process,
|
||||
ref string reslt);
|
||||
ref string result);
|
||||
|
||||
[DllImport(PinvokeDllNames.CreateProcessInComputeSystemDllName, SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
internal static extern uint HcsOpenProcess(
|
||||
|
||||
@@ -1229,7 +1229,7 @@ namespace System.Management.Automation.Remoting.Server
|
||||
// the following variable are used by onDataAvailableCallback.
|
||||
private bool _shouldFlushData;
|
||||
private bool _reportAsPending;
|
||||
private Guid _runpacePoolInstanceId;
|
||||
private Guid _runspacePoolInstanceId;
|
||||
private Guid _powerShellInstanceId;
|
||||
private RemotingDataType _dataType;
|
||||
private RemotingTargetInterface _targetInterface;
|
||||
@@ -1319,7 +1319,7 @@ namespace System.Management.Automation.Remoting.Server
|
||||
{
|
||||
_shouldFlushData = flush;
|
||||
_reportAsPending = reportPending;
|
||||
_runpacePoolInstanceId = dataToBeSent.RunspacePoolId;
|
||||
_runspacePoolInstanceId = dataToBeSent.RunspacePoolId;
|
||||
_powerShellInstanceId = dataToBeSent.PowerShellId;
|
||||
_dataType = dataToBeSent.DataType;
|
||||
_targetInterface = dataToBeSent.TargetInterface;
|
||||
@@ -1352,7 +1352,7 @@ namespace System.Management.Automation.Remoting.Server
|
||||
// log to crimson log.
|
||||
PSEtwLog.LogAnalyticInformational(PSEventId.ServerSendData, PSOpcode.Send, PSTask.None,
|
||||
PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic,
|
||||
_runpacePoolInstanceId.ToString(),
|
||||
_runspacePoolInstanceId.ToString(),
|
||||
_powerShellInstanceId.ToString(),
|
||||
dataToSend.Length.ToString(CultureInfo.InvariantCulture),
|
||||
(UInt32)_dataType,
|
||||
|
||||
+16
-16
@@ -969,19 +969,19 @@ namespace System.Management.Automation.Remoting
|
||||
new ConfigTypeEntry(Copyright, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(Description, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(EnforceInputParameterValidation,new ConfigTypeEntry.TypeValidationCallback(BooleanTypeValidationCallback)),
|
||||
new ConfigTypeEntry(EnvironmentVariables, new ConfigTypeEntry.TypeValidationCallback(HashtableTypeValiationCallback)),
|
||||
new ConfigTypeEntry(EnvironmentVariables, new ConfigTypeEntry.TypeValidationCallback(HashtableTypeValidationCallback)),
|
||||
new ConfigTypeEntry(ExecutionPolicy, new ConfigTypeEntry.TypeValidationCallback(ExecutionPolicyValidationCallback)),
|
||||
new ConfigTypeEntry(FormatsToProcess, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(FunctionDefinitions, new ConfigTypeEntry.TypeValidationCallback(FunctionDefinitionsTypeValidationCallback)),
|
||||
new ConfigTypeEntry(GMSAAccount, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(Guid, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(LanguageMode, new ConfigTypeEntry.TypeValidationCallback(LanugageModeValidationCallback)),
|
||||
new ConfigTypeEntry(LanguageMode, new ConfigTypeEntry.TypeValidationCallback(LanguageModeValidationCallback)),
|
||||
new ConfigTypeEntry(ModulesToImport, new ConfigTypeEntry.TypeValidationCallback(StringOrHashtableArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(MountUserDrive, new ConfigTypeEntry.TypeValidationCallback(BooleanTypeValidationCallback)),
|
||||
new ConfigTypeEntry(PowerShellVersion, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
new ConfigTypeEntry(RequiredGroups, new ConfigTypeEntry.TypeValidationCallback(HashtableTypeValiationCallback)),
|
||||
new ConfigTypeEntry(RequiredGroups, new ConfigTypeEntry.TypeValidationCallback(HashtableTypeValidationCallback)),
|
||||
new ConfigTypeEntry(RoleCapabilities, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(RoleDefinitions, new ConfigTypeEntry.TypeValidationCallback(HashtableTypeValiationCallback)),
|
||||
new ConfigTypeEntry(RoleDefinitions, new ConfigTypeEntry.TypeValidationCallback(HashtableTypeValidationCallback)),
|
||||
new ConfigTypeEntry(RunAsVirtualAccount, new ConfigTypeEntry.TypeValidationCallback(BooleanTypeValidationCallback)),
|
||||
new ConfigTypeEntry(RunAsVirtualAccountGroups, new ConfigTypeEntry.TypeValidationCallback(StringArrayTypeValidationCallback)),
|
||||
new ConfigTypeEntry(SchemaVersion, new ConfigTypeEntry.TypeValidationCallback(StringTypeValidationCallback)),
|
||||
@@ -1070,7 +1070,7 @@ namespace System.Management.Automation.Remoting
|
||||
/// <param name="cmdlet"></param>
|
||||
/// <param name="path"></param>
|
||||
/// <returns></returns>
|
||||
private static bool LanugageModeValidationCallback(string key, object obj, PSCmdlet cmdlet, string path)
|
||||
private static bool LanguageModeValidationCallback(string key, object obj, PSCmdlet cmdlet, string path)
|
||||
{
|
||||
string value = obj as string;
|
||||
|
||||
@@ -1134,7 +1134,7 @@ namespace System.Management.Automation.Remoting
|
||||
/// <param name="cmdlet"></param>
|
||||
/// <param name="path"></param>
|
||||
/// <returns></returns>
|
||||
private static bool HashtableTypeValiationCallback(string key, object obj, PSCmdlet cmdlet, string path)
|
||||
private static bool HashtableTypeValidationCallback(string key, object obj, PSCmdlet cmdlet, string path)
|
||||
{
|
||||
Hashtable hash = obj as Hashtable;
|
||||
|
||||
@@ -1935,10 +1935,10 @@ namespace System.Management.Automation.Remoting
|
||||
// Create the initial session state
|
||||
string initialSessionState = TryGetValue(_configHash, ConfigFileConstants.SessionType);
|
||||
SessionType sessionType = SessionType.Default;
|
||||
bool cmdletVisibilityApplied = IsNonDefaultVisibiltySpecified(ConfigFileConstants.VisibleCmdlets);
|
||||
bool functionVisiblityApplied = IsNonDefaultVisibiltySpecified(ConfigFileConstants.VisibleFunctions);
|
||||
bool aliasVisibilityApplied = IsNonDefaultVisibiltySpecified(ConfigFileConstants.VisibleAliases);
|
||||
bool providerVisibiltyApplied = IsNonDefaultVisibiltySpecified(ConfigFileConstants.VisibleProviders);
|
||||
bool cmdletVisibilityApplied = IsNonDefaultVisibilitySpecified(ConfigFileConstants.VisibleCmdlets);
|
||||
bool functionVisibilityApplied = IsNonDefaultVisibilitySpecified(ConfigFileConstants.VisibleFunctions);
|
||||
bool aliasVisibilityApplied = IsNonDefaultVisibilitySpecified(ConfigFileConstants.VisibleAliases);
|
||||
bool providerVisibilityApplied = IsNonDefaultVisibilitySpecified(ConfigFileConstants.VisibleProviders);
|
||||
bool processDefaultSessionStateVisibility = false;
|
||||
|
||||
if (!String.IsNullOrEmpty(initialSessionState))
|
||||
@@ -1965,8 +1965,8 @@ namespace System.Management.Automation.Remoting
|
||||
processDefaultSessionStateVisibility = true;
|
||||
}
|
||||
|
||||
if (cmdletVisibilityApplied || functionVisiblityApplied || aliasVisibilityApplied || providerVisibiltyApplied ||
|
||||
IsNonDefaultVisibiltySpecified(ConfigFileConstants.VisibleExternalCommands))
|
||||
if (cmdletVisibilityApplied || functionVisibilityApplied || aliasVisibilityApplied || providerVisibilityApplied ||
|
||||
IsNonDefaultVisibilitySpecified(ConfigFileConstants.VisibleExternalCommands))
|
||||
{
|
||||
iss.DefaultCommandVisibility = SessionStateEntryVisibility.Private;
|
||||
|
||||
@@ -1982,7 +1982,7 @@ namespace System.Management.Automation.Remoting
|
||||
}
|
||||
|
||||
// Add providers
|
||||
if (providerVisibiltyApplied)
|
||||
if (providerVisibilityApplied)
|
||||
{
|
||||
string[] providers = TryGetStringArray(_configHash[ConfigFileConstants.VisibleProviders]);
|
||||
|
||||
@@ -2167,7 +2167,7 @@ namespace System.Management.Automation.Remoting
|
||||
{
|
||||
foreach (Hashtable function in functions)
|
||||
{
|
||||
SessionStateFunctionEntry entry = CreateSessionStateFunctionEntry(function, functionVisiblityApplied);
|
||||
SessionStateFunctionEntry entry = CreateSessionStateFunctionEntry(function, functionVisibilityApplied);
|
||||
|
||||
if (entry != null)
|
||||
{
|
||||
@@ -2317,7 +2317,7 @@ namespace System.Management.Automation.Remoting
|
||||
}
|
||||
|
||||
// Now apply visibility logic
|
||||
if (cmdletVisibilityApplied || functionVisiblityApplied || aliasVisibilityApplied || providerVisibiltyApplied)
|
||||
if (cmdletVisibilityApplied || functionVisibilityApplied || aliasVisibilityApplied || providerVisibilityApplied)
|
||||
{
|
||||
if (sessionType == SessionType.Default)
|
||||
{
|
||||
@@ -2723,7 +2723,7 @@ namespace System.Management.Automation.Remoting
|
||||
/// </summary>
|
||||
/// <param name="configFileKey"></param>
|
||||
/// <returns></returns>
|
||||
private bool IsNonDefaultVisibiltySpecified(string configFileKey)
|
||||
private bool IsNonDefaultVisibilitySpecified(string configFileKey)
|
||||
{
|
||||
if (_configHash.ContainsKey(configFileKey))
|
||||
{
|
||||
|
||||
@@ -478,7 +478,7 @@ namespace System.Management.Automation.Remoting.Client
|
||||
_dataProcessingCallbacks.CommandCreationPacketReceived += new OutOfProcessUtils.CommandCreationPacketReceived(OnCommandCreationPacketReceived);
|
||||
_dataProcessingCallbacks.CommandCreationAckReceived += new OutOfProcessUtils.CommandCreationAckReceived(OnCommandCreationAckReceived);
|
||||
_dataProcessingCallbacks.SignalPacketReceived += new OutOfProcessUtils.SignalPacketReceived(OnSignalPacketReceived);
|
||||
_dataProcessingCallbacks.SignalAckPacketReceived += new OutOfProcessUtils.SignalAckPacketReceived(OnSiganlAckPacketReceived);
|
||||
_dataProcessingCallbacks.SignalAckPacketReceived += new OutOfProcessUtils.SignalAckPacketReceived(OnSignalAckPacketReceived);
|
||||
_dataProcessingCallbacks.ClosePacketReceived += new OutOfProcessUtils.ClosePacketReceived(OnClosePacketReceived);
|
||||
_dataProcessingCallbacks.CloseAckPacketReceived += new OutOfProcessUtils.CloseAckPacketReceived(OnCloseAckReceived);
|
||||
|
||||
@@ -860,7 +860,7 @@ namespace System.Management.Automation.Remoting.Client
|
||||
OutOfProcessUtils.PS_OUT_OF_PROC_SIGNAL_TAG);
|
||||
}
|
||||
|
||||
private void OnSiganlAckPacketReceived(Guid psGuid)
|
||||
private void OnSignalAckPacketReceived(Guid psGuid)
|
||||
{
|
||||
if (psGuid == Guid.Empty)
|
||||
{
|
||||
|
||||
@@ -478,7 +478,7 @@ namespace System.Management.Automation.Remoting
|
||||
catch (System.OverflowException)
|
||||
{
|
||||
s_baseTracer.WriteLine("Fragement too big.");
|
||||
ResetRecieveData();
|
||||
ResetReceiveData();
|
||||
PSRemotingTransportException e = new PSRemotingTransportException(RemotingErrorIdStrings.ObjectIsTooBig);
|
||||
throw e;
|
||||
}
|
||||
@@ -513,7 +513,7 @@ namespace System.Management.Automation.Remoting
|
||||
_totalReceivedObjectSizeSoFar, _maxReceivedObjectSize);
|
||||
}
|
||||
|
||||
ResetRecieveData();
|
||||
ResetReceiveData();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@@ -572,7 +572,7 @@ namespace System.Management.Automation.Remoting
|
||||
{
|
||||
s_baseTracer.WriteLine("ObjectId != CurrentObjectId");
|
||||
//TODO - drop an ETW event
|
||||
ResetRecieveData();
|
||||
ResetReceiveData();
|
||||
if (!_canIgnoreOffSyncFragments)
|
||||
{
|
||||
PSRemotingTransportException e = new PSRemotingTransportException(RemotingErrorIdStrings.ObjectIdsNotMatching);
|
||||
@@ -589,7 +589,7 @@ namespace System.Management.Automation.Remoting
|
||||
{
|
||||
s_baseTracer.WriteLine("Fragment Id is not in sequence.");
|
||||
//TODO - drop an ETW event
|
||||
ResetRecieveData();
|
||||
ResetReceiveData();
|
||||
if (!_canIgnoreOffSyncFragments)
|
||||
{
|
||||
PSRemotingTransportException e = new PSRemotingTransportException(RemotingErrorIdStrings.FragmetIdsNotInSequence);
|
||||
@@ -624,7 +624,7 @@ namespace System.Management.Automation.Remoting
|
||||
finally
|
||||
{
|
||||
// Reset the receive data buffers and start the process again.
|
||||
ResetRecieveData();
|
||||
ResetReceiveData();
|
||||
}
|
||||
|
||||
if (_isDisposed)
|
||||
@@ -650,7 +650,7 @@ namespace System.Management.Automation.Remoting
|
||||
/// <summary>
|
||||
/// Resets the store(s) holding received data.
|
||||
/// </summary>
|
||||
private void ResetRecieveData()
|
||||
private void ResetReceiveData()
|
||||
{
|
||||
// reset resources used to store incoming data (for a single object)
|
||||
if (null != _dataToProcessStream)
|
||||
|
||||
@@ -134,7 +134,7 @@ namespace System.Management.Automation.Remoting.Client
|
||||
|
||||
internal const int ERROR_WSMAN_COMPUTER_NOTFOUND = -2144108103;
|
||||
|
||||
internal const int ERROR_WSMAN_TARGET_UNKOWN = -2146893053;
|
||||
internal const int ERROR_WSMAN_TARGET_UNKNOWN = -2146893053;
|
||||
|
||||
internal const int ERROR_WSMAN_CANNOTUSE_IP = -2144108101;
|
||||
|
||||
|
||||
@@ -1487,7 +1487,7 @@ namespace System.Management.Automation.Remoting
|
||||
WSManPluginConstants.WSManPluginParamsGetRequestedLocale,
|
||||
outputStruct);
|
||||
//ref nativeLocaleData);
|
||||
bool retreivingLocaleSucceeded = (0 == hResult);
|
||||
bool retrievingLocaleSucceeded = (0 == hResult);
|
||||
WSManNativeApi.WSManData_UnToMan localeData = WSManNativeApi.WSManData_UnToMan.UnMarshal(outputStruct); // nativeLocaleData
|
||||
|
||||
//IntPtr nativeDataLocaleData = IntPtr.Zero;
|
||||
@@ -1496,13 +1496,13 @@ namespace System.Management.Automation.Remoting
|
||||
WSManPluginConstants.WSManPluginParamsGetRequestedDataLocale,
|
||||
outputStruct);
|
||||
//ref nativeDataLocaleData);
|
||||
bool retreivingDataLocaleSucceeded = ((int)WSManPluginErrorCodes.NoError == hResult);
|
||||
bool retrievingDataLocaleSucceeded = ((int)WSManPluginErrorCodes.NoError == hResult);
|
||||
WSManNativeApi.WSManData_UnToMan dataLocaleData = WSManNativeApi.WSManData_UnToMan.UnMarshal(outputStruct); // nativeDataLocaleData
|
||||
|
||||
// Set the UI Culture
|
||||
try
|
||||
{
|
||||
if (retreivingLocaleSucceeded && ((uint)WSManNativeApi.WSManDataType.WSMAN_DATA_TYPE_TEXT == localeData.Type))
|
||||
if (retrievingLocaleSucceeded && ((uint)WSManNativeApi.WSManDataType.WSMAN_DATA_TYPE_TEXT == localeData.Type))
|
||||
{
|
||||
CultureInfo uiCultureToUse = new CultureInfo(localeData.Text);
|
||||
ClrFacade.SetCurrentThreadUiCulture(uiCultureToUse);
|
||||
@@ -1516,7 +1516,7 @@ namespace System.Management.Automation.Remoting
|
||||
// Set the Culture
|
||||
try
|
||||
{
|
||||
if (retreivingDataLocaleSucceeded && ((uint)WSManNativeApi.WSManDataType.WSMAN_DATA_TYPE_TEXT == dataLocaleData.Type))
|
||||
if (retrievingDataLocaleSucceeded && ((uint)WSManNativeApi.WSManDataType.WSMAN_DATA_TYPE_TEXT == dataLocaleData.Type))
|
||||
{
|
||||
CultureInfo cultureToUse = new CultureInfo(dataLocaleData.Text);
|
||||
ClrFacade.SetCurrentThreadCulture(cultureToUse);
|
||||
|
||||
@@ -55,11 +55,11 @@ namespace System.Management.Automation.Remoting
|
||||
|
||||
protected WSManPluginServerSession(
|
||||
WSManNativeApi.WSManPluginRequest creationRequestDetails,
|
||||
WSManPluginServerTransportManager trnsprtMgr)
|
||||
WSManPluginServerTransportManager transportMgr)
|
||||
{
|
||||
_syncObject = new Object();
|
||||
this.creationRequestDetails = creationRequestDetails;
|
||||
this.transportMgr = trnsprtMgr;
|
||||
this.transportMgr = transportMgr;
|
||||
|
||||
transportMgr.PrepareCalled +=
|
||||
new EventHandler<EventArgs>(this.HandlePrepareFromTransportManager);
|
||||
@@ -416,10 +416,10 @@ namespace System.Management.Automation.Remoting
|
||||
#region Constructor
|
||||
internal WSManPluginShellSession(
|
||||
WSManNativeApi.WSManPluginRequest creationRequestDetails,
|
||||
WSManPluginServerTransportManager trnsprtMgr,
|
||||
WSManPluginServerTransportManager transportMgr,
|
||||
ServerRemoteSession remoteSession,
|
||||
WSManPluginOperationShutdownContext shutDownContext)
|
||||
: base(creationRequestDetails, trnsprtMgr)
|
||||
: base(creationRequestDetails, transportMgr)
|
||||
{
|
||||
_remoteSession = remoteSession;
|
||||
_remoteSession.Closed +=
|
||||
@@ -744,9 +744,9 @@ namespace System.Management.Automation.Remoting
|
||||
|
||||
internal WSManPluginCommandSession(
|
||||
WSManNativeApi.WSManPluginRequest creationRequestDetails,
|
||||
WSManPluginServerTransportManager trnsprtMgr,
|
||||
WSManPluginServerTransportManager transportMgr,
|
||||
ServerRemoteSession remoteSession)
|
||||
: base(creationRequestDetails, trnsprtMgr)
|
||||
: base(creationRequestDetails, transportMgr)
|
||||
{
|
||||
_remoteSession = remoteSession;
|
||||
cmdSyncObject = new System.Object();
|
||||
|
||||
+2
-2
@@ -105,9 +105,9 @@ namespace System.Management.Automation.Remoting
|
||||
{
|
||||
RaiseClosingEvent();
|
||||
|
||||
foreach (var cmdTrsprtKvp in _activeCmdTransportManagers)
|
||||
foreach (var cmdTransportKvp in _activeCmdTransportManagers)
|
||||
{
|
||||
cmdTrsprtKvp.Value.Close(reasonForClose);
|
||||
cmdTransportKvp.Value.Close(reasonForClose);
|
||||
}
|
||||
_activeCmdTransportManagers.Clear();
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace System.Management.Automation.Remoting.Client
|
||||
{WSManNativeApi.ERROR_WSMAN_BAD_METHOD, "WinRMOperationNotSupportedOnServer"},
|
||||
{WSManNativeApi.ERROR_WSMAN_HTTP_SERVICE_UNAVAILABLE, "CannotConnectWinRMService"},
|
||||
{WSManNativeApi.ERROR_WSMAN_HTTP_SERVICE_ERROR, "WinRMHttpError"},
|
||||
{WSManNativeApi.ERROR_WSMAN_TARGET_UNKOWN, "TargetUnknown"},
|
||||
{WSManNativeApi.ERROR_WSMAN_TARGET_UNKNOWN, "TargetUnknown"},
|
||||
{WSManNativeApi.ERROR_WSMAN_CANNOTUSE_IP, "CannotUseIPAddress"}
|
||||
};
|
||||
|
||||
@@ -329,7 +329,7 @@ namespace System.Management.Automation.Remoting.Client
|
||||
[SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")]
|
||||
private IntPtr _wsManShellOperationHandle;
|
||||
[SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")]
|
||||
private IntPtr _wsManRecieveOperationHandle;
|
||||
private IntPtr _wsManReceiveOperationHandle;
|
||||
[SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")]
|
||||
private IntPtr _wsManSendOperationHandle;
|
||||
// this is used with WSMan callbacks to represent a session transport manager.
|
||||
@@ -1018,7 +1018,7 @@ namespace System.Management.Automation.Remoting.Client
|
||||
_receivedFromRemote = new WSManNativeApi.WSManShellAsync(new IntPtr(_sessionContextID), s_sessionReceiveCallback);
|
||||
WSManNativeApi.WSManReceiveShellOutputEx(_wsManShellOperationHandle,
|
||||
IntPtr.Zero, 0, WSManAPIData.OutputStreamSet, _receivedFromRemote,
|
||||
ref _wsManRecieveOperationHandle);
|
||||
ref _wsManReceiveOperationHandle);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1675,10 +1675,10 @@ namespace System.Management.Automation.Remoting.Client
|
||||
// clearing for receive..Clear only when the end of operation is reached.
|
||||
if (flags == (int)WSManNativeApi.WSManCallbackFlags.WSMAN_FLAG_CALLBACK_END_OF_OPERATION)
|
||||
{
|
||||
if (IntPtr.Zero != _wsManRecieveOperationHandle)
|
||||
if (IntPtr.Zero != _wsManReceiveOperationHandle)
|
||||
{
|
||||
WSManNativeApi.WSManCloseOperation(_wsManRecieveOperationHandle, 0);
|
||||
_wsManRecieveOperationHandle = IntPtr.Zero;
|
||||
WSManNativeApi.WSManCloseOperation(_wsManReceiveOperationHandle, 0);
|
||||
_wsManReceiveOperationHandle = IntPtr.Zero;
|
||||
}
|
||||
|
||||
if (null != _receivedFromRemote)
|
||||
@@ -2719,7 +2719,7 @@ namespace System.Management.Automation.Remoting.Client
|
||||
[SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")]
|
||||
private IntPtr _cmdSignalOperationHandle;
|
||||
[SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")]
|
||||
private IntPtr _wsManRecieveOperationHandle;
|
||||
private IntPtr _wsManReceiveOperationHandle;
|
||||
[SuppressMessage("Microsoft.Reliability", "CA2006:UseSafeHandleToEncapsulateNativeResources")]
|
||||
private IntPtr _wsManSendOperationHandle;
|
||||
// this is used with WSMan callbacks to represent a command transport manager.
|
||||
@@ -2857,7 +2857,7 @@ namespace System.Management.Automation.Remoting.Client
|
||||
new PrioritySendDataCollection.OnDataAvailableCallback(OnDataAvailableCallback);
|
||||
_sessnTm = sessnTM;
|
||||
// Suspend queue on robust connections initiated event.
|
||||
sessnTM.RobustConnectionsInitiated += HandleRobustConnectionsIntiated;
|
||||
sessnTM.RobustConnectionsInitiated += HandleRobustConnectionsInitiated;
|
||||
|
||||
// Resume queue on robust connections completed event.
|
||||
sessnTM.RobustConnectionsCompleted += HandleRobusConnectionsCompleted;
|
||||
@@ -2873,7 +2873,7 @@ namespace System.Management.Automation.Remoting.Client
|
||||
|
||||
#region Internal Methods / Properties
|
||||
|
||||
private void HandleRobustConnectionsIntiated(object sender, EventArgs e)
|
||||
private void HandleRobustConnectionsInitiated(object sender, EventArgs e)
|
||||
{
|
||||
SuspendQueue();
|
||||
}
|
||||
@@ -3210,10 +3210,10 @@ namespace System.Management.Automation.Remoting.Client
|
||||
// clearing for receive..Clear only when the end of operation is reached.
|
||||
if (flags == (int)WSManNativeApi.WSManCallbackFlags.WSMAN_FLAG_CALLBACK_END_OF_OPERATION)
|
||||
{
|
||||
if (IntPtr.Zero != _wsManRecieveOperationHandle)
|
||||
if (IntPtr.Zero != _wsManReceiveOperationHandle)
|
||||
{
|
||||
WSManNativeApi.WSManCloseOperation(_wsManRecieveOperationHandle, 0);
|
||||
_wsManRecieveOperationHandle = IntPtr.Zero;
|
||||
WSManNativeApi.WSManCloseOperation(_wsManReceiveOperationHandle, 0);
|
||||
_wsManReceiveOperationHandle = IntPtr.Zero;
|
||||
}
|
||||
|
||||
if (null != _receivedFromRemote)
|
||||
@@ -3930,7 +3930,7 @@ namespace System.Management.Automation.Remoting.Client
|
||||
WSManNativeApi.WSManReceiveShellOutputEx(_wsManShellOperationHandle,
|
||||
_wsManCmdOperationHandle, startInDisconnectedMode ? (int)WSManNativeApi.WSManShellFlag.WSMAN_FLAG_RECEIVE_DELAY_OUTPUT_STREAM : 0,
|
||||
_sessnTm.WSManAPIData.OutputStreamSet,
|
||||
_receivedFromRemote, ref _wsManRecieveOperationHandle);
|
||||
_receivedFromRemote, ref _wsManReceiveOperationHandle);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3949,7 +3949,7 @@ namespace System.Management.Automation.Remoting.Client
|
||||
// unregister event handlers
|
||||
if (null != _sessnTm)
|
||||
{
|
||||
_sessnTm.RobustConnectionsInitiated -= HandleRobustConnectionsIntiated;
|
||||
_sessnTm.RobustConnectionsInitiated -= HandleRobustConnectionsInitiated;
|
||||
_sessnTm.RobustConnectionsCompleted -= HandleRobusConnectionsCompleted;
|
||||
}
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@ namespace System.Management.Automation
|
||||
DataStructureHandler.SetMinRunspacesReceived +=
|
||||
new EventHandler<RemoteDataEventArgs<PSObject>>(HandleSetMinRunspacesReceived);
|
||||
DataStructureHandler.GetAvailableRunspacesReceived +=
|
||||
new EventHandler<RemoteDataEventArgs<PSObject>>(HandleGetAvailalbeRunspacesReceived);
|
||||
new EventHandler<RemoteDataEventArgs<PSObject>>(HandleGetAvailableRunspacesReceived);
|
||||
DataStructureHandler.ResetRunspaceState +=
|
||||
new EventHandler<RemoteDataEventArgs<PSObject>>(HandleResetRunspaceState);
|
||||
}
|
||||
@@ -1143,7 +1143,7 @@ namespace System.Management.Automation
|
||||
/// </summary>
|
||||
/// <param name="sender">sender of this event, unused</param>
|
||||
/// <param name="eventArgs">contains information on the callid</param>
|
||||
private void HandleGetAvailalbeRunspacesReceived(object sender, RemoteDataEventArgs<PSObject> eventArgs)
|
||||
private void HandleGetAvailableRunspacesReceived(object sender, RemoteDataEventArgs<PSObject> eventArgs)
|
||||
{
|
||||
PSObject data = eventArgs.Data;
|
||||
long callId = (long)((PSNoteProperty)data.Properties[RemoteDataNameStrings.CallId]).Value;
|
||||
|
||||
+5
-5
@@ -434,7 +434,7 @@ namespace System.Management.Automation
|
||||
internal void SetState(PSInvocationState newState, Exception reason)
|
||||
{
|
||||
PSInvocationState copyState = PSInvocationState.NotStarted;
|
||||
bool shoulRaiseEvents = false;
|
||||
bool shouldRaiseEvents = false;
|
||||
lock (SyncObject)
|
||||
{
|
||||
switch (PipelineState)
|
||||
@@ -471,7 +471,7 @@ namespace System.Management.Automation
|
||||
case PSInvocationState.Stopped:
|
||||
case PSInvocationState.Failed:
|
||||
copyState = newState;
|
||||
shoulRaiseEvents = true;
|
||||
shouldRaiseEvents = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -484,11 +484,11 @@ namespace System.Management.Automation
|
||||
case PSInvocationState.Completed:
|
||||
case PSInvocationState.Failed:
|
||||
copyState = PSInvocationState.Stopped;
|
||||
shoulRaiseEvents = true;
|
||||
shouldRaiseEvents = true;
|
||||
break;
|
||||
case PSInvocationState.Stopped:
|
||||
copyState = newState;
|
||||
shoulRaiseEvents = true;
|
||||
shouldRaiseEvents = true;
|
||||
break;
|
||||
default:
|
||||
throw new InvalidOperationException();
|
||||
@@ -505,7 +505,7 @@ namespace System.Management.Automation
|
||||
PipelineState = copyState;
|
||||
}
|
||||
|
||||
if (shoulRaiseEvents)
|
||||
if (shouldRaiseEvents)
|
||||
{
|
||||
// send the state change notification to the client
|
||||
DataStructureHandler.SendStateChangedInformationToClient(
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace System.Management.Automation.Remoting
|
||||
#endif
|
||||
|
||||
Context = new ServerRemoteSessionContext();
|
||||
SessionDataStructureHandler = new ServerRemoteSessionDSHandlerlImpl(this, transportManager);
|
||||
SessionDataStructureHandler = new ServerRemoteSessionDSHandlerImpl(this, transportManager);
|
||||
BaseSessionDataStructureHandler = SessionDataStructureHandler;
|
||||
SessionDataStructureHandler.CreateRunspacePoolReceived += HandleCreateRunspacePool;
|
||||
SessionDataStructureHandler.NegotiationReceived += HandleNegotiationReceived;
|
||||
|
||||
+2
-2
@@ -1026,10 +1026,10 @@ namespace System.Management.Automation.Remoting
|
||||
/// <param name="newState">
|
||||
/// The new state.
|
||||
/// </param>
|
||||
/// <param name="reasion">
|
||||
/// <param name="reason">
|
||||
/// Optional parameter that can provide additional information. This is currently not used.
|
||||
/// </param>
|
||||
private void SetState(RemoteSessionState newState, Exception reasion)
|
||||
private void SetState(RemoteSessionState newState, Exception reason)
|
||||
{
|
||||
RemoteSessionState oldState = _state;
|
||||
if (newState != oldState)
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@ namespace System.Management.Automation.Remoting
|
||||
/// <summary>
|
||||
/// This class is an implementation of the abstract class ServerRemoteSessionDataStructureHandler.
|
||||
/// </summary>
|
||||
internal class ServerRemoteSessionDSHandlerlImpl : ServerRemoteSessionDataStructureHandler
|
||||
internal class ServerRemoteSessionDSHandlerImpl : ServerRemoteSessionDataStructureHandler
|
||||
{
|
||||
private AbstractServerSessionTransportManager _transportManager;
|
||||
private ServerRemoteSessionDSHandlerStateMachine _stateMachine;
|
||||
@@ -34,7 +34,7 @@ namespace System.Management.Automation.Remoting
|
||||
/// </summary>
|
||||
/// <param name="session"></param>
|
||||
/// <param name="transportManager"></param>
|
||||
internal ServerRemoteSessionDSHandlerlImpl(ServerRemoteSession session,
|
||||
internal ServerRemoteSessionDSHandlerImpl(ServerRemoteSession session,
|
||||
AbstractServerSessionTransportManager transportManager)
|
||||
{
|
||||
Dbg.Assert(null != session, "session cannot be null.");
|
||||
|
||||
Reference in New Issue
Block a user