server: Support thread object type.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2019-02-22 13:14:12 +01:00 committed by Alexandre Julliard
parent 2bb4d24589
commit eea7702eb6
2 changed files with 12 additions and 1 deletions

View File

@ -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)

View File

@ -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;