Implemented the ThreadBasicInformation case for
NtQueryInformationThread.
This commit is contained in:
parent
56aaea2f43
commit
4f196ead13
@ -129,15 +129,16 @@ DWORD WINAPI ResumeThread( HANDLE hthread ) /* [in] Identifies thread to restart
|
|||||||
INT WINAPI GetThreadPriority(
|
INT WINAPI GetThreadPriority(
|
||||||
HANDLE hthread) /* [in] Handle to thread */
|
HANDLE hthread) /* [in] Handle to thread */
|
||||||
{
|
{
|
||||||
INT ret = THREAD_PRIORITY_ERROR_RETURN;
|
THREAD_BASIC_INFORMATION info;
|
||||||
SERVER_START_REQ( get_thread_info )
|
NTSTATUS status = NtQueryInformationThread( hthread, ThreadBasicInformation,
|
||||||
|
&info, sizeof(info), NULL );
|
||||||
|
|
||||||
|
if (status)
|
||||||
{
|
{
|
||||||
req->handle = hthread;
|
SetLastError( RtlNtStatusToDosError(status) );
|
||||||
req->tid_in = 0;
|
return THREAD_PRIORITY_ERROR_RETURN;
|
||||||
if (!wine_server_call_err( req )) ret = reply->priority;
|
|
||||||
}
|
}
|
||||||
SERVER_END_REQ;
|
return info.Priority;
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -163,24 +163,6 @@ NTSTATUS WINAPI NtSetInformationProcess(
|
|||||||
* Thread
|
* Thread
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
* NtQueryInformationThread [NTDLL.@]
|
|
||||||
* ZwQueryInformationThread [NTDLL.@]
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
NTSTATUS WINAPI NtQueryInformationThread(
|
|
||||||
IN HANDLE ThreadHandle,
|
|
||||||
IN THREADINFOCLASS ThreadInformationClass,
|
|
||||||
OUT PVOID ThreadInformation,
|
|
||||||
IN ULONG ThreadInformationLength,
|
|
||||||
OUT PULONG ReturnLength)
|
|
||||||
{
|
|
||||||
FIXME("(%p,0x%08x,%p,0x%08lx,%p),stub!\n",
|
|
||||||
ThreadHandle, ThreadInformationClass, ThreadInformation,
|
|
||||||
ThreadInformationLength, ReturnLength);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* NtSetInformationThread [NTDLL.@]
|
* NtSetInformationThread [NTDLL.@]
|
||||||
* ZwSetInformationThread [NTDLL.@]
|
* ZwSetInformationThread [NTDLL.@]
|
||||||
|
@ -154,14 +154,14 @@
|
|||||||
@ stub NtQueryAttributesFile
|
@ stub NtQueryAttributesFile
|
||||||
@ stdcall NtQueryDefaultLocale(long ptr)
|
@ stdcall NtQueryDefaultLocale(long ptr)
|
||||||
@ stdcall NtQueryDirectoryFile(long long ptr ptr ptr ptr long long long ptr long)
|
@ stdcall NtQueryDirectoryFile(long long ptr ptr ptr ptr long long long ptr long)
|
||||||
@ stdcall NtQueryDirectoryObject(long long long long long long long)
|
@ stdcall NtQueryDirectoryObject(long ptr long long long ptr ptr)
|
||||||
@ stub NtQueryEaFile
|
@ stub NtQueryEaFile
|
||||||
@ stdcall NtQueryEvent(long long ptr long ptr)
|
@ stdcall NtQueryEvent(long long ptr long ptr)
|
||||||
@ stdcall NtQueryInformationFile(long long long long long)
|
@ stdcall NtQueryInformationFile(long ptr ptr long long)
|
||||||
@ stub NtQueryInformationPort
|
@ stub NtQueryInformationPort
|
||||||
@ stdcall NtQueryInformationProcess(long long long long long)
|
@ stdcall NtQueryInformationProcess(long long ptr long ptr)
|
||||||
@ stdcall NtQueryInformationThread (long long long long long)
|
@ stdcall NtQueryInformationThread(long long ptr long ptr)
|
||||||
@ stdcall NtQueryInformationToken (long long long long long)
|
@ stdcall NtQueryInformationToken(long long ptr long ptr)
|
||||||
@ stub NtQueryIntervalProfile
|
@ stub NtQueryIntervalProfile
|
||||||
@ stub NtQueryIoCompletion
|
@ stub NtQueryIoCompletion
|
||||||
@ stdcall NtQueryKey (long long ptr long ptr)
|
@ stdcall NtQueryKey (long long ptr long ptr)
|
||||||
@ -686,14 +686,14 @@
|
|||||||
@ stub ZwQueryAttributesFile
|
@ stub ZwQueryAttributesFile
|
||||||
@ stdcall ZwQueryDefaultLocale(long ptr) NtQueryDefaultLocale
|
@ stdcall ZwQueryDefaultLocale(long ptr) NtQueryDefaultLocale
|
||||||
@ stdcall ZwQueryDirectoryFile(long long ptr ptr ptr ptr long long long ptr long)NtQueryDirectoryFile
|
@ stdcall ZwQueryDirectoryFile(long long ptr ptr ptr ptr long long long ptr long)NtQueryDirectoryFile
|
||||||
@ stdcall ZwQueryDirectoryObject(long long long long long long long) NtQueryDirectoryObject
|
@ stdcall ZwQueryDirectoryObject(long ptr long long long ptr ptr) NtQueryDirectoryObject
|
||||||
@ stub ZwQueryEaFile
|
@ stub ZwQueryEaFile
|
||||||
@ stdcall ZwQueryEvent(long long ptr long ptr) NtQueryEvent
|
@ stdcall ZwQueryEvent(long long ptr long ptr) NtQueryEvent
|
||||||
@ stdcall ZwQueryInformationFile(long long long long long) NtQueryInformationFile
|
@ stdcall ZwQueryInformationFile(long ptr ptr long long) NtQueryInformationFile
|
||||||
@ stub ZwQueryInformationPort
|
@ stub ZwQueryInformationPort
|
||||||
@ stdcall ZwQueryInformationProcess(long long long long long) NtQueryInformationProcess
|
@ stdcall ZwQueryInformationProcess(long long ptr long ptr) NtQueryInformationProcess
|
||||||
@ stdcall ZwQueryInformationThread(long long long long long) NtQueryInformationThread
|
@ stdcall ZwQueryInformationThread(long long ptr long ptr) NtQueryInformationThread
|
||||||
@ stdcall ZwQueryInformationToken(long long long long long) NtQueryInformationToken
|
@ stdcall ZwQueryInformationToken(long long ptr long ptr) NtQueryInformationToken
|
||||||
@ stub ZwQueryIntervalProfile
|
@ stub ZwQueryIntervalProfile
|
||||||
@ stub ZwQueryIoCompletion
|
@ stub ZwQueryIoCompletion
|
||||||
@ stdcall ZwQueryKey(long long ptr long ptr) NtQueryKey
|
@ stdcall ZwQueryKey(long long ptr long ptr) NtQueryKey
|
||||||
|
@ -20,6 +20,9 @@
|
|||||||
|
|
||||||
#include "winternl.h"
|
#include "winternl.h"
|
||||||
#include "wine/server.h"
|
#include "wine/server.h"
|
||||||
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
WINE_DEFAULT_DEBUG_CHANNEL(thread);
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
@ -169,3 +172,64 @@ NTSTATUS WINAPI NtGetContextThread( HANDLE handle, CONTEXT *context )
|
|||||||
SERVER_END_REQ;
|
SERVER_END_REQ;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/******************************************************************************
|
||||||
|
* NtQueryInformationThread (NTDLL.@)
|
||||||
|
* ZwQueryInformationThread (NTDLL.@)
|
||||||
|
*/
|
||||||
|
NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
|
||||||
|
void *data, ULONG length, ULONG *ret_len )
|
||||||
|
{
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
|
switch(class)
|
||||||
|
{
|
||||||
|
case ThreadBasicInformation:
|
||||||
|
{
|
||||||
|
THREAD_BASIC_INFORMATION info;
|
||||||
|
|
||||||
|
SERVER_START_REQ( get_thread_info )
|
||||||
|
{
|
||||||
|
req->handle = handle;
|
||||||
|
req->tid_in = 0;
|
||||||
|
if (!(status = wine_server_call( req )))
|
||||||
|
{
|
||||||
|
info.ExitStatus = reply->exit_code;
|
||||||
|
info.TebBaseAddress = reply->teb;
|
||||||
|
info.ClientId.UniqueProcess = (HANDLE)reply->pid;
|
||||||
|
info.ClientId.UniqueThread = (HANDLE)reply->tid;
|
||||||
|
info.AffinityMask = reply->affinity;
|
||||||
|
info.Priority = reply->priority;
|
||||||
|
info.BasePriority = reply->priority; /* FIXME */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SERVER_END_REQ;
|
||||||
|
if (status == STATUS_SUCCESS)
|
||||||
|
{
|
||||||
|
if (data) memcpy( data, &info, min( length, sizeof(info) ));
|
||||||
|
if (ret_len) *ret_len = min( length, sizeof(info) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return status;
|
||||||
|
case ThreadTimes:
|
||||||
|
case ThreadPriority:
|
||||||
|
case ThreadBasePriority:
|
||||||
|
case ThreadAffinityMask:
|
||||||
|
case ThreadImpersonationToken:
|
||||||
|
case ThreadDescriptorTableEntry:
|
||||||
|
case ThreadEnableAlignmentFaultFixup:
|
||||||
|
case ThreadEventPair_Reusable:
|
||||||
|
case ThreadQuerySetWin32StartAddress:
|
||||||
|
case ThreadZeroTlsCell:
|
||||||
|
case ThreadPerformanceCount:
|
||||||
|
case ThreadAmILastThread:
|
||||||
|
case ThreadIdealProcessor:
|
||||||
|
case ThreadPriorityBoost:
|
||||||
|
case ThreadSetTlsArrayAddress:
|
||||||
|
case ThreadIsIoPending:
|
||||||
|
default:
|
||||||
|
FIXME( "info class %d not supported yet\n", class );
|
||||||
|
return STATUS_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -398,10 +398,12 @@ struct get_thread_info_request
|
|||||||
struct get_thread_info_reply
|
struct get_thread_info_reply
|
||||||
{
|
{
|
||||||
struct reply_header __header;
|
struct reply_header __header;
|
||||||
|
process_id_t pid;
|
||||||
thread_id_t tid;
|
thread_id_t tid;
|
||||||
void* teb;
|
void* teb;
|
||||||
int exit_code;
|
int exit_code;
|
||||||
int priority;
|
int priority;
|
||||||
|
int affinity;
|
||||||
time_t creation_time;
|
time_t creation_time;
|
||||||
time_t exit_time;
|
time_t exit_time;
|
||||||
};
|
};
|
||||||
@ -3618,6 +3620,6 @@ union generic_reply
|
|||||||
struct set_clipboard_info_reply set_clipboard_info_reply;
|
struct set_clipboard_info_reply set_clipboard_info_reply;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define SERVER_PROTOCOL_VERSION 113
|
#define SERVER_PROTOCOL_VERSION 114
|
||||||
|
|
||||||
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
|
#endif /* __WINE_WINE_SERVER_PROTOCOL_H */
|
||||||
|
@ -389,6 +389,17 @@ typedef enum _THREADINFOCLASS {
|
|||||||
MaxThreadInfoClass
|
MaxThreadInfoClass
|
||||||
} THREADINFOCLASS;
|
} THREADINFOCLASS;
|
||||||
|
|
||||||
|
typedef struct _THREAD_BASIC_INFORMATION
|
||||||
|
{
|
||||||
|
NTSTATUS ExitStatus;
|
||||||
|
PVOID TebBaseAddress;
|
||||||
|
CLIENT_ID ClientId;
|
||||||
|
ULONG AffinityMask;
|
||||||
|
LONG Priority;
|
||||||
|
LONG BasePriority;
|
||||||
|
} THREAD_BASIC_INFORMATION, *PTHREAD_BASIC_INFORMATION;
|
||||||
|
|
||||||
|
|
||||||
typedef enum _WINSTATIONINFOCLASS {
|
typedef enum _WINSTATIONINFOCLASS {
|
||||||
WinStationInformation = 8
|
WinStationInformation = 8
|
||||||
} WINSTATIONINFOCLASS;
|
} WINSTATIONINFOCLASS;
|
||||||
|
@ -347,10 +347,12 @@ typedef struct
|
|||||||
obj_handle_t handle; /* thread handle */
|
obj_handle_t handle; /* thread handle */
|
||||||
thread_id_t tid_in; /* thread id (optional) */
|
thread_id_t tid_in; /* thread id (optional) */
|
||||||
@REPLY
|
@REPLY
|
||||||
|
process_id_t pid; /* server process id */
|
||||||
thread_id_t tid; /* server thread id */
|
thread_id_t tid; /* server thread id */
|
||||||
void* teb; /* thread teb pointer */
|
void* teb; /* thread teb pointer */
|
||||||
int exit_code; /* thread exit code */
|
int exit_code; /* thread exit code */
|
||||||
int priority; /* thread priority level */
|
int priority; /* thread priority level */
|
||||||
|
int affinity; /* thread affinity mask */
|
||||||
time_t creation_time; /* thread creation time */
|
time_t creation_time; /* thread creation time */
|
||||||
time_t exit_time; /* thread exit time */
|
time_t exit_time; /* thread exit time */
|
||||||
@END
|
@END
|
||||||
|
@ -904,10 +904,12 @@ DECL_HANDLER(get_thread_info)
|
|||||||
|
|
||||||
if (thread)
|
if (thread)
|
||||||
{
|
{
|
||||||
|
reply->pid = get_process_id( thread->process );
|
||||||
reply->tid = get_thread_id( thread );
|
reply->tid = get_thread_id( thread );
|
||||||
reply->teb = thread->teb;
|
reply->teb = thread->teb;
|
||||||
reply->exit_code = (thread->state == TERMINATED) ? thread->exit_code : STILL_ACTIVE;
|
reply->exit_code = (thread->state == TERMINATED) ? thread->exit_code : STILL_ACTIVE;
|
||||||
reply->priority = thread->priority;
|
reply->priority = thread->priority;
|
||||||
|
reply->affinity = thread->affinity;
|
||||||
reply->creation_time = thread->creation_time;
|
reply->creation_time = thread->creation_time;
|
||||||
reply->exit_time = thread->exit_time;
|
reply->exit_time = thread->exit_time;
|
||||||
|
|
||||||
|
@ -536,10 +536,12 @@ static void dump_get_thread_info_request( const struct get_thread_info_request *
|
|||||||
|
|
||||||
static void dump_get_thread_info_reply( const struct get_thread_info_reply *req )
|
static void dump_get_thread_info_reply( const struct get_thread_info_reply *req )
|
||||||
{
|
{
|
||||||
|
fprintf( stderr, " pid=%04x,", req->pid );
|
||||||
fprintf( stderr, " tid=%04x,", req->tid );
|
fprintf( stderr, " tid=%04x,", req->tid );
|
||||||
fprintf( stderr, " teb=%p,", req->teb );
|
fprintf( stderr, " teb=%p,", req->teb );
|
||||||
fprintf( stderr, " exit_code=%d,", req->exit_code );
|
fprintf( stderr, " exit_code=%d,", req->exit_code );
|
||||||
fprintf( stderr, " priority=%d,", req->priority );
|
fprintf( stderr, " priority=%d,", req->priority );
|
||||||
|
fprintf( stderr, " affinity=%d,", req->affinity );
|
||||||
fprintf( stderr, " creation_time=%ld,", req->creation_time );
|
fprintf( stderr, " creation_time=%ld,", req->creation_time );
|
||||||
fprintf( stderr, " exit_time=%ld", req->exit_time );
|
fprintf( stderr, " exit_time=%ld", req->exit_time );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user