Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
4f196ead
Commit
4f196ead
authored
Jul 09, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented the ThreadBasicInformation case for
NtQueryInformationThread.
parent
56aaea2f
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
102 additions
and
36 deletions
+102
-36
thread.c
dlls/kernel/thread.c
+8
-7
nt.c
dlls/ntdll/nt.c
+0
-18
ntdll.spec
dlls/ntdll/ntdll.spec
+10
-10
thread.c
dlls/ntdll/thread.c
+64
-0
server_protocol.h
include/wine/server_protocol.h
+3
-1
winternl.h
include/winternl.h
+11
-0
protocol.def
server/protocol.def
+2
-0
thread.c
server/thread.c
+2
-0
trace.c
server/trace.c
+2
-0
No files found.
dlls/kernel/thread.c
View file @
4f196ead
...
@@ -129,15 +129,16 @@ DWORD WINAPI ResumeThread( HANDLE hthread ) /* [in] Identifies thread to restart
...
@@ -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
;
}
}
...
...
dlls/ntdll/nt.c
View file @
4f196ead
...
@@ -164,24 +164,6 @@ NTSTATUS WINAPI NtSetInformationProcess(
...
@@ -164,24 +164,6 @@ NTSTATUS WINAPI NtSetInformationProcess(
*/
*/
/******************************************************************************
/******************************************************************************
* 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.@]
*/
*/
...
...
dlls/ntdll/ntdll.spec
View file @
4f196ead
...
@@ -154,14 +154,14 @@
...
@@ -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 @@
...
@@ -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
...
...
dlls/ntdll/thread.c
View file @
4f196ead
...
@@ -20,6 +20,9 @@
...
@@ -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 )
...
@@ -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
;
}
}
include/wine/server_protocol.h
View file @
4f196ead
...
@@ -398,10 +398,12 @@ struct get_thread_info_request
...
@@ -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
...
@@ -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 11
3
#define SERVER_PROTOCOL_VERSION 11
4
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
#endif
/* __WINE_WINE_SERVER_PROTOCOL_H */
include/winternl.h
View file @
4f196ead
...
@@ -389,6 +389,17 @@ typedef enum _THREADINFOCLASS {
...
@@ -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
;
...
...
server/protocol.def
View file @
4f196ead
...
@@ -347,10 +347,12 @@ typedef struct
...
@@ -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
...
...
server/thread.c
View file @
4f196ead
...
@@ -904,10 +904,12 @@ DECL_HANDLER(get_thread_info)
...
@@ -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
;
...
...
server/trace.c
View file @
4f196ead
...
@@ -536,10 +536,12 @@ static void dump_get_thread_info_request( const struct get_thread_info_request *
...
@@ -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
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment