~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/server/process.h

Version: ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /*
  2  * Wine server processes
  3  *
  4  * Copyright (C) 1999 Alexandre Julliard
  5  *
  6  * This library is free software; you can redistribute it and/or
  7  * modify it under the terms of the GNU Lesser General Public
  8  * License as published by the Free Software Foundation; either
  9  * version 2.1 of the License, or (at your option) any later version.
 10  *
 11  * This library is distributed in the hope that it will be useful,
 12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 14  * Lesser General Public License for more details.
 15  *
 16  * You should have received a copy of the GNU Lesser General Public
 17  * License along with this library; if not, write to the Free Software
 18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 19  */
 20 
 21 #ifndef __WINE_SERVER_PROCESS_H
 22 #define __WINE_SERVER_PROCESS_H
 23 
 24 #include "object.h"
 25 
 26 struct atom_table;
 27 struct handle_table;
 28 struct startup_info;
 29 
 30 /* process startup state */
 31 enum startup_state { STARTUP_IN_PROGRESS, STARTUP_DONE, STARTUP_ABORTED };
 32 
 33 /* process structures */
 34 
 35 struct process_dll
 36 {
 37     struct list          entry;           /* entry in per-process dll list */
 38     struct file         *file;            /* dll file */
 39     mod_handle_t         base;            /* dll base address (in process addr space) */
 40     client_ptr_t         name;            /* ptr to ptr to name (in process addr space) */
 41     data_size_t          size;            /* dll size */
 42     int                  dbg_offset;      /* debug info offset */
 43     int                  dbg_size;        /* debug info size */
 44     data_size_t          namelen;         /* length of dll file name */
 45     WCHAR               *filename;        /* dll file name */
 46 };
 47 
 48 struct process
 49 {
 50     struct object        obj;             /* object header */
 51     struct list          entry;           /* entry in system-wide process list */
 52     struct process      *parent;          /* parent process */
 53     struct list          thread_list;     /* thread list */
 54     struct thread       *debugger;        /* thread debugging this process */
 55     struct handle_table *handles;         /* handle entries */
 56     struct fd           *msg_fd;          /* fd for sendmsg/recvmsg */
 57     process_id_t         id;              /* id of the process */
 58     process_id_t         group_id;        /* group id of the process */
 59     struct timeout_user *sigkill_timeout; /* timeout for final SIGKILL */
 60     enum cpu_type        cpu;             /* client CPU type */
 61     int                  unix_pid;        /* Unix pid for final SIGKILL */
 62     int                  exit_code;       /* process exit code */
 63     int                  running_threads; /* number of threads running in this process */
 64     timeout_t            start_time;      /* absolute time at process start */
 65     timeout_t            end_time;        /* absolute time at process end */
 66     affinity_t           affinity;        /* process affinity mask */
 67     int                  priority;        /* priority class */
 68     int                  suspend;         /* global process suspend count */
 69     int                  is_system;       /* is it a system process? */
 70     unsigned int         create_flags;    /* process creation flags */
 71     struct list          locks;           /* list of file locks owned by the process */
 72     struct list          classes;         /* window classes owned by the process */
 73     struct console_input*console;         /* console input */
 74     enum startup_state   startup_state;   /* startup state */
 75     struct startup_info *startup_info;    /* startup info while init is in progress */
 76     struct event        *idle_event;      /* event for input idle */
 77     obj_handle_t         winstation;      /* main handle to process window station */
 78     obj_handle_t         desktop;         /* handle to desktop to use for new threads */
 79     struct token        *token;           /* security token associated with this process */
 80     struct list          dlls;            /* list of loaded dlls */
 81     client_ptr_t         peb;             /* PEB address in client address space */
 82     client_ptr_t         ldt_copy;        /* pointer to LDT copy in client addr space */
 83     unsigned int         trace_data;      /* opaque data used by the process tracing mechanism */
 84 };
 85 
 86 struct process_snapshot
 87 {
 88     struct process *process;  /* process ptr */
 89     int             count;    /* process refcount */
 90     int             threads;  /* number of threads */
 91     int             priority; /* priority class */
 92     int             handles;  /* number of handles */
 93 };
 94 
 95 /* process functions */
 96 
 97 extern unsigned int alloc_ptid( void *ptr );
 98 extern void free_ptid( unsigned int id );
 99 extern void *get_ptid_entry( unsigned int id );
100 extern struct thread *create_process( int fd, struct thread *parent_thread, int inherit_all );
101 extern data_size_t init_process( struct thread *thread );
102 extern struct thread *get_process_first_thread( struct process *process );
103 extern struct process *get_process_from_id( process_id_t id );
104 extern struct process *get_process_from_handle( obj_handle_t handle, unsigned int access );
105 extern int process_set_debugger( struct process *process, struct thread *thread );
106 extern int debugger_detach( struct process* process, struct thread* debugger );
107 extern int set_process_debug_flag( struct process *process, int flag );
108 
109 extern void add_process_thread( struct process *process,
110                                 struct thread *thread );
111 extern void remove_process_thread( struct process *process,
112                                    struct thread *thread );
113 extern void suspend_process( struct process *process );
114 extern void resume_process( struct process *process );
115 extern void kill_process( struct process *process, int violent_death );
116 extern void kill_console_processes( struct thread *renderer, int exit_code );
117 extern void kill_debugged_processes( struct thread *debugger, int exit_code );
118 extern void break_process( struct process *process );
119 extern void detach_debugged_processes( struct thread *debugger );
120 extern struct process_snapshot *process_snap( int *count );
121 extern void enum_processes( int (*cb)(struct process*, void*), void *user);
122 
123 /* console functions */
124 extern void inherit_console(struct thread *parent_thread, struct process *process, obj_handle_t hconin);
125 extern int free_console( struct process *process );
126 extern struct thread *console_get_renderer( struct console_input *console );
127 
128 /* process tracing mechanism to use */
129 #ifdef __APPLE__
130 #define USE_MACH
131 #elif defined(__sun)
132 #define USE_PROCFS
133 #else
134 #define USE_PTRACE
135 #endif
136 
137 extern void init_tracing_mechanism(void);
138 extern void init_process_tracing( struct process *process );
139 extern void finish_process_tracing( struct process *process );
140 extern int read_process_memory( struct process *process, client_ptr_t ptr, data_size_t size, char *dest );
141 extern int write_process_memory( struct process *process, client_ptr_t ptr, data_size_t size, const char *src );
142 
143 static inline process_id_t get_process_id( struct process *process ) { return process->id; }
144 
145 static inline int is_process_init_done( struct process *process )
146 {
147     return process->startup_state == STARTUP_DONE;
148 }
149 
150 static inline struct process_dll *get_process_exe_module( struct process *process )
151 {
152     struct list *ptr = list_head( &process->dlls );
153     return ptr ? LIST_ENTRY( ptr, struct process_dll, entry ) : NULL;
154 }
155 
156 #endif  /* __WINE_SERVER_PROCESS_H */
157 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.