Commit 8cb932ea authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

ntdll: Implemented AmILastThread information class for NtQueryInformationThread.

parent 6a0568a1
......@@ -1167,6 +1167,23 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
#endif
return status;
}
case ThreadAmILastThread:
{
SERVER_START_REQ(get_thread_info)
{
req->handle = handle;
req->tid_in = 0;
status = wine_server_call( req );
if (status == STATUS_SUCCESS)
{
BOOLEAN last = reply->last;
if (data) memcpy( data, &last, min( length, sizeof(last) ));
if (ret_len) *ret_len = min( length, sizeof(last) );
}
}
SERVER_END_REQ;
return status;
}
case ThreadPriority:
case ThreadBasePriority:
case ThreadAffinityMask:
......@@ -1176,7 +1193,6 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
case ThreadQuerySetWin32StartAddress:
case ThreadZeroTlsCell:
case ThreadPerformanceCount:
case ThreadAmILastThread:
case ThreadIdealProcessor:
case ThreadPriorityBoost:
case ThreadSetTlsArrayAddress:
......
......@@ -388,6 +388,7 @@ struct get_thread_info_reply
int affinity;
abs_time_t creation_time;
abs_time_t exit_time;
int last;
};
......@@ -4405,6 +4406,6 @@ union generic_reply
struct query_symlink_reply query_symlink_reply;
};
#define SERVER_PROTOCOL_VERSION 246
#define SERVER_PROTOCOL_VERSION 247
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
......@@ -347,6 +347,7 @@ struct token_groups
int affinity; /* thread affinity mask */
abs_time_t creation_time; /* thread creation time */
abs_time_t exit_time; /* thread exit time */
int last; /* last thread in process */
@END
......
......@@ -950,8 +950,9 @@ DECL_HANDLER(get_thread_info)
reply->affinity = thread->affinity;
reply->creation_time.sec = thread->creation_time.tv_sec;
reply->creation_time.usec = thread->creation_time.tv_usec;
reply->exit_time.sec = thread->exit_time.tv_sec;
reply->exit_time.usec = thread->exit_time.tv_usec;
reply->exit_time.sec = thread->exit_time.tv_sec;
reply->exit_time.usec = thread->exit_time.tv_usec;
reply->last = thread->process->running_threads == 1;
release_object( thread );
}
......
......@@ -772,6 +772,8 @@ static void dump_get_thread_info_reply( const struct get_thread_info_reply *req
fprintf( stderr, "," );
fprintf( stderr, " exit_time=" );
dump_abs_time( &req->exit_time );
fprintf( stderr, "," );
fprintf( stderr, " last=%d", req->last );
}
static void dump_set_thread_info_request( const struct set_thread_info_request *req )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment