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