Rebase against 97ac9d410fdd612db863fdccc538d8dd8d94d91a.

This commit is contained in:
Sebastian Lackner 2015-12-10 16:57:56 +01:00
parent 7dac88ab13
commit 42da4b38cc
5 changed files with 141 additions and 116 deletions

View File

@ -1,103 +0,0 @@
From 20e3383c70146e8220f08ebc379895139c9eb496 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Sat, 5 Dec 2015 22:47:17 +0100
Subject: ntdll: Fix implementation of NtQueryInformationProcess for
ProcessDebugFlags.
---
dlls/ntdll/process.c | 5 ++++-
dlls/ntdll/tests/info.c | 12 ++++++++----
server/process.c | 1 +
server/protocol.def | 3 ++-
4 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c
index ca9462a..636c294 100644
--- a/dlls/ntdll/process.c
+++ b/dlls/ntdll/process.c
@@ -339,7 +339,10 @@ NTSTATUS WINAPI NtQueryInformationProcess(
req->handle = wine_server_obj_handle( ProcessHandle );
if ((ret = wine_server_call( req )) == STATUS_SUCCESS)
{
- *(DWORD *)ProcessInformation = !reply->debugger_present;
+ if (!reply->debugger_present)
+ *(DWORD *)ProcessInformation = TRUE;
+ else
+ *(DWORD *)ProcessInformation = reply->debug_children;
}
}
SERVER_END_REQ;
diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index 21b2e6c..18a73ab 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -1271,8 +1271,9 @@ static void test_query_process_debug_object_handle(int argc, char **argv)
ok(ret, "CloseHandle failed with last error %u\n", GetLastError());
}
-static void test_query_process_debug_flags(int argc, char **argv)
+static void test_query_process_debug_flags(int argc, char **argv, DWORD flags)
{
+ DWORD expected_flags = !(flags & DEBUG_ONLY_THIS_PROCESS);
DWORD debug_flags = 0xdeadbeef;
char cmdline[MAX_PATH];
PROCESS_INFORMATION pi;
@@ -1283,7 +1284,7 @@ static void test_query_process_debug_flags(int argc, char **argv)
sprintf(cmdline, "%s %s %s", argv[0], argv[1], "debuggee");
si.cb = sizeof(si);
- ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS, NULL, NULL, &si, &pi);
+ ret = CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, flags, NULL, NULL, &si, &pi);
ok(ret, "CreateProcess failed, last error %#x.\n", GetLastError());
if (!ret) return;
@@ -1320,7 +1321,8 @@ static void test_query_process_debug_flags(int argc, char **argv)
status = pNtQueryInformationProcess(pi.hProcess, ProcessDebugFlags,
&debug_flags, sizeof(debug_flags), NULL);
ok(!status || broken(status == STATUS_INVALID_INFO_CLASS) /* NT4 */, "NtQueryInformationProcess failed, status %#x.\n", status);
- ok(debug_flags == FALSE || broken(status == STATUS_INVALID_INFO_CLASS) /* NT4 */, "Expected flag FALSE, got %x.\n", debug_flags);
+ ok(debug_flags == expected_flags || broken(status == STATUS_INVALID_INFO_CLASS) /* NT4 */,
+ "Expected flag %u, got %x.\n", expected_flags, debug_flags);
for (;;)
{
@@ -1871,7 +1873,9 @@ START_TEST(info)
/* 0x1F ProcessDebugFlags */
trace("Starting test_process_debug_flags()\n");
- test_query_process_debug_flags(argc, argv);
+ test_query_process_debug_flags(argc, argv, DEBUG_PROCESS);
+ test_query_process_debug_flags(argc, argv, DEBUG_ONLY_THIS_PROCESS);
+ test_query_process_debug_flags(argc, argv, DEBUG_PROCESS | DEBUG_ONLY_THIS_PROCESS);
/* belongs to its own file */
trace("Starting test_readvirtualmemory()\n");
diff --git a/server/process.c b/server/process.c
index e00b429..c738de6 100644
--- a/server/process.c
+++ b/server/process.c
@@ -1359,6 +1359,7 @@ DECL_HANDLER(get_process_info)
reply->end_time = process->end_time;
reply->cpu = process->cpu;
reply->debugger_present = !!process->debugger;
+ reply->debug_children = process->debug_children;
release_object( process );
}
}
diff --git a/server/protocol.def b/server/protocol.def
index 04814c9..b5f5457 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -818,7 +818,8 @@ struct rawinput_device
int exit_code; /* process exit code */
int priority; /* priority class */
cpu_type_t cpu; /* CPU that this process is running on */
- int debugger_present; /* process is being debugged */
+ short int debugger_present; /* process is being debugged */
+ short int debug_children; /* debug child processes */
@END
--
2.6.2

View File

@ -0,0 +1,125 @@
From 682c8d52bbec194245ce03428ab1678a28d6acf5 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Thu, 10 Dec 2015 03:11:25 +0100
Subject: ntdll: ProcessDebugFlags should return debug_children flag instead of
!debugger_present.
Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
---
dlls/ntdll/process.c | 2 +-
dlls/ntdll/tests/info.c | 12 ++----------
server/debugger.c | 2 +-
server/process.c | 5 +++--
server/protocol.def | 3 ++-
5 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c
index ca9462a..5a5c3ef 100644
--- a/dlls/ntdll/process.c
+++ b/dlls/ntdll/process.c
@@ -339,7 +339,7 @@ NTSTATUS WINAPI NtQueryInformationProcess(
req->handle = wine_server_obj_handle( ProcessHandle );
if ((ret = wine_server_call( req )) == STATUS_SUCCESS)
{
- *(DWORD *)ProcessInformation = !reply->debugger_present;
+ *(DWORD *)ProcessInformation = reply->debug_children;
}
}
SERVER_END_REQ;
diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
index 88d0417..a521447 100644
--- a/dlls/ntdll/tests/info.c
+++ b/dlls/ntdll/tests/info.c
@@ -1345,11 +1345,7 @@ static void test_query_process_debug_flags(int argc, char **argv)
status = pNtQueryInformationProcess(pi.hProcess, ProcessDebugFlags,
&debug_flags, sizeof(debug_flags), NULL);
ok(!status, "NtQueryInformationProcess failed, status %#x.\n", status);
- if (!expected_flags)
- ok(debug_flags == expected_flags, "Expected flag %x, got %x.\n", expected_flags, debug_flags);
- else
- todo_wine
- ok(debug_flags == expected_flags, "Expected flag %x, got %x.\n", expected_flags, debug_flags);
+ ok(debug_flags == expected_flags, "Expected flag %x, got %x.\n", expected_flags, debug_flags);
if (!(test_flags[i] & CREATE_SUSPENDED))
{
@@ -1379,11 +1375,7 @@ static void test_query_process_debug_flags(int argc, char **argv)
status = pNtQueryInformationProcess(pi.hProcess, ProcessDebugFlags,
&debug_flags, sizeof(debug_flags), NULL);
ok(!status, "NtQueryInformationProcess failed, status %#x.\n", status);
- if (expected_flags)
- ok(debug_flags == expected_flags, "Expected flag %x, got %x.\n", expected_flags, debug_flags);
- else
- todo_wine
- ok(debug_flags == expected_flags, "Expected flag %x, got %x.\n", expected_flags, debug_flags);
+ ok(debug_flags == expected_flags, "Expected flag %x, got %x.\n", expected_flags, debug_flags);
ret = DebugActiveProcess(pi.dwProcessId);
ok(ret, "DebugActiveProcess failed, last error %#x.\n", GetLastError());
diff --git a/server/debugger.c b/server/debugger.c
index 374f2ad..810e8d3 100644
--- a/server/debugger.c
+++ b/server/debugger.c
@@ -443,6 +443,7 @@ static int debugger_attach( struct process *process, struct thread *debugger )
resume_process( process );
return 0;
}
+ process->debug_children = 0;
return 1;
error:
@@ -483,7 +484,6 @@ int debugger_detach( struct process *process, struct thread *debugger )
/* remove relationships between process and its debugger */
process->debugger = NULL;
- process->debug_children = 0;
if (!set_process_debug_flag( process, 0 )) clear_error(); /* ignore error */
/* from this function */
diff --git a/server/process.c b/server/process.c
index e00b429..8433002 100644
--- a/server/process.c
+++ b/server/process.c
@@ -513,7 +513,7 @@ struct thread *create_process( int fd, struct thread *parent_thread, int inherit
process->priority = PROCESS_PRIOCLASS_NORMAL;
process->suspend = 0;
process->is_system = 0;
- process->debug_children = 0;
+ process->debug_children = 1;
process->is_terminating = 0;
process->job = NULL;
process->console = NULL;
@@ -1228,7 +1228,7 @@ DECL_HANDLER(new_process)
else if (parent->debugger && parent->debug_children)
{
set_process_debugger( process, parent->debugger );
- process->debug_children = 1;
+ /* debug_children is set to 1 by default */
}
if (!(req->create_flags & CREATE_NEW_PROCESS_GROUP))
@@ -1359,6 +1359,7 @@ DECL_HANDLER(get_process_info)
reply->end_time = process->end_time;
reply->cpu = process->cpu;
reply->debugger_present = !!process->debugger;
+ reply->debug_children = process->debug_children;
release_object( process );
}
}
diff --git a/server/protocol.def b/server/protocol.def
index 04814c9..bfb9089 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -818,7 +818,8 @@ struct rawinput_device
int exit_code; /* process exit code */
int priority; /* priority class */
cpu_type_t cpu; /* CPU that this process is running on */
- int debugger_present; /* process is being debugged */
+ short int debugger_present; /* process is being debugged */
+ short int debug_children; /* inherit debugger to child processes */
@END
--
2.6.2

View File

@ -1,17 +1,18 @@
From 4e6408362a1435a59e08aef7ac161536fe13b6c3 Mon Sep 17 00:00:00 2001
From 95821cbad0ce5df59fcb591e5aab9459a388321e Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Fri, 10 Apr 2015 08:17:22 +0200
Subject: Revert "opengl32: Return a NULL pointer for functions requiring
unsupported or disabled extensions."
This reverts commit bfd4836867d6d90eaeae6ccbc02e37678b59b8f1 and
5c9ddc55dcf6e64d747b1a8ab01e408d4b8d55e1.
5c9ddc55dcf6e64d747b1a8ab01e408d4b8d55e1 and
e44f8eaa0fce02032e6c3f43052821f40eaba53b.
---
dlls/opengl32/wgl.c | 16 ----------------
1 file changed, 16 deletions(-)
diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index 88aa564..75d3796 100644
index 3b817a4..75d3796 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -877,23 +877,7 @@ PROC WINAPI wglGetProcAddress( LPCSTR name )
@ -25,15 +26,15 @@ index 88aa564..75d3796 100644
- { "glCopyTexSubImage3DEXT", "glCopyTexSubImage3D" }, /* needed by RuneScape */
- };
-
- for (i = 0; i < sizeof(alternatives)/sizeof(alternatives[0]); i++)
WARN("Extension %s required for %s not supported\n", ext_ret->extension, name);
- driver_func = NULL;
-
- for (i = 0; i < sizeof(alternatives)/sizeof(alternatives[0]) && !driver_func; i++)
- {
- if (strcmp( name, alternatives[i].name )) continue;
- WARN("Extension %s required for %s not supported, trying %s\n",
- ext_ret->extension, name, alternatives[i].alt );
- return wglGetProcAddress( alternatives[i].alt );
- WARN("Trying alternative %s for %s\n", alternatives[i].alt, name );
- driver_func = wglGetProcAddress( alternatives[i].alt );
- }
WARN("Extension %s required for %s not supported\n", ext_ret->extension, name);
- return NULL;
- }
if (driver_func == NULL)

View File

@ -52,7 +52,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "d29dcec6efa935abc2db2cbb726c48086a8e1a71"
echo "97ac9d410fdd612db863fdccc538d8dd8d94d91a"
}
# Show version information
@ -4360,12 +4360,12 @@ fi
# Patchset ntdll-ProcessDebugFlags
# |
# | Modified files:
# | * dlls/ntdll/process.c, dlls/ntdll/tests/info.c, server/process.c, server/protocol.def
# | * dlls/ntdll/process.c, dlls/ntdll/tests/info.c, server/debugger.c, server/process.c, server/protocol.def
# |
if test "$enable_ntdll_ProcessDebugFlags" -eq 1; then
patch_apply ntdll-ProcessDebugFlags/0001-ntdll-Fix-implementation-of-NtQueryInformationProces.patch
patch_apply ntdll-ProcessDebugFlags/0001-ntdll-ProcessDebugFlags-should-return-debug_children.patch
(
echo '+ { "Sebastian Lackner", "ntdll: Fix implementation of NtQueryInformationProcess for ProcessDebugFlags.", 1 },';
echo '+ { "Sebastian Lackner", "ntdll: ProcessDebugFlags should return debug_children flag instead of !debugger_present.", 1 },';
) >> "$patchlist"
fi

View File

@ -1,4 +1,6 @@
wine-staging (1.8~rc4) UNRELEASED; urgency=low
* Updated patch to fix implementation of NtQueryInformationProcess for
ProcessDebugFlags.
* Removed patch to set LastError to 0 in GetSidIdentifierAuthority (accepted
upstream).
* Removed patch to return an error when trying to open a terminated process