1999-05-15 12:48:19 +02:00
|
|
|
/*
|
|
|
|
* Wine server processes
|
|
|
|
*
|
|
|
|
* Copyright (C) 1999 Alexandre Julliard
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
1999-05-15 12:48:19 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __WINE_SERVER_PROCESS_H
|
|
|
|
#define __WINE_SERVER_PROCESS_H
|
|
|
|
|
|
|
|
#include "object.h"
|
|
|
|
|
2000-05-30 21:48:18 +02:00
|
|
|
struct msg_queue;
|
2000-05-30 22:32:06 +02:00
|
|
|
struct atom_table;
|
2000-05-30 21:48:18 +02:00
|
|
|
|
1999-05-15 12:48:19 +02:00
|
|
|
/* process structures */
|
|
|
|
|
2000-03-09 19:18:41 +01:00
|
|
|
struct process_dll
|
|
|
|
{
|
|
|
|
struct process_dll *next; /* per-process dll list */
|
|
|
|
struct process_dll *prev;
|
|
|
|
struct file *file; /* dll file */
|
|
|
|
void *base; /* dll base address (in process addr space) */
|
|
|
|
void *name; /* ptr to ptr to name (in process addr space) */
|
|
|
|
int dbg_offset; /* debug info offset */
|
|
|
|
int dbg_size; /* debug info size */
|
|
|
|
};
|
|
|
|
|
1999-05-16 18:54:54 +02:00
|
|
|
struct process
|
|
|
|
{
|
|
|
|
struct object obj; /* object header */
|
|
|
|
struct process *next; /* system-wide process list */
|
|
|
|
struct process *prev;
|
2001-11-24 00:04:58 +01:00
|
|
|
struct process *parent; /* parent process */
|
1999-05-16 18:54:54 +02:00
|
|
|
struct thread *thread_list; /* head of the thread list */
|
|
|
|
struct thread *debugger; /* thread debugging this process */
|
1999-06-04 21:49:54 +02:00
|
|
|
struct object *handles; /* handle entries */
|
1999-05-16 18:54:54 +02: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 03:10:56 +01:00
|
|
|
int create_flags; /* process creation flags */
|
2001-11-24 00:04:58 +01:00
|
|
|
struct console_input*console; /* console input */
|
1999-11-12 04:35:25 +01:00
|
|
|
struct event *init_event; /* event for init done */
|
2000-05-30 21:48:18 +02:00
|
|
|
struct event *idle_event; /* event for input idle */
|
|
|
|
struct msg_queue *queue; /* main message queue */
|
2000-05-30 22:32:06 +02:00
|
|
|
struct atom_table *atom_table; /* pointer to local atom table */
|
2000-03-09 19:18:41 +01:00
|
|
|
struct process_dll exe; /* main exe file */
|
2000-01-27 03:54:17 +01: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 18:54:54 +02:00
|
|
|
};
|
1999-05-15 12:48:19 +02:00
|
|
|
|
|
|
|
struct process_snapshot
|
|
|
|
{
|
|
|
|
struct process *process; /* process ptr */
|
2000-04-16 21:45:05 +02:00
|
|
|
int count; /* process refcount */
|
1999-05-15 12:48:19 +02:00
|
|
|
int threads; /* number of threads */
|
|
|
|
int priority; /* priority class */
|
|
|
|
};
|
|
|
|
|
2000-04-16 21:45:05 +02:00
|
|
|
struct module_snapshot
|
|
|
|
{
|
|
|
|
void *base; /* module base addr */
|
|
|
|
};
|
|
|
|
|
1999-05-15 12:48:19 +02:00
|
|
|
/* process functions */
|
|
|
|
|
2000-05-01 18:24:22 +02:00
|
|
|
extern struct thread *create_process( int fd );
|
1999-05-15 12:48:19 +02:00
|
|
|
extern struct process *get_process_from_id( void *id );
|
2001-01-05 05:08:07 +01:00
|
|
|
extern struct process *get_process_from_handle( handle_t handle, unsigned int access );
|
1999-05-16 18:54:54 +02:00
|
|
|
extern int process_set_debugger( struct process *process, struct thread *thread );
|
2002-02-27 02:28:30 +01:00
|
|
|
extern int debugger_detach( struct process* process, struct thread* debugger );
|
|
|
|
|
1999-05-15 12:48:19 +02: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 18:54:54 +02:00
|
|
|
extern void suspend_process( struct process *process );
|
|
|
|
extern void resume_process( struct process *process );
|
2001-02-28 22:45:23 +01:00
|
|
|
extern void kill_process( struct process *process, struct thread *skip, int exit_code );
|
2001-12-04 21:17:43 +01:00
|
|
|
extern void kill_console_processes( struct thread *renderer, int exit_code );
|
1999-11-24 02:22:14 +01:00
|
|
|
extern void kill_debugged_processes( struct thread *debugger, int exit_code );
|
2002-02-27 02:28:30 +01:00
|
|
|
extern void detach_debugged_processes( struct thread *debugger );
|
1999-05-15 12:48:19 +02:00
|
|
|
extern struct process_snapshot *process_snap( int *count );
|
2000-04-16 21:45:05 +02:00
|
|
|
extern struct module_snapshot *module_snap( struct process *process, int *count );
|
1999-05-15 12:48:19 +02:00
|
|
|
|
2000-03-08 13:01:30 +01:00
|
|
|
static inline void *get_process_id( struct process *process ) { return process; }
|
|
|
|
|
1999-05-15 12:48:19 +02:00
|
|
|
#endif /* __WINE_SERVER_PROCESS_H */
|