1999-05-15 10:48:19 +00:00
|
|
|
/*
|
|
|
|
* Wine server processes
|
|
|
|
*
|
|
|
|
* Copyright (C) 1999 Alexandre Julliard
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_SERVER_PROCESS_H
|
|
|
|
#define __WINE_SERVER_PROCESS_H
|
|
|
|
|
|
|
|
#ifndef __WINE_SERVER__
|
|
|
|
#error This file can only be used in the Wine server
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "object.h"
|
|
|
|
|
|
|
|
/* process structures */
|
|
|
|
|
1999-05-16 16:54:54 +00:00
|
|
|
struct process
|
|
|
|
{
|
|
|
|
struct object obj; /* object header */
|
|
|
|
struct process *next; /* system-wide process list */
|
|
|
|
struct process *prev;
|
|
|
|
struct thread *thread_list; /* head of the thread list */
|
|
|
|
struct thread *debugger; /* thread debugging this process */
|
2000-02-18 21:54:32 +00:00
|
|
|
struct file *exe_file; /* main exe file */
|
1999-06-04 19:49:54 +00:00
|
|
|
struct object *handles; /* handle entries */
|
1999-05-16 16:54:54 +00:00
|
|
|
int exit_code; /* process exit code */
|
|
|
|
int running_threads; /* number of threads running in this process */
|
|
|
|
struct timeval start_time; /* absolute time at process start */
|
|
|
|
struct timeval end_time; /* absolute time at process end */
|
|
|
|
int priority; /* priority class */
|
|
|
|
int affinity; /* process affinity mask */
|
|
|
|
int suspend; /* global process suspend count */
|
1999-11-29 02:10:56 +00:00
|
|
|
int create_flags; /* process creation flags */
|
1999-05-16 16:54:54 +00:00
|
|
|
struct object *console_in; /* console input */
|
|
|
|
struct object *console_out; /* console output */
|
1999-11-12 03:35:25 +00:00
|
|
|
struct event *init_event; /* event for init done */
|
2000-01-27 02:54:17 +00:00
|
|
|
void *ldt_copy; /* pointer to LDT copy in client addr space */
|
|
|
|
void *ldt_flags; /* pointer to LDT flags in client addr space */
|
1999-05-16 16:54:54 +00:00
|
|
|
struct new_process_request *info; /* startup info (freed after startup) */
|
|
|
|
};
|
1999-05-15 10:48:19 +00:00
|
|
|
|
|
|
|
struct process_snapshot
|
|
|
|
{
|
|
|
|
struct process *process; /* process ptr */
|
|
|
|
struct process *parent; /* process parent */
|
|
|
|
int threads; /* number of threads */
|
|
|
|
int priority; /* priority class */
|
|
|
|
};
|
|
|
|
|
|
|
|
/* process functions */
|
|
|
|
|
2000-01-25 01:40:27 +00:00
|
|
|
extern struct thread *create_process( int fd, struct process *parent,
|
|
|
|
struct new_process_request *req,
|
|
|
|
const char *cmd_line, size_t len );
|
1999-05-15 10:48:19 +00:00
|
|
|
extern struct process *get_process_from_id( void *id );
|
|
|
|
extern struct process *get_process_from_handle( int handle, unsigned int access );
|
1999-05-16 16:54:54 +00:00
|
|
|
extern int process_set_debugger( struct process *process, struct thread *thread );
|
1999-05-15 10:48:19 +00:00
|
|
|
extern void add_process_thread( struct process *process,
|
|
|
|
struct thread *thread );
|
|
|
|
extern void remove_process_thread( struct process *process,
|
|
|
|
struct thread *thread );
|
1999-05-16 16:54:54 +00:00
|
|
|
extern void suspend_process( struct process *process );
|
|
|
|
extern void resume_process( struct process *process );
|
|
|
|
extern void kill_process( struct process *process, int exit_code );
|
1999-11-24 01:22:14 +00:00
|
|
|
extern void kill_debugged_processes( struct thread *debugger, int exit_code );
|
1999-05-15 10:48:19 +00:00
|
|
|
extern struct process_snapshot *process_snap( int *count );
|
|
|
|
|
|
|
|
#endif /* __WINE_SERVER_PROCESS_H */
|