На главную

On-line справка по Win32 API

Написать письмо
БЕСПЛАТНАЯ ежедневная online лотерея! Выигрывай каждый день БЕСПЛАТНО!
Список всех статей A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-V-W-X-Y-Z | Скачать Вниз

ExitProcess



The ExitProcess function ends a process and all its threads.

VOID ExitProcess(

UINT uExitCode // exit code for all threads
);


Parameters

uExitCode

Specifies the exit code for the process, and for all threads that are terminated as a result of this call. Use the GetExitCodeProcess function to retrieve the process's exit value. Use the GetExitCodeThread function to retrieve a thread's exit value.



Return Values

This function does not return a value.

Remarks

ExitProcess is the preferred method of ending a process. This function provides a clean process shutdown. This includes calling the entry-point function of all attached dynamic-link libraries (DLLs) with a value indicating that the process is detaching from the DLL. If a process terminates by calling TerminateProcess, the DLLs that the process is attached to are not notified of the process termination.
After all attached DLLs have executed any process termination value, this function terminates the current process.

Terminating a process causes the following:

1. All of the object handles opened by the process are closed.
2. All of the threads in the process terminate their execution.
3. The state of the process object becomes signaled, satisfying any threads that had been waiting for the process to terminate.
4. The states of all threads of the process become signaled, satisfying any threads that had been waiting for the threads to terminate.
5. The termination status of the process changes from STILL_ACTIVE to the exit value of the process.



Terminating a process does not cause child processes to be terminated.
Terminating 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.
The ExitProcess, ExitThread, CreateThread, CreateRemoteThread functions, and a process that is starting (as the result of a call by CreateProcess) are serialized between each other within a process. Only one of these events can happen in an address space at a time. This means the following restrictions hold:

· During process startup and DLL initialization routines, new threads can be created, but they do not begin execution until DLL initialization is done for the process.
· Only one thread in a process can be in a DLL initialization or detach routine at a time.
· ExitProcess does not return until no threads are in their DLL initialization or detach routines.



See Also

CreateProcess, CreateRemoteThread, CreateThread, ExitThread, GetExitCodeProcess, GetExitCodeThread, OpenProcess, TerminateProcess


Пригласи друзей и счет твоего мобильника всегда будет положительным!
Предыдущая статья
 
Сайт Народ.Ру Интернет
Следующая статья
Пригласи друзей и счет твоего мобильника всегда будет положительным!

ExitProcess



Функция ExitProcess заканчивает процесс и всю резьбу.

ПУСТОТА ExitProcess(

ВЫХОДНОЙ код UINT uExitCode // для всей резьбы
);


Параметры

uExitCode

Определяет выходной код для процесса, и для всей резьбы, которая расторгнутая в результате этого вызова. Используйте функцию GetExitCodeProcess, чтобы извлекать выходную величину процесса. Используйте функцию GetExitCodeThread, чтобы извлекать выходную величину резьбы.



Обратные Величины

Эта функция не возвращает величину.

Замечания

ExitProcess - предпочтительный метод окончания процесса. Эта функция обеспечивает чистое выключение процесса. Это включает вызывая вход-точку функции всех прилагал динамическая связь библиотек (DLLs) с величиной, указывающей, что процесс отделяется из DLL. Если процесс завершает вызывая TerminateProcess, DLLs, что процесс приложен, чтобы не извещенн о завершении процесса.
В конце концов приложившее DLLs выполнил любую величину завершения процесса, эта функция завершает текущий процесс.

Завершение процесса вызывает следующее:

1. Все объектные ручки открытые процессом закрыты.
2. Вся резьба в процессе завершает их выполнение.
3. Состояние объекта процесса становится сигнальным, удовлетворяя любую резьбу, которая ждала процесс, чтобы завершаться.
4. Состояния всей резьбы процесса становятся сигнализированными, удовлетворяя любую резьбу, которая ждала резьбу, чтобы завершаться.
5. Статус завершения процесса заменяет с STILL_ACTIVE в выходную величину процесса.



Завершение процесса не заставляет процессы, чтобы быть расторгнутым.
Завершение процесса обязательно не удаляет объект процесса из операционной системы. Объект процесса удален когда последняя ручка в процесс закрыта.
ExitProcess, ExitThread, CreateThread, Функции CreateRemoteThread, и процесс, которые начинают (как результат вызова CreateProcess), изданы сериями между друг друга в пределах процесса. Только одно из этих событий могут случиться в пространстве адреса за один раз. Это означает следующее хранилище ограничений:

В течение запуска процесса и программ инициализации DLL, новая резьба может быть создана, но они не начинают выполнение пока инициализация DLL не сделана для процесса.
Только один резьба в процессе может быть в инициализации DLL или отделять программу за один раз.
ExitProcess НЕ возвращается пока никакая резьба не будет в их инициализации DLL или отделяет программы.



Смотри Также

CreateProcess, CreateRemoteThread, CreateThread, ExitThread, GetExitCodeProcess, GetExitCodeThread, OpenProcess, TerminateProcess


Вверх Version 1.3, Oct 26 2010 © 2007, 2010, mrhx Вверх
 mrhx software  Русский перевод OpenGL  Русский перевод Win32 API
 
Используются технологии uCoz