server: Add hooks to support process tracing mechanisms other than ptrace.
diff --git a/server/process.c b/server/process.c
index 217710a..001afcb 100644
--- a/server/process.c
+++ b/server/process.c
@@ -284,6 +284,7 @@
process->winstation = 0;
process->desktop = 0;
process->token = token_create_admin();
+ process->trace_data = 0;
list_init( &process->thread_list );
list_init( &process->locks );
list_init( &process->classes );
@@ -343,6 +344,7 @@
struct process *process = thread->process;
struct startup_info *info = process->startup_info;
+ init_process_tracing( process );
if (!info) return 0;
return info->data_size;
}
@@ -599,6 +601,7 @@
destroy_process_classes( process );
remove_process_locks( process );
set_process_startup_state( process, STARTUP_ABORTED );
+ finish_process_tracing( process );
start_sigkill_timer( process );
wake_up( &process->obj, 0 );
}
diff --git a/server/process.h b/server/process.h
index af84719..6d5d676 100644
--- a/server/process.h
+++ b/server/process.h
@@ -80,6 +80,7 @@
struct list dlls; /* list of loaded dlls */
void *peb; /* PEB address in client address space */
void *ldt_copy; /* pointer to LDT copy in client addr space */
+ unsigned int trace_data; /* opaque data used by the process tracing mechanism */
};
struct process_snapshot
@@ -128,6 +129,10 @@
extern struct process_snapshot *process_snap( int *count );
extern struct module_snapshot *module_snap( struct process *process, int *count );
extern void enum_processes( int (*cb)(struct process*, void*), void *user);
+
+extern void init_tracing_mechanism(void);
+extern void init_process_tracing( struct process *process );
+extern void finish_process_tracing( struct process *process );
extern int read_process_memory( struct process *process, const void *ptr, data_size_t size, char *dest );
extern int write_process_memory( struct process *process, void *ptr, data_size_t size, const char *src );
diff --git a/server/ptrace.c b/server/ptrace.c
index c7aa088..7b0bfa0 100644
--- a/server/ptrace.c
+++ b/server/ptrace.c
@@ -223,6 +223,23 @@
return -1;
}
+/* initialize the process tracing mechanism */
+void init_tracing_mechanism(void)
+{
+ /* no initialization needed for ptrace */
+}
+
+/* initialize the per-process tracing mechanism */
+void init_process_tracing( struct process *process )
+{
+ /* ptrace setup is done on-demand */
+}
+
+/* terminate the per-process tracing mechanism */
+void finish_process_tracing( struct process *process )
+{
+}
+
/* send a Unix signal to a specific thread */
int send_thread_signal( struct thread *thread, int sig )
{
diff --git a/server/request.c b/server/request.c
index 07cc5fb..c01a70e 100644
--- a/server/request.c
+++ b/server/request.c
@@ -800,6 +800,9 @@
/* init startup time */
gettimeofday( &server_start_time, NULL );
+
+ /* init the process tracing mechanism */
+ init_tracing_mechanism();
}
/* master socket timer expiration handler */