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

Wine Cross Reference
wine/server/process.h

Version: ~ [ wine-1.0-rc1 ] ~ [ wine-0.9.61 ] ~ [ wine-0.9.60 ] ~ [ wine-0.9.59 ] ~ [ wine-0.9.58 ] ~ [ wine-0.9.57 ] ~ [ wine-0.9.56 ] ~ [ wine-0.9.55 ] ~ [ wine-0.9.54 ] ~ [ wine-0.9.53 ] ~ [ wine-0.9.52 ] ~ [ wine-0.9.51 ] ~ [ wine-0.9.50 ] ~ [ wine-0.9.49 ] ~ [ wine-0.9.48 ] ~ [ wine-0.9.47 ] ~ [ wine-0.9.46 ] ~ [ wine-0.9.45 ] ~ [ wine-0.9.44 ] ~ [ wine-0.9.43 ] ~ [ wine-0.9.42 ] ~ [ wine-0.9.41 ] ~ [ wine-0.9.40 ] ~ [ wine-0.9.39 ] ~ [ wine-0.9.38 ] ~ [ wine-0.9.37 ] ~ [ wine-0.9.36 ] ~ [ wine-0.9.35 ] ~ [ wine-0.9.34 ] ~ [ wine-0.9.33 ] ~ [ wine-0.9.32 ] ~ [ wine-0.9.31 ] ~ [ wine-0.9.30 ] ~ [ wine-0.9.29 ] ~ [ wine-0.9.28 ] ~ [ wine-0.9.27 ] ~ [ wine-0.9.26 ] ~ [ wine-0.9.25 ] ~ [ wine-0.9.24 ] ~ [ wine-0.9.23 ] ~ [ wine-0.9.22 ] ~ [ wine-0.9.21 ] ~ [ wine-0.9.20 ] ~ [ wine-0.9.19 ] ~ [ wine-0.9.18 ] ~ [ wine-0.9.17 ] ~ [ wine-0.9.16 ] ~ [ wine-0.9.15 ] ~ [ wine-0.9.14 ] ~ [ wine-0.9.13 ] ~ [ wine-0.9.12 ] ~ [ wine-0.9.11 ] ~ [ wine-0.9.10 ] ~ [ wine-0.9.9 ] ~ [ wine-0.9.8 ] ~ [ wine-0.9.7 ] ~ [ wine-0.9.6 ] ~ [ wine-0.9.5 ] ~ [ wine-0.9.4 ] ~ [ wine-0.9.3 ] ~ [ wine-0.9.2 ] ~ [ wine-0.9.1 ] ~ [ wine-0.9 ] ~ [ wine20050930 ] ~ [ wine20050830 ] ~ [ wine20050725 ] ~ [ wine20050628 ] ~ [ wine20050524 ] ~ [ wine20050419 ] ~ [ wine20050310 ] ~ [ wine20050211 ] ~ [ wine20050111 ] ~ [ wine20041201 ] ~ [ wine20041019 ] ~ [ wine20040914 ] ~ [ wine20040813 ] ~ [ wine20040716 ] ~ [ wine20040615 ] ~ [ wine20040505 ] ~ [ wine20040408 ] ~ [ wine20040309 ] ~ [ wine20040213 ] ~ [ wine20040121 ] ~ [ wine20031212 ] ~ [ wine20031118 ] ~ [ wine20031016 ] ~ [ wine20030911 ] ~ [ wine20030813 ] ~ [ wine20030709 ] ~ [ wine20030618 ] ~ [ wine20030508 ] ~ [ wine20030408 ] ~ [ wine20030318 ] ~ [ wine20030219 ] ~ [ wine20030115 ] ~ [ wine20021219 ] ~ [ wine20021125 ] ~ [ wine20021031 ] ~ [ wine20021007 ] ~ [ wine20020904 ] ~ [ wine20020804 ] ~ [ wine20020710 ] ~ [ wine20020605 ] ~ [ wine20020509 ] ~ [ wine20020411 ] ~ [ wine20020310 ] ~ [ wine20020228 ] ~ [ wine20011226 ] ~ [ wine20011108 ] ~ [ wine20011004 ] ~ [ wine20010824 ] ~ [ wine20010731 ] ~ [ wine20010629 ] ~ [ wine20010510 ] ~ [ wine20010418 ] ~ [ wine20010326 ] ~ [ wine20010305 ] ~ [ wine20010216 ] ~ [ wine20010112 ] ~ [ wine20001222 ] ~ [ wine20001202 ] ~ [ wine20001026 ] ~ [ wine20001002 ] ~ [ wine20000909 ] ~ [ wine20000821 ] ~ [ wine20000801 ] ~ [ wine20000716 ] ~ [ wine20000326 ] ~ [ wine20000227 ] ~ [ wine20000130 ] ~ [ wine20000109 ] ~

  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 msg_queue;
 27 struct atom_table;
 28 struct handle_table;
 29 struct startup_info;
 30 
 31 /* process startup state */
 32 enum startup_state { STARTUP_IN_PROGRESS, STARTUP_DONE, STARTUP_ABORTED };
 33 
 34 /* process structures */
 35 
 36 struct process_dll
 37 {
 38     struct list          entry;           /* entry in per-process dll list */
 39     struct file         *file;            /* dll file */
 40     void                *base;            /* dll base address (in process addr space) */
 41     size_t               size;            /* dll size */
 42     void                *name;            /* ptr to ptr to name (in process addr space) */
 43     int                  dbg_offset;      /* debug info offset */
 44     int                  dbg_size;        /* debug info size */
 45     data_size_t          namelen;         /* length of dll file name */
 46     WCHAR               *filename;        /* dll file name */
 47 };
 48 
 49 struct process
 50 {
 51     struct object        obj;             /* object header */
 52     struct list          entry;           /* entry in system-wide process list */
 53     struct process      *parent;          /* parent process */
 54     struct list          thread_list;     /* thread list */
 55     struct thread       *debugger;        /* thread debugging this process */
 56     struct handle_table *handles;         /* handle entries */
 57     struct fd           *msg_fd;          /* fd for sendmsg/recvmsg */
 58     process_id_t         id;              /* id of the process */
 59     process_id_t         group_id;        /* group id of the process */
 60     struct timeout_user *sigkill_timeout; /* timeout for final SIGKILL */
 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     int                  priority;        /* priority class */
 67     unsigned int         affinity;        /* process affinity mask */
 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     struct msg_queue    *queue;           /* main message queue */
 78     obj_handle_t         winstation;      /* main handle to process window station */
 79     obj_handle_t         desktop;         /* handle to desktop to use for new threads */
 80     struct token        *token;           /* security token associated with this process */
 81     struct list          dlls;            /* list of loaded dlls */
 82     void                *peb;             /* PEB address in client address space */
 83     void                *ldt_copy;        /* pointer to LDT copy in client addr space */
 84     unsigned int         trace_data;      /* opaque data used by the process tracing mechanism */
 85 };
 86 
 87 struct process_snapshot
 88 {
 89     struct process *process;  /* process ptr */
 90     int             count;    /* process refcount */
 91     int             threads;  /* number of threads */
 92     int             priority; /* priority class */
 93     int             handles;  /* number of handles */
 94 };
 95 
 96 struct module_snapshot
 97 {
 98     void           *base;     /* module base addr */
 99     size_t          size;     /* module size */
100     data_size_t     namelen;  /* length of file name */
101     WCHAR          *filename; /* module file name */
102 };
103 
104 /* process functions */
105 
106 extern unsigned int alloc_ptid( void *ptr );
107 extern void free_ptid( unsigned int id );
108 extern void *get_ptid_entry( unsigned int id );
109 extern struct thread *create_process( int fd, struct thread *parent_thread, int inherit_all );
110 extern data_size_t init_process( struct thread *thread );
111 extern struct thread *get_process_first_thread( struct process *process );
112 extern struct process *get_process_from_id( process_id_t id );
113 extern struct process *get_process_from_handle( obj_handle_t handle, unsigned int access );
114 extern int process_set_debugger( struct process *process, struct thread *thread );
115 extern int debugger_detach( struct process* process, struct thread* debugger );
116 extern int set_process_debug_flag( struct process *process, int flag );
117 
118 extern void add_process_thread( struct process *process,
119                                 struct thread *thread );
120 extern void remove_process_thread( struct process *process,
121                                    struct thread *thread );
122 extern void suspend_process( struct process *process );
123 extern void resume_process( struct process *process );
124 extern void kill_process( struct process *process, int violent_death );
125 extern void kill_console_processes( struct thread *renderer, int exit_code );
126 extern void kill_debugged_processes( struct thread *debugger, int exit_code );
127 extern void break_process( struct process *process );
128 extern void detach_debugged_processes( struct thread *debugger );
129 extern struct process_snapshot *process_snap( int *count );
130 extern struct module_snapshot *module_snap( struct process *process, int *count );
131 extern void enum_processes( int (*cb)(struct process*, void*), void *user);
132 
133 /* console functions */
134 extern void inherit_console(struct thread *parent_thread, struct process *process, obj_handle_t hconin);
135 extern int free_console( struct process *process );
136 extern struct thread *console_get_renderer( struct console_input *console );
137 
138 /* process tracing mechanism to use */
139 #ifdef __APPLE__
140 #define USE_MACH
141 #elif defined(__sun)
142 #define USE_PROCFS
143 #else
144 #define USE_PTRACE
145 #endif
146 
147 extern void init_tracing_mechanism(void);
148 extern void init_process_tracing( struct process *process );
149 extern void finish_process_tracing( struct process *process );
150 extern int read_process_memory( struct process *process, const void *ptr, data_size_t size, char *dest );
151 extern int write_process_memory( struct process *process, void *ptr, data_size_t size, const char *src );
152 
153 static inline process_id_t get_process_id( struct process *process ) { return process->id; }
154 
155 static inline int is_process_init_done( struct process *process )
156 {
157     return process->startup_state == STARTUP_DONE;
158 }
159 
160 static inline struct process_dll *get_process_exe_module( struct process *process )
161 {
162     struct list *ptr = list_head( &process->dlls );
163     return ptr ? LIST_ENTRY( ptr, struct process_dll, entry ) : NULL;
164 }
165 
166 #endif  /* __WINE_SERVER_PROCESS_H */
167 

~ [ 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.