Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
3940d8a2
Commit
3940d8a2
authored
Dec 04, 2001
by
Eric Pouech
Committed by
Alexandre Julliard
Dec 04, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let the console renderer be defined as a thread.
parent
ffc61c80
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
22 deletions
+21
-22
console.c
server/console.c
+5
-4
console.h
server/console.h
+2
-2
debugger.c
server/debugger.c
+2
-3
process.c
server/process.c
+10
-13
process.h
server/process.h
+1
-0
thread.c
server/thread.c
+1
-0
No files found.
server/console.c
View file @
3940d8a2
...
...
@@ -180,7 +180,7 @@ static struct console_input_events *create_console_input_events(void)
return
evt
;
}
static
struct
object
*
create_console_input
(
struct
process
*
renderer
)
static
struct
object
*
create_console_input
(
struct
thread
*
renderer
)
{
struct
console_input
*
console_input
;
...
...
@@ -310,9 +310,10 @@ int free_console( struct process *process )
* 2/ parent is a renderer which launches process, and process should attach to the console
* renderered by parent
*/
void
inherit_console
(
struct
process
*
parent
,
struct
process
*
process
,
handle_t
hconin
)
void
inherit_console
(
struct
thread
*
parent_thread
,
struct
process
*
process
,
handle_t
hconin
)
{
int
done
=
0
;
struct
process
*
parent
=
parent_thread
->
process
;
/* if parent is a renderer, then attach current process to its console
* a bit hacky....
...
...
@@ -323,7 +324,7 @@ void inherit_console(struct process *parent, struct process *process, handle_t h
if
((
console
=
(
struct
console_input
*
)
get_handle_obj
(
parent
,
hconin
,
0
,
NULL
)))
{
if
(
console
->
renderer
==
parent
)
if
(
console
->
renderer
==
parent
_thread
)
{
process
->
console
=
(
struct
console_input
*
)
grab_object
(
console
);
process
->
console
->
num_proc
++
;
...
...
@@ -1097,7 +1098,7 @@ DECL_HANDLER(alloc_console)
goto
the_end
;
}
if
((
console
=
(
struct
console_input
*
)
create_console_input
(
renderer
)))
if
((
console
=
(
struct
console_input
*
)
create_console_input
(
current
)))
{
if
((
in
=
alloc_handle
(
renderer
,
console
,
req
->
access
,
req
->
inherit
)))
{
...
...
server/console.h
View file @
3940d8a2
...
...
@@ -16,7 +16,7 @@ struct console_input
{
struct
object
obj
;
/* object header */
int
num_proc
;
/* number of processes attached to this console */
struct
process
*
renderer
;
/* console renderer thread */
struct
thread
*
renderer
;
/* console renderer thread */
int
mode
;
/* input mode */
struct
screen_buffer
*
active
;
/* active screen buffer */
int
recnum
;
/* number of input records */
...
...
@@ -31,7 +31,7 @@ struct console_input
/* console functions */
extern
void
inherit_console
(
struct
process
*
parent
,
struct
process
*
process
,
handle_t
hconin
);
extern
void
inherit_console
(
struct
thread
*
parent_thread
,
struct
process
*
process
,
handle_t
hconin
);
extern
int
free_console
(
struct
process
*
process
);
#endif
/* __WINE_SERVER_CONSOLE_H */
server/debugger.c
View file @
3940d8a2
...
...
@@ -413,9 +413,8 @@ 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
->
console
)
goto
error
;
if
(
debugger
->
process
->
console
&&
debugger
->
process
->
console
->
renderer
->
process
==
process
)
goto
error
;
suspend_process
(
process
);
...
...
server/process.c
View file @
3940d8a2
...
...
@@ -97,7 +97,7 @@ static const struct object_ops startup_info_ops =
/* set the console and stdio handles for a newly created process */
static
int
set_process_console
(
struct
process
*
process
,
struct
process
*
parent
,
static
int
set_process_console
(
struct
process
*
process
,
struct
thread
*
parent_thread
,
struct
startup_info
*
info
,
struct
init_process_reply
*
reply
)
{
if
(
process
->
create_flags
&
CREATE_NEW_CONSOLE
)
...
...
@@ -105,26 +105,26 @@ static int set_process_console( struct process *process, struct process *parent,
/* let the process init do the allocation */
return
1
;
}
else
if
(
parent
&&
!
(
process
->
create_flags
&
DETACHED_PROCESS
))
else
if
(
parent
_thread
&&
!
(
process
->
create_flags
&
DETACHED_PROCESS
))
{
/* FIXME: some better error checking should be done...
* like if hConOut and hConIn are console handles, then they should be on the same
* physical console
*/
inherit_console
(
parent
,
process
,
inherit_console
(
parent
_thread
,
process
,
(
info
->
inherit_all
||
(
info
->
start_flags
&
STARTF_USESTDHANDLES
))
?
info
->
hstdin
:
0
);
}
if
(
parent
)
if
(
parent
_thread
)
{
if
(
!
info
->
inherit_all
&&
!
(
info
->
start_flags
&
STARTF_USESTDHANDLES
))
{
/* duplicate the handle from the parent into this process */
reply
->
hstdin
=
duplicate_handle
(
parent
,
info
->
hstdin
,
process
,
reply
->
hstdin
=
duplicate_handle
(
parent
_thread
->
process
,
info
->
hstdin
,
process
,
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
);
reply
->
hstdout
=
duplicate_handle
(
parent
,
info
->
hstdout
,
process
,
reply
->
hstdout
=
duplicate_handle
(
parent
_thread
->
process
,
info
->
hstdout
,
process
,
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
);
reply
->
hstderr
=
duplicate_handle
(
parent
,
info
->
hstderr
,
process
,
reply
->
hstderr
=
duplicate_handle
(
parent
_thread
->
process
,
info
->
hstderr
,
process
,
0
,
TRUE
,
DUPLICATE_SAME_ACCESS
);
}
else
...
...
@@ -260,7 +260,7 @@ static void init_process( int ppid, struct init_process_reply *reply )
}
/* set the process console */
if
(
!
set_process_console
(
process
,
parent
,
info
,
reply
))
return
;
if
(
!
set_process_console
(
process
,
parent
_thread
,
info
,
reply
))
return
;
if
(
parent
)
{
...
...
@@ -434,7 +434,7 @@ static void process_unload_dll( struct process *process, void *base )
}
/* kill all processes being attached to a console renderer */
static
void
kill_console_processes
(
struct
process
*
renderer
,
int
exit_code
)
void
kill_console_processes
(
struct
thread
*
renderer
,
int
exit_code
)
{
for
(;;)
/* restart from the beginning of the list every time */
{
...
...
@@ -442,7 +442,7 @@ static void kill_console_processes( struct process *renderer, int exit_code )
/* find the first process being attached to 'renderer' and still running */
while
(
process
&&
(
process
==
renderer
||
!
process
->
console
||
(
process
==
renderer
->
process
||
!
process
->
console
||
process
->
console
->
renderer
!=
renderer
||
!
process
->
running_threads
))
{
process
=
process
->
next
;
...
...
@@ -463,9 +463,6 @@ static void process_killed( struct process *process )
/* close the console attached to this process, if any */
free_console
(
process
);
/* close the processes using process as renderer, if any */
kill_console_processes
(
process
,
0
);
while
(
process
->
exe
.
next
)
{
struct
process_dll
*
dll
=
process
->
exe
.
next
;
...
...
server/process.h
View file @
3940d8a2
...
...
@@ -78,6 +78,7 @@ extern void remove_process_thread( struct process *process,
extern
void
suspend_process
(
struct
process
*
process
);
extern
void
resume_process
(
struct
process
*
process
);
extern
void
kill_process
(
struct
process
*
process
,
struct
thread
*
skip
,
int
exit_code
);
extern
void
kill_console_processes
(
struct
thread
*
renderer
,
int
exit_code
);
extern
void
kill_debugged_processes
(
struct
thread
*
debugger
,
int
exit_code
);
extern
struct
process_snapshot
*
process_snap
(
int
*
count
);
extern
struct
module_snapshot
*
module_snap
(
struct
process
*
process
,
int
*
count
);
...
...
server/thread.c
View file @
3940d8a2
...
...
@@ -698,6 +698,7 @@ void kill_thread( struct thread *thread, int violent_death )
/* if it is waiting on the socket, we don't need to send a SIGTERM */
violent_death
=
0
;
}
kill_console_processes
(
thread
,
0
);
debug_exit_thread
(
thread
);
abandon_mutexes
(
thread
);
remove_process_thread
(
thread
->
process
,
thread
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment