2 #include "w32process.h"
3 #include "w32process-unix-internals.h"
5 #ifdef USE_HAIKU_BACKEND
7 /* KernelKit.h doesn't include the right headers? */
8 #include <os/kernel/image.h>
11 mono_w32process_get_name (pid_t pid)
16 if (get_next_image_info ((team_id) pid, &cookie, &imageInfo) != B_OK)
19 return g_strdup (imageInfo.name);
23 mono_w32process_get_path (pid_t pid)
25 return mono_w32process_get_name (pid);
29 mono_w32process_get_modules (pid_t pid)
32 MonoW32ProcessModule *mod;
36 while (get_next_image_info (B_CURRENT_TEAM, &cookie, &imageInfo) == B_OK) {
37 mod = g_new0 (MonoW32ProcessModule, 1);
38 mod->device = imageInfo.device;
39 mod->inode = imageInfo.node;
40 mod->filename = g_strdup (imageInfo.name);
41 mod->address_start = MIN (imageInfo.text, imageInfo.data);
42 mod->address_end = MAX ((uint8_t*)imageInfo.text + imageInfo.text_size,
43 (uint8_t*)imageInfo.data + imageInfo.data_size);
44 mod->perms = g_strdup ("r--p");
45 mod->address_offset = 0;
47 if (g_slist_find_custom (ret, mod, mono_w32process_module_equals) == NULL) {
48 ret = g_slist_prepend (ret, mod);
50 mono_w32process_module_free (mod);
54 return g_slist_reverse (ret);