-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backport docs for System.Diagnostics.Process #48137
Changes from all commits
f5e24f1
55790fb
620b60f
d1d6592
6442f70
88883f3
fa2f02d
04b5424
7c72d9a
9c52b86
d19278e
2a2b0ab
1d00164
b30915c
8ca94a1
300d1be
1f0243e
47e304c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,9 @@ internal SafeProcessHandle(int processId, SafeWaitHandle handle) : | |
|
||
internal int ProcessId { get; } | ||
|
||
/// <summary>Closes the handle.</summary> | ||
/// <returns>On Windows, returns <see langword="true" /> if the handle is closed successfully; <see langword="false" /> otherwise. On Unix, always returns <see langword="true" /></returns> | ||
/// <remarks>On Windows, to get extended error information, call <see cref="System.Runtime.InteropServices.Marshal.GetLastWin32Error()" />.</remarks> | ||
Comment on lines
+40
to
+42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added this manually (and copied it to the Unix file). There were no docs for this API in MS Docs: https://github.com/dotnet/dotnet-api-docs/blob/dc599c5db9e3464765b4e8c319bc22e525f4eebf/xml/Microsoft.Win32.SafeHandles/SafeProcessHandle.xml#L170-L172 |
||
protected override bool ReleaseHandle() | ||
{ | ||
if (_releaseRef) | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,8 +16,12 @@ | |||||
|
||||||
namespace Microsoft.Win32.SafeHandles | ||||||
{ | ||||||
/// <summary>Provides a managed wrapper for a process handle.</summary> | ||||||
public sealed partial class SafeProcessHandle : SafeHandleZeroOrMinusOneIsInvalid | ||||||
{ | ||||||
/// <summary>Closes the handle.</summary> | ||||||
/// <returns>On Windows, returns <see langword="true" /> if the handle is closed successfully; <see langword="false" /> otherwise. On Unix, always returns <see langword="true" /></returns> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
/// <remarks>On Windows, to get extended error information, call <see cref="System.Runtime.InteropServices.Marshal.GetLastWin32Error()" />.</remarks> | ||||||
protected override bool ReleaseHandle() | ||||||
{ | ||||||
return Interop.Kernel32.CloseHandle(handle); | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -6,8 +6,34 @@ | |||||
|
||||||
namespace System.Diagnostics | ||||||
{ | ||||||
/// <summary>Provides access to local and remote processes and enables you to start and stop local system processes.</summary> | ||||||
/// <remarks><format type="text/markdown"><![CDATA[ | ||||||
carlossanlop marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
/// [!INCLUDE[remarks](~/includes/remarks/System.Diagnostics/Process/Process.md)] | ||||||
/// ]]></format></remarks> | ||||||
/// <altmember cref="O:System.Diagnostics.Process.Start"/> | ||||||
/// <altmember cref="System.Diagnostics.ProcessStartInfo"/> | ||||||
/// <altmember cref="System.Diagnostics.Process.CloseMainWindow"/> | ||||||
/// <altmember cref="O:System.Diagnostics.Process.Kill"/> | ||||||
/// <altmember cref="System.Diagnostics.ProcessThread"/> | ||||||
/// <related type="ExternalDocumentation" href="https://code.msdn.microsoft.com/windowsdesktop/Using-the-NET-Process-Class-d70597ef">Using the .NET Process Class</related> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bad link. |
||||||
public partial class Process : IDisposable | ||||||
{ | ||||||
/// <summary>Immediately stops the associated process, and optionally its child/descendent processes.</summary> | ||||||
/// <param name="entireProcessTree"><see langword="true" /> to kill the associated process and its descendants; <see langword="false" /> to kill only the associated process.</param> | ||||||
/// <remarks>When <paramref name="entireProcessTree" /> is set to <see langword="true" />, processes where the call lacks permissions to view details are silently skipped by the descendant termination process because the termination process is unable to determine whether those processes are descendants.</remarks> | ||||||
/// <exception cref="System.ComponentModel.Win32Exception">The associated process could not be terminated. | ||||||
/// -or- | ||||||
/// The process is terminating.</exception> | ||||||
/// <exception cref="System.NotSupportedException">You are attempting to call <see cref="O:System.Diagnostics.Process.Kill" /> for a process that is running on a remote computer. The method is available only for processes running on the local computer.</exception> | ||||||
/// <exception cref="System.InvalidOperationException">The process has already exited. | ||||||
/// -or- | ||||||
/// There is no process associated with this <see cref="System.Diagnostics.Process" /> object. | ||||||
/// -or- | ||||||
/// The calling process is a member of the associated process' descendant tree.</exception> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
/// <exception cref="System.AggregateException">Not all processes in the associated process' descendant tree could be terminated.</exception> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
/// <altmember cref="System.Environment.Exit(int)"/> | ||||||
/// <altmember cref="System.Diagnostics.Process.CloseMainWindow"/> | ||||||
/// <altmember cref="O:System.Diagnostics.Process.Start"/> | ||||||
public void Kill(bool entireProcessTree) | ||||||
{ | ||||||
if (!entireProcessTree) | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.