Implemented thread and (partial) module snapshots, based on the work of Andreas Mohr <amohr@student.ei.uni-stuttgart.de>.
diff --git a/server/process.c b/server/process.c index 3cc87f6..c84672d 100644 --- a/server/process.c +++ b/server/process.c
@@ -563,6 +563,7 @@ if (!process->running_threads) continue; ptr->process = process; ptr->threads = process->running_threads; + ptr->count = process->obj.refcount; ptr->priority = process->priority; grab_object( process ); ptr++; @@ -571,6 +572,25 @@ return snapshot; } +/* take a snapshot of the modules of a process */ +struct module_snapshot *module_snap( struct process *process, int *count ) +{ + struct module_snapshot *snapshot, *ptr; + struct process_dll *dll; + int total = 0; + + for (dll = &process->exe; dll; dll = dll->next) total++; + if (!(snapshot = mem_alloc( sizeof(*snapshot) * total ))) return NULL; + + for (ptr = snapshot, dll = &process->exe; dll; dll = dll->next, ptr++) + { + ptr->base = dll->base; + } + *count = total; + return snapshot; +} + + /* create a new process */ DECL_HANDLER(new_process) {