Lines Matching defs:handle
33 #include "handle-inl.h"
72 * it's closed. Since this handle is made non-inheritable and we're not
111 /* Make sure this handle is functional. The Windows kernel has a bug that
113 * program, subsequent attempts to use the handle with fail with
114 * INVALID_PARAMETER (87). This is possibly because all uses of the handle
131 static void uv__process_init(uv_loop_t* loop, uv_process_t* handle) {
132 uv__handle_init(loop, (uv_handle_t*) handle, UV_PROCESS);
133 handle->exit_cb = NULL;
134 handle->pid = 0;
135 handle->exit_signal = 0;
136 handle->wait_handle = INVALID_HANDLE_VALUE;
137 handle->process_handle = INVALID_HANDLE_VALUE;
138 handle->exit_cb_pending = 0;
140 UV_REQ_INIT(&handle->exit_req, UV_PROCESS_EXIT);
141 handle->exit_req.data = handle;
774 if (var_size != (DWORD) (len - 1)) { /* TODO: handle race condition? */
838 void uv__process_proc_exit(uv_loop_t* loop, uv_process_t* handle) {
842 assert(handle->exit_cb_pending);
843 handle->exit_cb_pending = 0;
847 if (handle->flags & UV_HANDLE_CLOSING) {
848 uv__want_endgame(loop, (uv_handle_t*) handle);
853 if (handle->wait_handle != INVALID_HANDLE_VALUE) {
854 UnregisterWait(handle->wait_handle);
855 handle->wait_handle = INVALID_HANDLE_VALUE;
858 /* Set the handle to inactive: no callbacks will be made after the exit
860 uv__handle_stop(handle);
862 if (GetExitCodeProcess(handle->process_handle, &status)) {
870 if (handle->exit_cb) {
871 handle->exit_cb(handle, exit_code, handle->exit_signal);
876 void uv__process_close(uv_loop_t* loop, uv_process_t* handle) {
877 uv__handle_closing(handle);
879 if (handle->wait_handle != INVALID_HANDLE_VALUE) {
882 BOOL r = UnregisterWaitEx(handle->wait_handle, INVALID_HANDLE_VALUE);
888 handle->wait_handle = INVALID_HANDLE_VALUE;
891 if (!handle->exit_cb_pending) {
892 uv__want_endgame(loop, (uv_handle_t*)handle);
897 void uv__process_endgame(uv_loop_t* loop, uv_process_t* handle) {
898 assert(!handle->exit_cb_pending);
899 assert(handle->flags & UV_HANDLE_CLOSING);
900 assert(!(handle->flags & UV_HANDLE_CLOSED));
902 /* Clean-up the process handle. */
903 CloseHandle(handle->process_handle);
905 uv__handle_close(handle);
1149 /* Make the handle active. It will remain active until the exit callback is
1150 * made or the handle is closed, whichever happens first. */