Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
179cd78f
Commit
179cd78f
authored
Nov 26, 2019
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Implement higher level API to access thread description.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b934f662
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
6 deletions
+61
-6
api-ms-win-core-processthreads-l1-1-3.spec
...threads-l1-1-3/api-ms-win-core-processthreads-l1-1-3.spec
+1
-1
kernel32.spec
dlls/kernel32/kernel32.spec
+1
-0
thread.c
dlls/kernel32/tests/thread.c
+1
-1
kernelbase.spec
dlls/kernelbase/kernelbase.spec
+1
-1
thread.c
dlls/kernelbase/thread.c
+57
-3
No files found.
dlls/api-ms-win-core-processthreads-l1-1-3/api-ms-win-core-processthreads-l1-1-3.spec
View file @
179cd78f
@ stub GetProcessDefaultCpuSets
@ stub GetProcessInformation
@ stub GetSystemCpuSetInformation
@ st
ub
GetThreadDescription
@ st
dcall GetThreadDescription(long ptr) kernel32.
GetThreadDescription
@ stub GetThreadSelectedCpuSets
@ stub SetProcessDefaultCpuSets
@ stub SetProcessInformation
...
...
dlls/kernel32/kernel32.spec
View file @
179cd78f
...
...
@@ -847,6 +847,7 @@
@ stdcall -import GetTempPathA(long ptr)
@ stdcall -import GetTempPathW(long ptr)
@ stdcall -import GetThreadContext(long ptr)
@ stdcall -import GetThreadDescription(long ptr)
@ stdcall -import GetThreadErrorMode()
@ stdcall -import GetThreadGroupAffinity(long ptr)
@ stdcall -import GetThreadIOPendingFlag(long ptr)
...
...
dlls/kernel32/tests/thread.c
View file @
179cd78f
...
...
@@ -2125,7 +2125,7 @@ static void test_thread_description(void)
if
(
!
pGetThreadDescription
)
{
skip
(
"Thread description API is not supported.
\n
"
);
win_
skip
(
"Thread description API is not supported.
\n
"
);
return
;
}
...
...
dlls/kernelbase/kernelbase.spec
View file @
179cd78f
...
...
@@ -711,7 +711,7 @@
@ stdcall GetTempPathA(long ptr)
@ stdcall GetTempPathW(long ptr)
@ stdcall GetThreadContext(long ptr)
# @ stub GetThreadDescription
@ stdcall GetThreadDescription(long ptr)
@ stdcall GetThreadErrorMode()
@ stdcall GetThreadGroupAffinity(long ptr)
@ stdcall GetThreadIOPendingFlag(long ptr)
...
...
dlls/kernelbase/thread.c
View file @
179cd78f
...
...
@@ -20,6 +20,7 @@
#include <stdarg.h>
#include <string.h>
#include <limits.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
...
...
@@ -33,6 +34,7 @@
#include "wine/exception.h"
#include "wine/asm.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
thread
);
...
...
@@ -390,12 +392,64 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetThreadContext( HANDLE thread, const CONTEXT *co
/***********************************************************************
* SetThreadDescription (kernelbase.@)
*/
HRESULT
WINAPI
/* DECLSPEC_HOTPATCH */
SetThreadDescription
(
HANDLE
thread
,
PCWSTR
description
)
HRESULT
WINAPI
DECLSPEC_HOTPATCH
SetThreadDescription
(
HANDLE
thread
,
PCWSTR
description
)
{
FIXME
(
"(%p %s): stub
\n
"
,
thread
,
debugstr_w
(
description
));
return
E_NOTIMPL
;
THREAD_DESCRIPTION_INFORMATION
info
;
int
length
;
TRACE
(
"(%p, %s)
\n
"
,
thread
,
debugstr_w
(
description
));
length
=
description
?
lstrlenW
(
description
)
*
sizeof
(
WCHAR
)
:
0
;
if
(
length
>
USHRT_MAX
)
return
HRESULT_FROM_NT
(
STATUS_INVALID_PARAMETER
);
info
.
Length
=
length
<<
16
|
length
;
info
.
Description
=
(
WCHAR
*
)
description
;
return
HRESULT_FROM_NT
(
NtSetInformationThread
(
thread
,
ThreadDescription
,
&
info
,
sizeof
(
info
)
));
}
/***********************************************************************
* GetThreadDescription (kernelbase.@)
*/
HRESULT
WINAPI
DECLSPEC_HOTPATCH
GetThreadDescription
(
HANDLE
thread
,
WCHAR
**
description
)
{
THREAD_DESCRIPTION_INFORMATION
*
info
;
NTSTATUS
status
;
ULONG
length
;
TRACE
(
"(%p, %p)
\n
"
,
thread
,
description
);
*
description
=
NULL
;
length
=
0
;
status
=
NtQueryInformationThread
(
thread
,
ThreadDescription
,
NULL
,
0
,
&
length
);
if
(
status
!=
STATUS_BUFFER_TOO_SMALL
)
return
HRESULT_FROM_NT
(
status
);
if
(
!
(
info
=
heap_alloc
(
length
)))
return
HRESULT_FROM_NT
(
STATUS_NO_MEMORY
);
status
=
NtQueryInformationThread
(
thread
,
ThreadDescription
,
info
,
length
,
&
length
);
if
(
!
status
)
{
length
=
info
->
Length
&
0xffff
;
if
(
!
(
*
description
=
LocalAlloc
(
0
,
length
+
sizeof
(
WCHAR
))))
status
=
STATUS_NO_MEMORY
;
else
{
if
(
length
)
memcpy
(
*
description
,
info
->
Description
,
length
);
(
*
description
)[
length
/
sizeof
(
WCHAR
)]
=
0
;
}
}
heap_free
(
info
);
return
HRESULT_FROM_NT
(
status
);
}
/***********************************************************************
* SetThreadErrorMode (kernelbase.@)
...
...
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