-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add documentation for Process.Kill(bool entireProcessTree) #2828
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ab45e8f
Add documentation for Process.Kill(bool entireProcessTree)
wtgodbe d063abf
Update Process.xml
mairaw f4e7421
minor fix: parm summary in single line
carlossanlop 9b8e826
Address feedback
wtgodbe 61b1a6d
Address Feedback
wtgodbe 0a2e347
Fixed bad xml element
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2150,9 +2150,51 @@ There are problems accessing the performance counter API's used to get process i | |
<Parameter Name="entireProcessTree" Type="System.Boolean" Index="0" FrameworkAlternate="netcore-3.0" /> | ||
</Parameters> | ||
<Docs> | ||
<param name="entireProcessTree">To be added.</param> | ||
<summary>To be added.</summary> | ||
<remarks>To be added.</remarks> | ||
<param name="entireProcessTree"> | ||
<see langword="true" /> to kill the associated process and its descendants; <see langword="false" /> to kill only associated process.</param> | ||
<summary>Immediately stops the associated process, and (optionally) all of its child/descendent processes.</summary> | ||
<remarks> | ||
<format type="text/markdown"><![CDATA[ | ||
|
||
## Remarks | ||
<xref:System.Diagnostics.Process.Kill%2A> forces a termination of the process, while <xref:System.Diagnostics.Process.CloseMainWindow%2A> only requests a termination. When a process with a graphical interface is executing, its message loop is in a wait state. The message loop executes every time a Windows message is sent to the process by the operating system. Calling <xref:System.Diagnostics.Process.CloseMainWindow%2A> sends a request to close to the main window, which, in a well-formed application, closes child windows and revokes all running message loops for the application. The request to exit the process by calling <xref:System.Diagnostics.Process.CloseMainWindow%2A> does not force the application to quit. The application can ask for user verification before quitting, or it can refuse to quit. To force the application to quit, use the <xref:System.Diagnostics.Process.Kill%2A> method. The behavior of <xref:System.Diagnostics.Process.CloseMainWindow%2A> is identical to that of a user closing an application's main window using the system menu. Therefore, the request to exit the process by closing the main window does not force the application to quit immediately. | ||
|
||
> [!NOTE] | ||
> The <xref:System.Diagnostics.Process.Kill%2A> method executes asynchronously. After calling the <xref:System.Diagnostics.Process.Kill%2A> method, call the <xref:System.Diagnostics.Process.WaitForExit%2A> method to wait for the process to exit, or check the <xref:System.Diagnostics.Process.HasExited%2A> property to determine if the process has exited. | ||
|
||
Data edited by the process or resources allocated to the process can be lost if you call <xref:System.Diagnostics.Process.Kill%2A>. <xref:System.Diagnostics.Process.Kill%2A> causes an abnormal process termination and should be used only when necessary. <xref:System.Diagnostics.Process.CloseMainWindow%2A> enables an orderly termination of the process and closes all windows, so it is preferable for applications with an interface. If <xref:System.Diagnostics.Process.CloseMainWindow%2A> fails, you can use <xref:System.Diagnostics.Process.Kill%2A> to terminate the process. <xref:System.Diagnostics.Process.Kill%2A> is the only way to terminate processes that do not have graphical interfaces. | ||
|
||
You can call <xref:System.Diagnostics.Process.Kill%2A> and <xref:System.Diagnostics.Process.CloseMainWindow%2A> only for processes that are running on the local computer. You cannot cause processes on remote computers to exit. You can only view information for processes running on remote computers. | ||
|
||
> [!NOTE] | ||
> If the call to the <xref:System.Diagnostics.Process.Kill%2A> method is made while the process is currently terminating, a <xref:System.ComponentModel.Win32Exception> is thrown for Access Denied. | ||
|
||
]]></format> | ||
</remarks> | ||
<exception cref="T:System.ComponentModel.Win32Exception">The associated process could not be terminated. | ||
|
||
-or- | ||
|
||
The process is terminating. | ||
|
||
-or- | ||
|
||
The associated process is a Win16 executable.</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. Aren't this and line 2136 legacy conditions -- perhaps they should be deleted? (Are there still Win16 executables running on .NET Framework?) |
||
<exception cref="T:System.NotSupportedException">You are attempting to call <see cref="M: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="T:System.InvalidOperationException">The process has already exited. | ||
|
||
-or- | ||
|
||
There is no process associated with this <see cref="T:System.Diagnostics.Process" /> object. | ||
|
||
-or- | ||
|
||
The calling process is a member of the associated process' descendant tree.</exception> | ||
<exception cref="T:System.AggregateException">Not all processes in the associated process' descendant tree could be terminated.</exception> | ||
<permission cref="F:System.Security.Permissions.SecurityAction.LinkDemand">for full trust for the immediate caller. This member cannot be used by partially trusted code.</permission> | ||
<altmember cref="M:System.Environment.Exit(System.Int32)" /> | ||
<altmember cref="M:System.Diagnostics.Process.CloseMainWindow" /> | ||
<altmember cref="M:System.Diagnostics.Process.Start" /> | ||
</Docs> | ||
</Member> | ||
<Member MemberName="LeaveDebugMode"> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.