if (process->signalled && process->handle) {
/* This process has exited and we need to remove the artifical ref
* on the handle */
- mono_w32handle_unref (process->handle);
+ mono_w32handle_close (process->handle);
process->handle = NULL;
}
}
process_set_name (&process_handle);
current_process = mono_w32handle_new (MONO_W32HANDLE_PROCESS, &process_handle);
- g_assert (current_process);
+ g_assert (current_process != INVALID_HANDLE_VALUE);
mono_os_mutex_init (&processes_mutex);
}
if (mono_w32handle_issignalled (handle))
return FALSE;
- mono_w32handle_ref (handle);
- foreach_data->handle = handle;
+ foreach_data->handle = mono_w32handle_duplicate (handle);
return TRUE;
}
/* Keep the process handle artificially alive until the process
* exits so that the information in the handle isn't lost. */
- mono_w32handle_ref (handle);
- process->handle = handle;
+ process->handle = mono_w32handle_duplicate (handle);
mono_os_mutex_lock (&processes_mutex);
process->next = processes;