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