71 references to WindowsProcessInterop
aspire (43)
Processes\IsolatedProcess.Windows.cs (34)
18
/// then delegates to <see cref="
WindowsProcessInterop
.SpawnProcess"/> for the actual
40
var nulStdinHandle =
WindowsProcessInterop
.CreateFileW(
42
WindowsProcessInterop
.GenericRead,
43
WindowsProcessInterop
.FileShareRead,
45
WindowsProcessInterop
.OpenExisting,
59
if (!
WindowsProcessInterop
.SetHandleInformation(nulStdinHandle,
WindowsProcessInterop
.HandleFlagInherit,
WindowsProcessInterop
.HandleFlagInherit))
71
var stdio = new
WindowsProcessInterop
.StdioHandles(
84
var pi =
WindowsProcessInterop
.SpawnProcess(
122
WindowsProcessInterop
.CloseHandle(pi.hThread);
170
try {
WindowsProcessInterop
.TerminateProcess(pi.hProcess, 1); } catch { }
171
try {
WindowsProcessInterop
.CloseHandle(pi.hThread); } catch { }
195
using var nulHandle =
WindowsProcessInterop
.CreateFileW(
197
WindowsProcessInterop
.GenericWrite,
198
WindowsProcessInterop
.FileShareWrite,
200
WindowsProcessInterop
.OpenExisting,
209
if (!
WindowsProcessInterop
.SetHandleInformation(nulHandle,
WindowsProcessInterop
.HandleFlagInherit,
WindowsProcessInterop
.HandleFlagInherit))
215
var stdio = new
WindowsProcessInterop
.StdioHandles(
220
var pi =
WindowsProcessInterop
.SpawnProcess(
233
WindowsProcessInterop
.CloseHandle(pi.hThread);
255
try {
WindowsProcessInterop
.TerminateProcess(pi.hProcess, 1); } catch { }
258
try {
WindowsProcessInterop
.CloseHandle(pi.hThread); } catch { }
270
var waitResult =
WindowsProcessInterop
.WaitForSingleObject(processHandle, 0);
273
WindowsProcessInterop
.WaitObject0 => true,
274
WindowsProcessInterop
.WaitTimeout => false,
275
WindowsProcessInterop
.WaitFailed => throw new Win32Exception(Marshal.GetLastWin32Error(), "WaitForSingleObject failed while reading IsolatedProcess.HasExited"),
286
var waitResult =
WindowsProcessInterop
.WaitForSingleObject(processHandle, 0);
287
if (waitResult ==
WindowsProcessInterop
.WaitTimeout)
291
if (waitResult ==
WindowsProcessInterop
.WaitFailed)
296
if (!
WindowsProcessInterop
.GetExitCodeProcess(processHandle, out var exitCode))
308
return
WindowsProcessInterop
.WaitForExitAsync(processHandle, cancellationToken);
Processes\WindowsConsoleProcessJob.cs (8)
66
_jobHandle =
WindowsProcessInterop
.CreateJobObjectW(nint.Zero, null);
76
var info = new
WindowsProcessInterop
.JOBOBJECT_EXTENDED_LIMIT_INFORMATION
80
LimitFlags =
WindowsProcessInterop
.JobObjectLimitKillOnJobClose
81
|
WindowsProcessInterop
.JobObjectLimitBreakawayOk,
85
var infoSize = Marshal.SizeOf<
WindowsProcessInterop
.JOBOBJECT_EXTENDED_LIMIT_INFORMATION>();
91
if (!
WindowsProcessInterop
.SetInformationJobObject(
93
WindowsProcessInterop
.JobObjectInfoClass.ExtendedLimitInformation,
116
/// The job handle. Pass directly to <see cref="
WindowsProcessInterop
.SpawnProcess"/> so the spawn
Program.cs (1)
1008
WindowsProcessInterop
.SetConsoleCtrlHandler(nint.Zero, false);
Aspire.Cli.Tests (28)
Processes\WindowsConsoleProcessJobTests.cs (28)
74
using var nulHandle =
WindowsProcessInterop
.CreateFileW(
76
WindowsProcessInterop
.GenericRead |
WindowsProcessInterop
.GenericWrite,
77
WindowsProcessInterop
.FileShareRead |
WindowsProcessInterop
.FileShareWrite,
79
WindowsProcessInterop
.OpenExisting,
84
Assert.True(
WindowsProcessInterop
.SetHandleInformation(
86
WindowsProcessInterop
.HandleFlagInherit,
87
WindowsProcessInterop
.HandleFlagInherit));
90
var stdio = new
WindowsProcessInterop
.StdioHandles(
95
var pi =
WindowsProcessInterop
.SpawnProcess(
109
Assert.True(
WindowsProcessInterop
.IsProcessInJob(pi.hProcess, job.Handle, out var isInJob));
114
WindowsProcessInterop
.TerminateProcess(pi.hProcess, 1);
115
WindowsProcessInterop
.CloseHandle(pi.hProcess);
116
WindowsProcessInterop
.CloseHandle(pi.hThread);
123
using var nulHandle =
WindowsProcessInterop
.CreateFileW(
125
WindowsProcessInterop
.GenericRead |
WindowsProcessInterop
.GenericWrite,
126
WindowsProcessInterop
.FileShareRead |
WindowsProcessInterop
.FileShareWrite,
128
WindowsProcessInterop
.OpenExisting,
133
Assert.True(
WindowsProcessInterop
.SetHandleInformation(
135
WindowsProcessInterop
.HandleFlagInherit,
136
WindowsProcessInterop
.HandleFlagInherit));
139
var stdio = new
WindowsProcessInterop
.StdioHandles(
144
var pi =
WindowsProcessInterop
.SpawnProcess(
159
WindowsProcessInterop
.CloseHandle(pi.hProcess);
160
WindowsProcessInterop
.CloseHandle(pi.hThread);