NtTerminateProcess (ntdll)
Last changed: -82.230.237.214

.
Summary

C# Signature:

[DllImport("ntdll.dll", SetLastError=true)]

static extern uint NtTerminateProcess(IntPtr hProcess, int errorStatus);

VB Signature:

  <DllImport("ntdll.dll")>
    Public Shared Function NtTerminateProcess(ByVal hfandle As IntPtr, ByVal ErrorStatus As Integer) As UInteger
    End Function

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

If not specified, caller process is killed.

Tips & Tricks:

Please add some!

Sample Code:

Process process = Process.GetProcessesByName("notepad").First();

IntPtr processHandle = process.Handle;

NtTerminateProcess(processHandle, 0);

Documentation