Jacek Caban : server: Support thread object type.
Alexandre Julliard
julliard at winehq.org
Fri Feb 22 15:22:11 CST 2019
Module: wine
Branch: master
Commit: eea7702eb6f9236861fc7ed997c34f59b73d061e
URL: https://source.winehq.org/git/wine.git/?a=commit;h=eea7702eb6f9236861fc7ed997c34f59b73d061e
Author: Jacek Caban <jacek at codeweavers.com>
Date: Fri Feb 22 13:14:12 2019 +0100
server: Support thread object type.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/ntdll/tests/om.c | 3 +++
server/thread.c | 10 +++++++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c
index bc1c6a4..516304e 100644
--- a/dlls/ntdll/tests/om.c
+++ b/dlls/ntdll/tests/om.c
@@ -1563,6 +1563,9 @@ static void test_query_object(void)
test_object_type( GetCurrentProcess(), "Process" );
test_no_file_info( GetCurrentProcess() );
+
+ test_object_type( GetCurrentThread(), "Thread" );
+ test_no_file_info( GetCurrentThread() );
}
static void test_type_mismatch(void)
diff --git a/server/thread.c b/server/thread.c
index 7162fc3..4c3d9c3 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -128,6 +128,7 @@ static const struct object_ops thread_apc_ops =
/* thread operations */
static void dump_thread( struct object *obj, int verbose );
+static struct object_type *thread_get_type( struct object *obj );
static int thread_signaled( struct object *obj, struct wait_queue_entry *entry );
static unsigned int thread_map_access( struct object *obj, unsigned int access );
static void thread_poll_event( struct fd *fd, int event );
@@ -137,7 +138,7 @@ static const struct object_ops thread_ops =
{
sizeof(struct thread), /* size */
dump_thread, /* dump */
- no_get_type, /* get_type */
+ thread_get_type, /* get_type */
add_queue, /* add_queue */
remove_queue, /* remove_queue */
thread_signaled, /* signaled */
@@ -361,6 +362,13 @@ static void dump_thread( struct object *obj, int verbose )
thread->id, thread->unix_pid, thread->unix_tid, thread->state );
}
+static struct object_type *thread_get_type( struct object *obj )
+{
+ static const WCHAR name[] = {'T','h','r','e','a','d'};
+ static const struct unicode_str str = { name, sizeof(name) };
+ return get_object_type( &str );
+}
+
static int thread_signaled( struct object *obj, struct wait_queue_entry *entry )
{
struct thread *mythread = (struct thread *)obj;
More information about the wine-cvs
mailing list