server-OpenProcess: Update to latest version of the patch.

This commit is contained in:
Sebastian Lackner 2014-08-23 07:39:07 +02:00
parent 26b0797bcb
commit fe0aa3f54d
3 changed files with 39 additions and 10 deletions

View File

@ -695,19 +695,19 @@ server-Misc_ACL.ok:
# Patchset server-OpenProcess
# |
# | Included patches:
# | * Return error when opening a terminating process. [rev 2, by Michael Müller]
# | * Return error when opening a terminating process. [rev 3, by Michael Müller]
# |
# | This patchset fixes the following Wine bugs:
# | * [#37087] Return an error when trying to open a terminated process
# |
# | Modified files:
# | * server/process.c
# | * server/process.c, server/process.h
# |
.INTERMEDIATE: server-OpenProcess.ok
server-OpenProcess.ok:
$(call APPLY_FILE,server-OpenProcess/0001-server-Return-error-when-opening-a-terminating-proce.patch)
@( \
echo '+ { "server-OpenProcess", "Michael Müller", "Return error when opening a terminating process. [rev 2]" },'; \
echo '+ { "server-OpenProcess", "Michael Müller", "Return error when opening a terminating process. [rev 3]" },'; \
) > server-OpenProcess.ok
# Patchset server-Stored_ACLs

View File

@ -1,28 +1,57 @@
From 4f041a785404f778e34d5ecbf1249ca79704a89d Mon Sep 17 00:00:00 2001
From c45e6864494332d04e7e93be02a0ee8222bd9383 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Thu, 14 Aug 2014 03:05:52 +0200
Subject: server: Return error when opening a terminating process.
---
server/process.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
server/process.c | 7 ++++++-
server/process.h | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/server/process.c b/server/process.c
index 7b9a3b2..1012a8e 100644
index 426bcca..0574a32 100644
--- a/server/process.c
+++ b/server/process.c
@@ -1082,7 +1082,10 @@ DECL_HANDLER(open_process)
@@ -268,6 +268,7 @@ void shutdown_master_socket(void)
/* final cleanup once we are sure a process is really dead */
static void process_died( struct process *process )
{
+ process->is_terminated = 1;
if (debug_level) fprintf( stderr, "%04x: *process killed*\n", process->id );
if (!process->is_system)
{
@@ -324,6 +325,7 @@ struct thread *create_process( int fd, struct thread *parent_thread, int inherit
process->is_system = 0;
process->debug_children = 0;
process->is_terminating = 0;
+ process->is_terminated = 0;
process->console = NULL;
process->startup_state = STARTUP_IN_PROGRESS;
process->startup_info = NULL;
@@ -1129,7 +1131,10 @@ DECL_HANDLER(open_process)
reply->handle = 0;
if (process)
{
- reply->handle = alloc_handle( current->process, process, req->access, req->attributes );
+ if (process->startup_state != STARTUP_ABORTED)
+ if (!process->is_terminated)
+ reply->handle = alloc_handle( current->process, process, req->access, req->attributes );
+ else
+ set_error( STATUS_INVALID_PARAMETER );
release_object( process );
}
}
diff --git a/server/process.h b/server/process.h
index a50b537..da6d3da 100644
--- a/server/process.h
+++ b/server/process.h
@@ -75,6 +75,7 @@ struct process
unsigned int is_system:1; /* is it a system process? */
unsigned int debug_children:1;/* also debug all child processes */
unsigned int is_terminating:1;/* is process terminating? */
+ unsigned int is_terminated:1; /* is process terminated? */
struct list locks; /* list of file locks owned by the process */
struct list classes; /* window classes owned by the process */
struct console_input*console; /* console input */
--
1.7.9.5

View File

@ -1,4 +1,4 @@
Author: Michael Müller
Subject: Return error when opening a terminating process.
Revision: 2
Revision: 3
Fixes: [37087] Return an error when trying to open a terminated process