mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
Added patches to implement ThreadQuerySetWin32StartAddress info class.
This commit is contained in:
parent
e4d5d84401
commit
1b23958eb3
@ -39,9 +39,10 @@ Wine. All those differences are also documented on the
|
||||
Included bug fixes and improvements
|
||||
-----------------------------------
|
||||
|
||||
**Bug fixes and features included in the next upcoming release [7]:**
|
||||
**Bug fixes and features included in the next upcoming release [8]:**
|
||||
|
||||
* Add stubs for d3dx10_43.D3DX10CreateEffectFromFileA/W ([Wine Bug #27739](https://bugs.winehq.org/show_bug.cgi?id=27739))
|
||||
* Add support for ThreadQuerySetWin32StartAddress info class ([Wine Bug #8277](https://bugs.winehq.org/show_bug.cgi?id=8277))
|
||||
* Check architecture before trying to load libraries ([Wine Bug #38021](https://bugs.winehq.org/show_bug.cgi?id=38021))
|
||||
* Fix loading of libraries with incomplete IMAGE_LOAD_CONFIG_DIRECTORY struct
|
||||
* Fix security cookie handling for UPX compressed executables ([Wine Bug #38949](https://bugs.winehq.org/show_bug.cgi?id=38949))
|
||||
|
1
debian/changelog
vendored
1
debian/changelog
vendored
@ -12,6 +12,7 @@ wine-staging (1.7.48) UNRELEASED; urgency=low
|
||||
* Added patch to silence repeated LocaleNameToLCID/LCIDToLocaleName
|
||||
unsupported flags FIXMEs.
|
||||
* Added patches to improve security cookie handling.
|
||||
* Added patches to implement ThreadQuerySetWin32StartAddress info class.
|
||||
* Removed patch to allow to enable/disable InsertMode in wineconsole settings
|
||||
(accepted upstream).
|
||||
* Removed patch to improve IoGetDeviceObjectPointer stub to appease SecuROM
|
||||
|
@ -0,0 +1,96 @@
|
||||
From 1896eceb640a7488c09c3cd6dadd63ecca8f510d Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Mon, 27 Jul 2015 06:12:30 +0200
|
||||
Subject: server: Use a separate wineserver call to fetch thread times.
|
||||
|
||||
By moving the creation_time / exit_time to a separate wineserver call, we can
|
||||
safe a couple of bytes required for the following patches. Thats not the only
|
||||
purpose, this patch is also in preparation for a proper implementation of
|
||||
NtQueryInformationThread(..., ThreadTimes, ...). The wineserver can use
|
||||
/proc/<pid>/task/<tid>/stat to obtain precise thread time information, which
|
||||
means we'll need space for two additional timeout_t values. Since accessing
|
||||
/proc might have some overhead, its better to do it only when really required.
|
||||
The values can afterwards be cached for some short amount of time.
|
||||
---
|
||||
dlls/ntdll/thread.c | 6 ++----
|
||||
server/protocol.def | 11 +++++++++--
|
||||
server/thread.c | 14 +++++++++++++-
|
||||
3 files changed, 24 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
|
||||
index 3696c8e..2781827 100644
|
||||
--- a/dlls/ntdll/thread.c
|
||||
+++ b/dlls/ntdll/thread.c
|
||||
@@ -962,12 +962,10 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
|
||||
case ThreadTimes:
|
||||
{
|
||||
KERNEL_USER_TIMES kusrt;
|
||||
- /* We need to do a server call to get the creation time or exit time */
|
||||
- /* This works on any thread */
|
||||
- SERVER_START_REQ( get_thread_info )
|
||||
+
|
||||
+ SERVER_START_REQ( get_thread_times )
|
||||
{
|
||||
req->handle = wine_server_obj_handle( handle );
|
||||
- req->tid_in = 0;
|
||||
status = wine_server_call( req );
|
||||
if (status == STATUS_SUCCESS)
|
||||
{
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 0ff1a6b..3d7f7be 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -842,14 +842,21 @@ struct rawinput_device
|
||||
thread_id_t tid; /* server thread id */
|
||||
client_ptr_t teb; /* thread teb pointer */
|
||||
affinity_t affinity; /* thread affinity mask */
|
||||
- timeout_t creation_time; /* thread creation time */
|
||||
- timeout_t exit_time; /* thread exit time */
|
||||
int exit_code; /* thread exit code */
|
||||
int priority; /* thread priority level */
|
||||
int last; /* last thread in process */
|
||||
@END
|
||||
|
||||
|
||||
+/* Retrieve information about thread times */
|
||||
+@REQ(get_thread_times)
|
||||
+ obj_handle_t handle; /* thread handle */
|
||||
+@REPLY
|
||||
+ timeout_t creation_time; /* thread creation time */
|
||||
+ timeout_t exit_time; /* thread exit time */
|
||||
+@END
|
||||
+
|
||||
+
|
||||
/* Set a thread information */
|
||||
@REQ(set_thread_info)
|
||||
obj_handle_t handle; /* thread handle */
|
||||
diff --git a/server/thread.c b/server/thread.c
|
||||
index 8471651..b8c73c6 100644
|
||||
--- a/server/thread.c
|
||||
+++ b/server/thread.c
|
||||
@@ -1374,9 +1374,21 @@ DECL_HANDLER(get_thread_info)
|
||||
reply->exit_code = (thread->state == TERMINATED) ? thread->exit_code : STATUS_PENDING;
|
||||
reply->priority = thread->priority;
|
||||
reply->affinity = thread->affinity;
|
||||
+ reply->last = thread->process->running_threads == 1;
|
||||
+
|
||||
+ release_object( thread );
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+/* fetch information about thread times */
|
||||
+DECL_HANDLER(get_thread_times)
|
||||
+{
|
||||
+ struct thread *thread;
|
||||
+
|
||||
+ if ((thread = get_thread_from_handle( req->handle, THREAD_QUERY_INFORMATION )))
|
||||
+ {
|
||||
reply->creation_time = thread->creation_time;
|
||||
reply->exit_time = thread->exit_time;
|
||||
- reply->last = thread->process->running_threads == 1;
|
||||
|
||||
release_object( thread );
|
||||
}
|
||||
--
|
||||
2.4.5
|
||||
|
@ -0,0 +1,86 @@
|
||||
From 41252878d2e43bb874bcf32a81216f61f25bfca6 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Mon, 27 Jul 2015 06:12:39 +0200
|
||||
Subject: server: Store thread entry points in server.
|
||||
|
||||
For the main thread we store it in the init_process_done handler, for
|
||||
all other threads in the new_thread handler.
|
||||
---
|
||||
dlls/ntdll/thread.c | 1 +
|
||||
server/process.c | 1 +
|
||||
server/protocol.def | 1 +
|
||||
server/thread.c | 2 ++
|
||||
server/thread.h | 1 +
|
||||
5 files changed, 6 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
|
||||
index 2781827..ef4029a 100644
|
||||
--- a/dlls/ntdll/thread.c
|
||||
+++ b/dlls/ntdll/thread.c
|
||||
@@ -494,6 +494,7 @@ NTSTATUS WINAPI RtlCreateUserThread( HANDLE process, const SECURITY_DESCRIPTOR *
|
||||
|
||||
SERVER_START_REQ( new_thread )
|
||||
{
|
||||
+ req->entry = wine_server_client_ptr( start );
|
||||
req->access = THREAD_ALL_ACCESS;
|
||||
req->attributes = 0; /* FIXME */
|
||||
req->suspend = suspended;
|
||||
diff --git a/server/process.c b/server/process.c
|
||||
index 0bf7194..7252497 100644
|
||||
--- a/server/process.c
|
||||
+++ b/server/process.c
|
||||
@@ -1295,6 +1295,7 @@ DECL_HANDLER(init_process_done)
|
||||
|
||||
process->ldt_copy = req->ldt_copy;
|
||||
process->start_time = current_time;
|
||||
+ current->entry_point = req->entry;
|
||||
|
||||
generate_startup_debug_events( process, req->entry );
|
||||
set_process_startup_state( process, STARTUP_DONE );
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 3d7f7be..0e1756c 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -737,6 +737,7 @@ struct rawinput_device
|
||||
|
||||
/* Create a new thread from the context of the parent */
|
||||
@REQ(new_thread)
|
||||
+ client_ptr_t entry; /* entry point (in client address space) */
|
||||
unsigned int access; /* wanted access rights */
|
||||
unsigned int attributes; /* object attributes */
|
||||
int suspend; /* new thread should be suspended on creation */
|
||||
diff --git a/server/thread.c b/server/thread.c
|
||||
index b8c73c6..afcb2dc 100644
|
||||
--- a/server/thread.c
|
||||
+++ b/server/thread.c
|
||||
@@ -175,6 +175,7 @@ static inline void init_thread_structure( struct thread *thread )
|
||||
thread->context = NULL;
|
||||
thread->suspend_context = NULL;
|
||||
thread->teb = 0;
|
||||
+ thread->entry_point = 0;
|
||||
thread->debug_ctx = NULL;
|
||||
thread->debug_event = NULL;
|
||||
thread->debug_break = 0;
|
||||
@@ -1235,6 +1236,7 @@ DECL_HANDLER(new_thread)
|
||||
|
||||
if ((thread = create_thread( request_fd, current->process )))
|
||||
{
|
||||
+ thread->entry_point = req->entry;
|
||||
if (req->suspend) thread->suspend++;
|
||||
reply->tid = get_thread_id( thread );
|
||||
if ((reply->handle = alloc_handle( current->process, thread, req->access, req->attributes )))
|
||||
diff --git a/server/thread.h b/server/thread.h
|
||||
index 996d95b..2821991 100644
|
||||
--- a/server/thread.h
|
||||
+++ b/server/thread.h
|
||||
@@ -79,6 +79,7 @@ struct thread
|
||||
context_t *context; /* current context if in an exception handler */
|
||||
context_t *suspend_context; /* current context if suspended */
|
||||
client_ptr_t teb; /* TEB address (in client address space) */
|
||||
+ client_ptr_t entry_point; /* entry point (in client address space) */
|
||||
affinity_t affinity; /* affinity mask */
|
||||
int priority; /* priority level */
|
||||
int suspend; /* suspend count */
|
||||
--
|
||||
2.4.5
|
||||
|
@ -0,0 +1,82 @@
|
||||
From 96ae4f590b53e5c418adc1b6b503aa85e7399f8d Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Mon, 27 Jul 2015 06:12:48 +0200
|
||||
Subject: ntdll: Implement ThreadQuerySetWin32StartAddress info class in
|
||||
NtSetInformationThread.
|
||||
|
||||
This implements the pre-Vista version, where the entry point can be changed.
|
||||
---
|
||||
dlls/ntdll/thread.c | 16 ++++++++++++++--
|
||||
server/protocol.def | 8 +++++---
|
||||
server/thread.c | 2 ++
|
||||
3 files changed, 21 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
|
||||
index ef4029a..74d512a 100644
|
||||
--- a/dlls/ntdll/thread.c
|
||||
+++ b/dlls/ntdll/thread.c
|
||||
@@ -1204,14 +1204,26 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class,
|
||||
case ThreadHideFromDebugger:
|
||||
/* pretend the call succeeded to satisfy some code protectors */
|
||||
return STATUS_SUCCESS;
|
||||
-
|
||||
+ case ThreadQuerySetWin32StartAddress:
|
||||
+ {
|
||||
+ const PRTL_THREAD_START_ROUTINE *entry = data;
|
||||
+ if (length != sizeof(PRTL_THREAD_START_ROUTINE)) return STATUS_INVALID_PARAMETER;
|
||||
+ SERVER_START_REQ( set_thread_info )
|
||||
+ {
|
||||
+ req->handle = wine_server_obj_handle( handle );
|
||||
+ req->mask = SET_THREAD_INFO_ENTRYPOINT;
|
||||
+ req->entry_point = wine_server_client_ptr( *entry );
|
||||
+ status = wine_server_call( req );
|
||||
+ }
|
||||
+ SERVER_END_REQ;
|
||||
+ }
|
||||
+ return status;
|
||||
case ThreadBasicInformation:
|
||||
case ThreadTimes:
|
||||
case ThreadPriority:
|
||||
case ThreadDescriptorTableEntry:
|
||||
case ThreadEnableAlignmentFaultFixup:
|
||||
case ThreadEventPair_Reusable:
|
||||
- case ThreadQuerySetWin32StartAddress:
|
||||
case ThreadPerformanceCount:
|
||||
case ThreadAmILastThread:
|
||||
case ThreadIdealProcessor:
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 0e1756c..a1ab2613 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -865,10 +865,12 @@ struct rawinput_device
|
||||
int priority; /* priority class */
|
||||
affinity_t affinity; /* affinity mask */
|
||||
obj_handle_t token; /* impersonation token */
|
||||
+ client_ptr_t entry_point; /* thread entry point */
|
||||
@END
|
||||
-#define SET_THREAD_INFO_PRIORITY 0x01
|
||||
-#define SET_THREAD_INFO_AFFINITY 0x02
|
||||
-#define SET_THREAD_INFO_TOKEN 0x04
|
||||
+#define SET_THREAD_INFO_PRIORITY 0x01
|
||||
+#define SET_THREAD_INFO_AFFINITY 0x02
|
||||
+#define SET_THREAD_INFO_TOKEN 0x04
|
||||
+#define SET_THREAD_INFO_ENTRYPOINT 0x08
|
||||
|
||||
|
||||
/* Retrieve information about a module */
|
||||
diff --git a/server/thread.c b/server/thread.c
|
||||
index afcb2dc..0311966 100644
|
||||
--- a/server/thread.c
|
||||
+++ b/server/thread.c
|
||||
@@ -498,6 +498,8 @@ static void set_thread_info( struct thread *thread,
|
||||
}
|
||||
if (req->mask & SET_THREAD_INFO_TOKEN)
|
||||
security_set_thread_token( thread, req->token );
|
||||
+ if (req->mask & SET_THREAD_INFO_ENTRYPOINT)
|
||||
+ thread->entry_point = req->entry_point;
|
||||
}
|
||||
|
||||
/* stop a thread (at the Unix level) */
|
||||
--
|
||||
2.4.5
|
||||
|
@ -0,0 +1,73 @@
|
||||
From 3e3090001558c228e96a3ff64166294398b40380 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Mon, 27 Jul 2015 06:13:00 +0200
|
||||
Subject: ntdll: Implement ThreadQuerySetWin32StartAddress info class in
|
||||
NtQueryInformationThread.
|
||||
|
||||
---
|
||||
dlls/ntdll/thread.c | 18 +++++++++++++++++-
|
||||
server/protocol.def | 1 +
|
||||
server/thread.c | 1 +
|
||||
3 files changed, 19 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
|
||||
index 74d512a..95b7add 100644
|
||||
--- a/dlls/ntdll/thread.c
|
||||
+++ b/dlls/ntdll/thread.c
|
||||
@@ -1087,12 +1087,28 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
|
||||
SERVER_END_REQ;
|
||||
return status;
|
||||
}
|
||||
+ case ThreadQuerySetWin32StartAddress:
|
||||
+ {
|
||||
+ SERVER_START_REQ( get_thread_info )
|
||||
+ {
|
||||
+ req->handle = wine_server_obj_handle( handle );
|
||||
+ req->tid_in = 0;
|
||||
+ status = wine_server_call( req );
|
||||
+ if (status == STATUS_SUCCESS)
|
||||
+ {
|
||||
+ PRTL_THREAD_START_ROUTINE entry = wine_server_get_ptr( reply->entry_point );
|
||||
+ if (data) memcpy( data, &entry, min( length, sizeof(entry) ) );
|
||||
+ if (ret_len) *ret_len = min( length, sizeof(entry) );
|
||||
+ }
|
||||
+ }
|
||||
+ SERVER_END_REQ;
|
||||
+ return status;
|
||||
+ }
|
||||
case ThreadPriority:
|
||||
case ThreadBasePriority:
|
||||
case ThreadImpersonationToken:
|
||||
case ThreadEnableAlignmentFaultFixup:
|
||||
case ThreadEventPair_Reusable:
|
||||
- case ThreadQuerySetWin32StartAddress:
|
||||
case ThreadZeroTlsCell:
|
||||
case ThreadPerformanceCount:
|
||||
case ThreadIdealProcessor:
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index a1ab2613..15735e0 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -842,6 +842,7 @@ struct rawinput_device
|
||||
process_id_t pid; /* server process id */
|
||||
thread_id_t tid; /* server thread id */
|
||||
client_ptr_t teb; /* thread teb pointer */
|
||||
+ client_ptr_t entry_point; /* thread entry point */
|
||||
affinity_t affinity; /* thread affinity mask */
|
||||
int exit_code; /* thread exit code */
|
||||
int priority; /* thread priority level */
|
||||
diff --git a/server/thread.c b/server/thread.c
|
||||
index 0311966..902848e 100644
|
||||
--- a/server/thread.c
|
||||
+++ b/server/thread.c
|
||||
@@ -1375,6 +1375,7 @@ DECL_HANDLER(get_thread_info)
|
||||
reply->pid = get_process_id( thread->process );
|
||||
reply->tid = get_thread_id( thread );
|
||||
reply->teb = thread->teb;
|
||||
+ reply->entry_point = thread->entry_point;
|
||||
reply->exit_code = (thread->state == TERMINATED) ? thread->exit_code : STATUS_PENDING;
|
||||
reply->priority = thread->priority;
|
||||
reply->affinity = thread->affinity;
|
||||
--
|
||||
2.4.5
|
||||
|
@ -0,0 +1,90 @@
|
||||
From 128e2e5ac1d05988afcde9c04be5ccb8e3b93808 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Mon, 27 Jul 2015 06:13:09 +0200
|
||||
Subject: ntdll/tests: Add tests for ThreadQuerySetWin32StartAddress info
|
||||
class.
|
||||
|
||||
---
|
||||
dlls/ntdll/tests/info.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 60 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c
|
||||
index 5fff490..83e8757 100644
|
||||
--- a/dlls/ntdll/tests/info.c
|
||||
+++ b/dlls/ntdll/tests/info.c
|
||||
@@ -1695,6 +1695,61 @@ static void test_NtGetCurrentProcessorNumber(void)
|
||||
ok(status == STATUS_SUCCESS, "got 0x%x (expected STATUS_SUCCESS)\n", status);
|
||||
}
|
||||
|
||||
+static DWORD WINAPI start_address_thread(void *arg)
|
||||
+{
|
||||
+ PRTL_THREAD_START_ROUTINE entry;
|
||||
+ NTSTATUS status;
|
||||
+ DWORD ret;
|
||||
+
|
||||
+ entry = NULL;
|
||||
+ ret = 0xdeadbeef;
|
||||
+ status = pNtQueryInformationThread(GetCurrentThread(), ThreadQuerySetWin32StartAddress,
|
||||
+ &entry, sizeof(entry), &ret);
|
||||
+ ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status);
|
||||
+ ok(ret == sizeof(entry), "NtQueryInformationThread returned %u bytes\n", ret);
|
||||
+ ok(entry == (void *)start_address_thread, "expected %p, got %p\n", start_address_thread, entry);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void test_thread_start_address(void)
|
||||
+{
|
||||
+ PRTL_THREAD_START_ROUTINE entry;
|
||||
+ NTSTATUS status;
|
||||
+ HANDLE thread;
|
||||
+ DWORD ret;
|
||||
+
|
||||
+ entry = NULL;
|
||||
+ ret = 0xdeadbeef;
|
||||
+ status = pNtQueryInformationThread(GetCurrentThread(), ThreadQuerySetWin32StartAddress,
|
||||
+ &entry, sizeof(entry), &ret);
|
||||
+ ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status);
|
||||
+ ok(ret == sizeof(entry), "NtQueryInformationThread returned %u bytes\n", ret);
|
||||
+ ok(entry != NULL, "expected non-NULL entry point\n");
|
||||
+
|
||||
+ entry = (void *)0xdeadbeef;
|
||||
+ status = pNtSetInformationThread(GetCurrentThread(), ThreadQuerySetWin32StartAddress,
|
||||
+ &entry, sizeof(entry));
|
||||
+ ok(status == STATUS_SUCCESS || status == STATUS_INVALID_PARAMETER, /* >= Vista */
|
||||
+ "expected STATUS_SUCCESS or STATUS_INVALID_PARAMETER, got %08x\n", status);
|
||||
+
|
||||
+ if (status == STATUS_SUCCESS)
|
||||
+ {
|
||||
+ entry = NULL;
|
||||
+ ret = 0xdeadbeef;
|
||||
+ status = pNtQueryInformationThread(GetCurrentThread(), ThreadQuerySetWin32StartAddress,
|
||||
+ &entry, sizeof(entry), &ret);
|
||||
+ ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08x\n", status);
|
||||
+ ok(ret == sizeof(entry), "NtQueryInformationThread returned %u bytes\n", ret);
|
||||
+ ok(entry == (void *)0xdeadbeef, "expected 0xdeadbeef, got %p\n", entry);
|
||||
+ }
|
||||
+
|
||||
+ thread = CreateThread(NULL, 0, start_address_thread, NULL, 0, NULL);
|
||||
+ ok(thread != INVALID_HANDLE_VALUE, "CreateThread failed with %d\n", GetLastError());
|
||||
+ ret = WaitForSingleObject(thread, 1000);
|
||||
+ ok(ret == WAIT_OBJECT_0, "expected WAIT_OBJECT_0, got %u\n", ret);
|
||||
+ CloseHandle(thread);
|
||||
+}
|
||||
+
|
||||
START_TEST(info)
|
||||
{
|
||||
char **argv;
|
||||
@@ -1820,5 +1875,10 @@ START_TEST(info)
|
||||
|
||||
trace("Starting test_affinity()\n");
|
||||
test_affinity();
|
||||
+
|
||||
+ trace("Starting test_NtGetCurrentProcessorNumber()\n");
|
||||
test_NtGetCurrentProcessorNumber();
|
||||
+
|
||||
+ trace("Starting test_thread_start_address()\n");
|
||||
+ test_thread_start_address();
|
||||
}
|
||||
--
|
||||
2.4.5
|
||||
|
1
patches/ntdll-ThreadQuerySetWin32StartAddress/definition
Normal file
1
patches/ntdll-ThreadQuerySetWin32StartAddress/definition
Normal file
@ -0,0 +1 @@
|
||||
Fixes: [8277] Add support for ThreadQuerySetWin32StartAddress info class
|
@ -1,17 +1,17 @@
|
||||
From c23803e1776618f98732081302d225f0e5b54cb3 Mon Sep 17 00:00:00 2001
|
||||
From 13b20600cb2924b63ecf7c0b37db45fd7c26a8ce Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Fri, 7 Nov 2014 03:26:18 +0100
|
||||
Subject: ntdll: Return correct values in GetThreadTimes() for all threads.
|
||||
|
||||
Based on a patch by Ray Hinchliffe <ray@pobox.co.uk>.
|
||||
---
|
||||
dlls/ntdll/thread.c | 86 ++++++++++++++++++++++++++++++++++++++++-------------
|
||||
server/protocol.def | 11 +++++++
|
||||
server/thread.c | 16 ++++++++++
|
||||
3 files changed, 93 insertions(+), 20 deletions(-)
|
||||
dlls/ntdll/thread.c | 82 ++++++++++++++++++++++++++++++++++++++++++-----------
|
||||
server/protocol.def | 2 ++
|
||||
server/thread.c | 2 ++
|
||||
3 files changed, 69 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
|
||||
index 3696c8e..eab1a53 100644
|
||||
index 95b7add..a3b1cb0 100644
|
||||
--- a/dlls/ntdll/thread.c
|
||||
+++ b/dlls/ntdll/thread.c
|
||||
@@ -23,6 +23,8 @@
|
||||
@ -23,22 +23,18 @@ index 3696c8e..eab1a53 100644
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_MMAN_H
|
||||
#include <sys/mman.h>
|
||||
@@ -962,47 +964,91 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
|
||||
@@ -963,7 +965,10 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
|
||||
case ThreadTimes:
|
||||
{
|
||||
KERNEL_USER_TIMES kusrt;
|
||||
- /* We need to do a server call to get the creation time or exit time */
|
||||
+ int unix_pid, unix_tid;
|
||||
+
|
||||
|
||||
+ /* We need to do a server call to get the creation time, exit time, PID and TID */
|
||||
/* This works on any thread */
|
||||
- SERVER_START_REQ( get_thread_info )
|
||||
+ SERVER_START_REQ( get_thread_times )
|
||||
+ /* This works on any thread */
|
||||
SERVER_START_REQ( get_thread_times )
|
||||
{
|
||||
req->handle = wine_server_obj_handle( handle );
|
||||
- req->tid_in = 0;
|
||||
status = wine_server_call( req );
|
||||
if (status == STATUS_SUCCESS)
|
||||
@@ -972,36 +977,79 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
|
||||
{
|
||||
kusrt.CreateTime.QuadPart = reply->creation_time;
|
||||
kusrt.ExitTime.QuadPart = reply->exit_time;
|
||||
@ -136,54 +132,31 @@ index 3696c8e..eab1a53 100644
|
||||
if (ret_len) *ret_len = min( length, sizeof(kusrt) );
|
||||
}
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 2cd8272..6fd0e45 100644
|
||||
index 15735e0..967bc81 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -790,6 +790,17 @@ struct rawinput_device
|
||||
#define SET_PROCESS_INFO_AFFINITY 0x02
|
||||
|
||||
|
||||
+/* Retrieve information about thread times */
|
||||
+@REQ(get_thread_times)
|
||||
+ obj_handle_t handle; /* thread handle */
|
||||
+@REPLY
|
||||
+ timeout_t creation_time; /* thread creation time */
|
||||
+ timeout_t exit_time; /* thread exit time */
|
||||
@@ -856,6 +856,8 @@ struct rawinput_device
|
||||
@REPLY
|
||||
timeout_t creation_time; /* thread creation time */
|
||||
timeout_t exit_time; /* thread exit time */
|
||||
+ int unix_pid; /* thread native pid */
|
||||
+ int unix_tid; /* thread native pid */
|
||||
+@END
|
||||
+
|
||||
+
|
||||
/* Retrieve information about a thread */
|
||||
@REQ(get_thread_info)
|
||||
obj_handle_t handle; /* thread handle */
|
||||
@END
|
||||
|
||||
|
||||
diff --git a/server/thread.c b/server/thread.c
|
||||
index 906b79d..8877e40 100644
|
||||
index 902848e..f2b0853 100644
|
||||
--- a/server/thread.c
|
||||
+++ b/server/thread.c
|
||||
@@ -1354,6 +1354,22 @@ DECL_HANDLER(open_thread)
|
||||
}
|
||||
}
|
||||
|
||||
+/* fetch information about thread times */
|
||||
+DECL_HANDLER(get_thread_times)
|
||||
+{
|
||||
+ struct thread *thread;
|
||||
+
|
||||
+ if ((thread = get_thread_from_handle( req->handle, THREAD_QUERY_INFORMATION )))
|
||||
+ {
|
||||
+ reply->creation_time = thread->creation_time;
|
||||
+ reply->exit_time = thread->exit_time;
|
||||
@@ -1394,6 +1394,8 @@ DECL_HANDLER(get_thread_times)
|
||||
{
|
||||
reply->creation_time = thread->creation_time;
|
||||
reply->exit_time = thread->exit_time;
|
||||
+ reply->unix_pid = thread->unix_pid;
|
||||
+ reply->unix_tid = thread->unix_tid;
|
||||
+
|
||||
+ release_object( thread );
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
/* fetch information about a thread */
|
||||
DECL_HANDLER(get_thread_info)
|
||||
{
|
||||
|
||||
release_object( thread );
|
||||
}
|
||||
--
|
||||
2.3.2
|
||||
2.4.5
|
||||
|
||||
|
@ -1 +1,2 @@
|
||||
Fixes: [20230] Return correct values for GetThreadTimes function
|
||||
Depends: ntdll-ThreadQuerySetWin32StartAddress
|
||||
|
@ -170,6 +170,7 @@ patch_enable_all ()
|
||||
enable_ntdll_Pipe_SpecialCharacters="$1"
|
||||
enable_ntdll_RtlIpStringToAddress="$1"
|
||||
enable_ntdll_Security_Cookie="$1"
|
||||
enable_ntdll_ThreadQuerySetWin32StartAddress="$1"
|
||||
enable_ntdll_ThreadTime="$1"
|
||||
enable_ntdll_Threading="$1"
|
||||
enable_ntdll_User_Shared_Data="$1"
|
||||
@ -580,6 +581,9 @@ patch_enable ()
|
||||
ntdll-Security_Cookie)
|
||||
enable_ntdll_Security_Cookie="$2"
|
||||
;;
|
||||
ntdll-ThreadQuerySetWin32StartAddress)
|
||||
enable_ntdll_ThreadQuerySetWin32StartAddress="$2"
|
||||
;;
|
||||
ntdll-ThreadTime)
|
||||
enable_ntdll_ThreadTime="$2"
|
||||
;;
|
||||
@ -1712,6 +1716,13 @@ if test "$enable_ntdll_WriteWatches" -eq 1; then
|
||||
enable_ws2_32_WriteWatches=1
|
||||
fi
|
||||
|
||||
if test "$enable_ntdll_ThreadTime" -eq 1; then
|
||||
if test "$enable_ntdll_ThreadQuerySetWin32StartAddress" -gt 1; then
|
||||
abort "Patchset ntdll-ThreadQuerySetWin32StartAddress disabled, but ntdll-ThreadTime depends on that."
|
||||
fi
|
||||
enable_ntdll_ThreadQuerySetWin32StartAddress=1
|
||||
fi
|
||||
|
||||
if test "$enable_ntdll_Junction_Points" -eq 1; then
|
||||
if test "$enable_ntdll_Fix_Free" -gt 1; then
|
||||
abort "Patchset ntdll-Fix_Free disabled, but ntdll-Junction_Points depends on that."
|
||||
@ -3603,6 +3614,29 @@ if test "$enable_ntdll_Security_Cookie" -eq 1; then
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset ntdll-ThreadQuerySetWin32StartAddress
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
# | * [#8277] Add support for ThreadQuerySetWin32StartAddress info class
|
||||
# |
|
||||
# | Modified files:
|
||||
# | * dlls/ntdll/tests/info.c, dlls/ntdll/thread.c, server/process.c, server/protocol.def, server/thread.c, server/thread.h
|
||||
# |
|
||||
if test "$enable_ntdll_ThreadQuerySetWin32StartAddress" -eq 1; then
|
||||
patch_apply ntdll-ThreadQuerySetWin32StartAddress/0001-server-Use-a-separate-wineserver-call-to-fetch-threa.patch
|
||||
patch_apply ntdll-ThreadQuerySetWin32StartAddress/0002-server-Store-thread-entry-points-in-server.patch
|
||||
patch_apply ntdll-ThreadQuerySetWin32StartAddress/0003-ntdll-Implement-ThreadQuerySetWin32StartAddress-info.patch
|
||||
patch_apply ntdll-ThreadQuerySetWin32StartAddress/0004-ntdll-Implement-ThreadQuerySetWin32StartAddress-info.patch
|
||||
patch_apply ntdll-ThreadQuerySetWin32StartAddress/0005-ntdll-tests-Add-tests-for-ThreadQuerySetWin32StartAd.patch
|
||||
(
|
||||
echo '+ { "Sebastian Lackner", "server: Use a separate wineserver call to fetch thread times.", 1 },';
|
||||
echo '+ { "Sebastian Lackner", "server: Store thread entry points in server.", 1 },';
|
||||
echo '+ { "Sebastian Lackner", "ntdll: Implement ThreadQuerySetWin32StartAddress info class in NtSetInformationThread.", 1 },';
|
||||
echo '+ { "Sebastian Lackner", "ntdll: Implement ThreadQuerySetWin32StartAddress info class in NtQueryInformationThread.", 1 },';
|
||||
echo '+ { "Sebastian Lackner", "ntdll/tests: Add tests for ThreadQuerySetWin32StartAddress info class.", 1 },';
|
||||
) >> "$patchlist"
|
||||
fi
|
||||
|
||||
# Patchset ntdll-ThreadTime
|
||||
# |
|
||||
# | This patchset fixes the following Wine bugs:
|
||||
|
Loading…
x
Reference in New Issue
Block a user