mirror of
https://github.com/wine-mirror/wine
synced 2024-07-05 17:28:47 +00:00
server: Allow creating thread kernel objects.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
80d53026bf
commit
4c0e81728f
|
@ -822,7 +822,6 @@ static void test_ob_reference(const WCHAR *test_path)
|
||||||
|
|
||||||
status = ObReferenceObjectByHandle(thread_handle, SYNCHRONIZE, *pPsThreadType, KernelMode, &obj2, NULL);
|
status = ObReferenceObjectByHandle(thread_handle, SYNCHRONIZE, *pPsThreadType, KernelMode, &obj2, NULL);
|
||||||
ok(!status, "ObReferenceObjectByHandle failed: %#x\n", status);
|
ok(!status, "ObReferenceObjectByHandle failed: %#x\n", status);
|
||||||
todo_wine
|
|
||||||
ok(obj1 == obj2, "obj1 != obj2\n");
|
ok(obj1 == obj2, "obj1 != obj2\n");
|
||||||
|
|
||||||
ObDereferenceObject(obj1);
|
ObDereferenceObject(obj1);
|
||||||
|
|
|
@ -133,6 +133,7 @@ static struct object_type *thread_get_type( struct object *obj );
|
||||||
static int thread_signaled( struct object *obj, struct wait_queue_entry *entry );
|
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 unsigned int thread_map_access( struct object *obj, unsigned int access );
|
||||||
static void thread_poll_event( struct fd *fd, int event );
|
static void thread_poll_event( struct fd *fd, int event );
|
||||||
|
static struct list *thread_get_kernel_obj_list( struct object *obj );
|
||||||
static void destroy_thread( struct object *obj );
|
static void destroy_thread( struct object *obj );
|
||||||
|
|
||||||
static const struct object_ops thread_ops =
|
static const struct object_ops thread_ops =
|
||||||
|
@ -153,7 +154,7 @@ static const struct object_ops thread_ops =
|
||||||
no_link_name, /* link_name */
|
no_link_name, /* link_name */
|
||||||
NULL, /* unlink_name */
|
NULL, /* unlink_name */
|
||||||
no_open_file, /* open_file */
|
no_open_file, /* open_file */
|
||||||
no_kernel_obj_list, /* get_kernel_obj_list */
|
thread_get_kernel_obj_list, /* get_kernel_obj_list */
|
||||||
no_close_handle, /* close_handle */
|
no_close_handle, /* close_handle */
|
||||||
destroy_thread /* destroy */
|
destroy_thread /* destroy */
|
||||||
};
|
};
|
||||||
|
@ -209,6 +210,7 @@ static inline void init_thread_structure( struct thread *thread )
|
||||||
list_init( &thread->mutex_list );
|
list_init( &thread->mutex_list );
|
||||||
list_init( &thread->system_apc );
|
list_init( &thread->system_apc );
|
||||||
list_init( &thread->user_apc );
|
list_init( &thread->user_apc );
|
||||||
|
list_init( &thread->kernel_object );
|
||||||
|
|
||||||
for (i = 0; i < MAX_INFLIGHT_FDS; i++)
|
for (i = 0; i < MAX_INFLIGHT_FDS; i++)
|
||||||
thread->inflight[i].server = thread->inflight[i].client = -1;
|
thread->inflight[i].server = thread->inflight[i].client = -1;
|
||||||
|
@ -304,6 +306,12 @@ static void thread_poll_event( struct fd *fd, int event )
|
||||||
release_object( thread );
|
release_object( thread );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct list *thread_get_kernel_obj_list( struct object *obj )
|
||||||
|
{
|
||||||
|
struct thread *thread = (struct thread *)obj;
|
||||||
|
return &thread->kernel_object;
|
||||||
|
}
|
||||||
|
|
||||||
/* cleanup everything that is no longer needed by a dead thread */
|
/* cleanup everything that is no longer needed by a dead thread */
|
||||||
/* used by destroy_thread and kill_thread */
|
/* used by destroy_thread and kill_thread */
|
||||||
static void cleanup_thread( struct thread *thread )
|
static void cleanup_thread( struct thread *thread )
|
||||||
|
|
|
@ -89,6 +89,7 @@ struct thread
|
||||||
timeout_t creation_time; /* Thread creation time */
|
timeout_t creation_time; /* Thread creation time */
|
||||||
timeout_t exit_time; /* Thread exit time */
|
timeout_t exit_time; /* Thread exit time */
|
||||||
struct token *token; /* security token associated with this thread */
|
struct token *token; /* security token associated with this thread */
|
||||||
|
struct list kernel_object; /* list of kernel object pointers */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct thread_snapshot
|
struct thread_snapshot
|
||||||
|
|
Loading…
Reference in New Issue
Block a user