ExitProcess is the prefered method of exiting an application. This
API provides a clean application shutdown. This includes calling
all attached DLLs at their instance termination entrypoint. If an
application terminates by any other method:
- TerminateProcess
- TerminateThread of last thread in the process
- ExitThread of last thread in the process
The DLLs that the process is attached to will not be notified of the
process termination.
After notifying all DLLs of the process termination, this API
terminates the current process as if a call to
TerminateProcess(GetCurrentProcess()) were made.
Arguments:
uExitCode - Supplies the termination status for each thread
in the process.
Return Value:
None.
--*/
{
NTSTATUS Status;
BASE_API_MSG m;
PBASE_EXITPROCESS_MSG a = (PBASE_EXITPROCESS_MSG)&m.u.ExitProcess;
if ( BaseRunningInServerProcess ) {
ASSERT(!BaseRunningInServerProcess);
}
else {
RtlAcquirePebLock();
try {
Status = NtTerminateProcess(NULL,(NTSTATUS)uExitCode);
看说明:
ExitProcess is the prefered method of exiting an application. This
API provides a clean application shutdown. This includes calling
all attached DLLs at their instance termination entrypoint. If an
application terminates by any other method:
- TerminateProcess
- TerminateThread of last thread in the process
- ExitThread of last thread in the process
The DLLs that the process is attached to will not be notified of the
process termination.
After notifying all DLLs of the process termination, this API
terminates the current process as if a call to
TerminateProcess(GetCurrentProcess()) were made