server: Stop exporting the console_input structure. Get rid of console.h.

This commit is contained in:
Alexandre Julliard 2007-05-11 12:46:32 +02:00
parent 24bf66180b
commit 627ca4079e
5 changed files with 37 additions and 60 deletions

View File

@ -35,13 +35,37 @@
#include "process.h"
#include "request.h"
#include "unicode.h"
#include "console.h"
#include "wincon.h"
#include "winternl.h"
/* specific access rights (FIXME: should use finer-grained access rights) */
#define CONSOLE_READ 0x01
#define CONSOLE_WRITE 0x02
struct screen_buffer;
struct console_input_events;
struct console_input
{
struct object obj; /* object header */
int num_proc; /* number of processes attached to this console */
struct thread *renderer; /* console renderer thread */
int mode; /* input mode */
struct screen_buffer *active; /* active screen buffer */
int recnum; /* number of input records */
INPUT_RECORD *records; /* input records */
struct console_input_events *evt; /* synchronization event with renderer */
WCHAR *title; /* console title */
WCHAR **history; /* lines history */
int history_size; /* number of entries in history array */
int history_index; /* number of used entries in history array */
int history_mode; /* mode of history (non zero means remove doubled strings */
int edition_mode; /* index to edition mode flavors */
int input_cp; /* console input codepage */
int output_cp; /* console output codepage */
struct event *event; /* event to wait on for input queue */
};
static unsigned int console_map_access( struct object *obj, unsigned int access );
static void console_input_dump( struct object *obj, int verbose );
@ -405,6 +429,11 @@ void inherit_console(struct thread *parent_thread, struct process *process, obj_
}
}
struct thread *console_get_renderer( struct console_input *console )
{
return console->renderer;
}
static struct console_input* console_input_get( obj_handle_t handle, unsigned access )
{
struct console_input* console = NULL;

View File

@ -1,55 +0,0 @@
/*
* Wine server consoles
*
* Copyright (C) 2001 Eric Pouech
*
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_SERVER_CONSOLE_H
#define __WINE_SERVER_CONSOLE_H
#include "wincon.h"
struct screen_buffer;
struct console_input_events;
struct console_input
{
struct object obj; /* object header */
int num_proc; /* number of processes attached to this console */
struct thread *renderer; /* console renderer thread */
int mode; /* input mode */
struct screen_buffer *active; /* active screen buffer */
int recnum; /* number of input records */
INPUT_RECORD *records; /* input records */
struct console_input_events *evt; /* synchronization event with renderer */
WCHAR *title; /* console title */
WCHAR **history; /* lines history */
int history_size; /* number of entries in history array */
int history_index; /* number of used entries in history array */
int history_mode; /* mode of history (non zero means remove doubled strings */
int edition_mode; /* index to edition mode flavors */
int input_cp; /* console input codepage */
int output_cp; /* console output codepage */
struct event *event; /* event to wait on for input queue */
};
/* console functions */
extern void inherit_console(struct thread *parent_thread, struct process *process, obj_handle_t hconin);
extern int free_console( struct process *process );
#endif /* __WINE_SERVER_CONSOLE_H */

View File

@ -36,7 +36,6 @@
#include "process.h"
#include "thread.h"
#include "request.h"
#include "console.h"
enum debug_event_state { EVENT_QUEUED, EVENT_SENT, EVENT_CONTINUED };
@ -426,7 +425,7 @@ static int debugger_attach( struct process *process, struct thread *debugger )
if (thread->process == process) goto error;
/* don't let a debugger debug its console... won't work */
if (debugger->process->console && debugger->process->console->renderer->process == process)
if (debugger->process->console && console_get_renderer(debugger->process->console)->process == process)
goto error;
suspend_process( process );

View File

@ -46,7 +46,6 @@
#include "process.h"
#include "thread.h"
#include "request.h"
#include "console.h"
#include "user.h"
#include "security.h"
@ -567,7 +566,7 @@ void kill_console_processes( struct thread *renderer, int exit_code )
{
if (process == renderer->process) continue;
if (!process->running_threads) continue;
if (process->console && process->console->renderer == renderer) break;
if (process->console && console_get_renderer( process->console ) == renderer) break;
}
if (&process->entry == &process_list) break; /* no process found */
terminate_process( process, NULL, exit_code );

View File

@ -130,6 +130,11 @@ 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);
/* console functions */
extern void inherit_console(struct thread *parent_thread, struct process *process, obj_handle_t hconin);
extern int free_console( struct process *process );
extern struct thread *console_get_renderer( struct console_input *console );
/* process tracing mechanism to use */
#ifdef __APPLE__
#define USE_MACH