internal override void SendStopSignal() { lock (base.syncObject) { if (!base.isClosed) { if (!this.isCreateCallbackReceived) { this.isStopSignalPending = true; } else { this.isStopSignalPending = false; BaseClientTransportManager.tracer.WriteLine("Sending stop signal with command context: {0} Operation Context {1}", new object[] { this.cmdContextId, this.wsManCmdOperationHandle }); PSEtwLog.LogAnalyticInformational(PSEventId.WSManSignal, PSOpcode.Disconnect, PSTask.None, PSKeyword.Transport | PSKeyword.UseAlwaysAnalytic, new object[] { base.RunspacePoolInstanceId.ToString(), this.powershellInstanceId.ToString(), StopSignal }); this.signalCmdCompleted = new WSManNativeApi.WSManShellAsync(new IntPtr(this.cmdContextId), cmdSignalCallback); WSManNativeApi.WSManSignalShellEx(this.wsManShellOperationHandle, this.wsManCmdOperationHandle, 0, StopSignal, (IntPtr)this.signalCmdCompleted, ref this.cmdSignalOperationHandle); } } } }
internal override void SendStopSignal() { lock (this.syncObject) { if (this.isClosed) { return; } if (!this.isCreateCallbackReceived) { this.isStopSignalPending = true; } else { this.isStopSignalPending = false; BaseClientTransportManager.tracer.WriteLine("Sending stop signal with command context: {0} Operation Context {1}", (object)this.cmdContextId, (object)this.wsManCmdOperationHandle); BaseTransportManager.ETWTracer.AnalyticChannel.WriteInformation(PSEventId.WSManSignal, PSOpcode.Disconnect, PSTask.None, (object)this.RunspacePoolInstanceId, (object)this.powershellInstanceId, (object)"powershell/signal/crtl_c"); this.signalCmdCompleted = new WSManNativeApi.WSManShellAsync(new IntPtr(this.cmdContextId), WSManClientCommandTransportManager.cmdSignalCallback); WSManNativeApi.WSManSignalShellEx(this.wsManShellOperationHandle, this.wsManCmdOperationHandle, 0, "powershell/signal/crtl_c", (IntPtr)this.signalCmdCompleted, ref this.cmdSignalOperationHandle); } } }