网站首页  词典首页

请输入您要查询的函数:

 

术语 exitprocess
释义 ExitProcess
语法:
C++
VOID WINAPI ExitProcess(
__in UINT uExitCode
);
ExitProcess函数
完调用进程及其所有线程。
参数
uExitCode [in]
该进程的所有线程退出代码。
返回值
这个函数没有返回值。
备注
使用GetExitCodeProcess函数来检索进程的退出值。使用GetExitCodeThread函数检索线程的退出值。
退出进程的原因如下:
所有在此过程中,除了线程调用线程,终止没有收到DLL_THREAD_DETACH通知其执行。
对在第1步终止所有线程的状态变成信号。
该项目的所有加载的动态链接库(DLL)点函数调用DLL_PROCESS_DETACH的。
毕竟附加DLL具有执行的任何进程的终止代码,ExitProcess函数终止当前进程,包括调用线程。
在调用线程的状态变为信号。
对象的所有句柄的进程中打开关闭。
从STILL_ACTIVE变化的过程中对这一进程的退出值终止状态。
该进程的对象的状态变为信号,满足任何线程已经等待的过程终止。
如果在这一过程中终止一个线程持有锁和DLL分离在加载的DLL试图获取同一个锁一个代码,然后调用处于僵局PRB:ExitProcess期间的结果。相反,如果一个进程通过调用TerminateProcess终止时,该进程的DLL连接到不属于进程的终止通知。因此,如果您不知道您的进程中的所有线程的状态,最好是比PRB:ExitProcess期间调用TerminateProcess。注意,返回从在给PRB:ExitProcess期间调用的应用成果的主要功能。
在DLL调用PRB:ExitProcess期间可能导致意外的应用程序或系统错误。一定要调用从DLL只有PRB:ExitProcess期间,如果您知道哪些应用程序或系统组件会加载DLL,它是安全的在这方面呼吁PRB:ExitProcess期间。
退出进程不会导致子进程终止。
退出进程并不一定删除操作系统的进程对象。一个进程对象被删除时,最后该进程的句柄关闭。
实例
有关示例,请参阅创建与重定向输入和输出子进程。
要求:
最低支持:client-Windows 2000专业版
最低支持server-Windows 2000服务器
HeaderWinbase.h(头文件:winuser.h)
LibraryKernel32.lib
DLLKernel32.dll
参见
CreateProcess的
CreateRemoteThread的
CreateThread
ExitThread
GetExitCodeProcess
GetExitCodeThread
OpenProcess
进程和线程函数
过程
TerminateProcess
终止一个进程
如果有任何问题和意见,请发送给微软(wsddocfb@microsoft.com)
生成日期:2009年8月27日
==英文原文==ExitProcess Function
Ends the calling process and all its threads.
Syntax
C++
VOID WINAPI ExitProcess(
__in UINT uExitCode
);
Parameters
uExitCode [in]
The exit code for the process and all threads.
Return Value
This function does not return a value.
Remarks
Use the GetExitCodeProcess function to retrieve the process's exit value. Use the GetExitCodeThread function to retrieve a thread's exit value.
Exiting a process causes the following:
All of the threads in the process, except the calling thread, terminate their execution without receiving a DLL_THREAD_DETACH notification.
The states of all of the threads terminated in step 1 become signaled.
The entry-point functions of all loaded dynamic-link libraries (DLLs) are called with DLL_PROCESS_DETACH.
After all attached DLLs have executed any process termination code, the ExitProcess function terminates the current process, including the calling thread.
The state of the calling thread becomes signaled.
All of the object handles opened by the process are closed.
The termination status of the process changes from STILL_ACTIVE to the exit value of the process.
The state of the process object becomes signaled, satisfying any threads that had been waiting for the process to terminate.
If one of the terminated threads in the process holds a lock and the DLL detach code in one of the loaded DLLs attempts to acquire the same lock, then calling ExitProcess results in a deadlock. In contrast, if a process terminates by calling TerminateProcess , the DLLs that the process is attached to are not notified of the process termination. Therefore, if you do not know the state of all threads in your process, it is better to call TerminateProcess than ExitProcess. Note that returning from the main function of an application results in a call to ExitProcess.
Calling ExitProcess in a DLL can lead to unexpected application or system errors. Be sure to call ExitProcess from a DLL only if you know which applications or system components will load the DLL and that it is safe to call ExitProcess in this context.
Exiting a process does not cause child processes to be terminated.
Exiting a process does not necessarily remove the process object from the operating system. A process object is deleted when the last handle to the process is closed.
Examples
For an example, see Creating a Child Process with Redirected Input and Output .
Requirements
Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWinbase.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll
See Also
CreateProcess
CreateRemoteThread
CreateThread
ExitThread
GetExitCodeProcess
GetExitCodeThread
OpenProcess
Process and Thread Functions
Processes
TerminateProcess
Terminating a Process
Send comments about this topic to Microsoft
Build date: 8/27/2009
==原始网址==http://msdn.microsoft.com/en-us/library/ms682658(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:22:22