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
e7afddd2
Commit
e7afddd2
authored
Dec 02, 2021
by
Brendan Shanks
Committed by
Alexandre Julliard
Dec 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Rename THREAD_DESCRIPTION_INFORMATION to THREAD_NAME_INFORMATION.
Signed-off-by:
Brendan Shanks
<
bshanks@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4071f6c6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
47 deletions
+47
-47
thread.c
dlls/kernel32/tests/thread.c
+15
-15
thread.c
dlls/kernelbase/thread.c
+8
-8
thread.c
dlls/ntdll/unix/thread.c
+7
-7
process.c
dlls/wow64/process.c
+12
-12
struct32.h
dlls/wow64/struct32.h
+2
-2
winternl.h
include/winternl.h
+3
-3
No files found.
dlls/kernel32/tests/thread.c
View file @
e7afddd2
...
...
@@ -2353,7 +2353,7 @@ todo_wine
static
void
test_thread_description
(
void
)
{
THREAD_
DESCRIPTION
_INFORMATION
*
thread_desc
;
THREAD_
NAME
_INFORMATION
*
thread_desc
;
static
const
WCHAR
*
desc
=
L"thread_desc"
;
ULONG
len
,
len2
,
desc_len
;
NTSTATUS
status
;
...
...
@@ -2368,7 +2368,7 @@ static void test_thread_description(void)
}
desc_len
=
lstrlenW
(
desc
)
*
sizeof
(
*
desc
);
thread_desc
=
(
THREAD_
DESCRIPTION
_INFORMATION
*
)
buff
;
thread_desc
=
(
THREAD_
NAME
_INFORMATION
*
)
buff
;
/* Initial description. */
ptr
=
NULL
;
...
...
@@ -2383,15 +2383,15 @@ static void test_thread_description(void)
ok
(
len
==
sizeof
(
*
thread_desc
),
"Unexpected structure length %u.
\n
"
,
len
);
len2
=
0
;
thread_desc
->
Description
.
Length
=
1
;
thread_desc
->
Description
.
MaximumLength
=
0
;
thread_desc
->
Description
.
Buffer
=
(
WCHAR
*
)
thread_desc
;
thread_desc
->
ThreadName
.
Length
=
1
;
thread_desc
->
ThreadName
.
MaximumLength
=
0
;
thread_desc
->
ThreadName
.
Buffer
=
(
WCHAR
*
)
thread_desc
;
status
=
pNtQueryInformationThread
(
GetCurrentThread
(),
ThreadNameInformation
,
thread_desc
,
len
,
&
len2
);
ok
(
!
status
,
"Failed to get thread info, status %#x.
\n
"
,
status
);
ok
(
len2
==
sizeof
(
*
thread_desc
),
"Unexpected structure length %u.
\n
"
,
len
);
ok
(
!
thread_desc
->
Description
.
Length
,
"Unexpected description length %#x.
\n
"
,
thread_desc
->
Description
.
Length
);
ok
(
thread_desc
->
Description
.
Buffer
==
(
WCHAR
*
)(
thread_desc
+
1
),
"Unexpected description string pointer %p, %p.
\n
"
,
thread_desc
->
Description
.
Buffer
,
thread_desc
);
ok
(
!
thread_desc
->
ThreadName
.
Length
,
"Unexpected description length %#x.
\n
"
,
thread_desc
->
ThreadName
.
Length
);
ok
(
thread_desc
->
ThreadName
.
Buffer
==
(
WCHAR
*
)(
thread_desc
+
1
),
"Unexpected description string pointer %p, %p.
\n
"
,
thread_desc
->
ThreadName
.
Buffer
,
thread_desc
);
hr
=
pSetThreadDescription
(
GetCurrentThread
(),
NULL
);
ok
(
hr
==
HRESULT_FROM_NT
(
STATUS_SUCCESS
),
"Failed to set thread description, hr %#x.
\n
"
,
hr
);
...
...
@@ -2415,11 +2415,11 @@ static void test_thread_description(void)
ok
(
!
status
,
"Failed to get thread info.
\n
"
);
ok
(
len
==
sizeof
(
*
thread_desc
)
+
desc_len
,
"Unexpected structure length %u.
\n
"
,
len
);
ok
(
thread_desc
->
Description
.
Length
==
desc_len
&&
thread_desc
->
Description
.
MaximumLength
==
desc_len
,
"Unexpected description length %u.
\n
"
,
thread_desc
->
Description
.
Length
);
ok
(
thread_desc
->
Description
.
Buffer
==
(
WCHAR
*
)(
thread_desc
+
1
),
"Unexpected description string pointer %p, %p.
\n
"
,
thread_desc
->
Description
.
Buffer
,
thread_desc
);
ok
(
!
memcmp
(
thread_desc
->
Description
.
Buffer
,
desc
,
desc_len
),
"Unexpected description string.
\n
"
);
ok
(
thread_desc
->
ThreadName
.
Length
==
desc_len
&&
thread_desc
->
ThreadName
.
MaximumLength
==
desc_len
,
"Unexpected description length %u.
\n
"
,
thread_desc
->
ThreadName
.
Length
);
ok
(
thread_desc
->
ThreadName
.
Buffer
==
(
WCHAR
*
)(
thread_desc
+
1
),
"Unexpected description string pointer %p, %p.
\n
"
,
thread_desc
->
ThreadName
.
Buffer
,
thread_desc
);
ok
(
!
memcmp
(
thread_desc
->
ThreadName
.
Buffer
,
desc
,
desc_len
),
"Unexpected description string.
\n
"
);
/* Partial results. */
len
=
0
;
...
...
@@ -2432,7 +2432,7 @@ static void test_thread_description(void)
ok
(
len
==
sizeof
(
*
thread_desc
)
+
desc_len
,
"Unexpected structure length %u.
\n
"
,
len
);
/* Change description. */
thread_desc
->
Description
.
Length
=
thread_desc
->
Description
.
MaximumLength
=
8
;
thread_desc
->
ThreadName
.
Length
=
thread_desc
->
ThreadName
.
MaximumLength
=
8
;
lstrcpyW
((
WCHAR
*
)(
thread_desc
+
1
),
L"desc"
);
status
=
pNtSetInformationThread
(
GetCurrentThread
(),
ThreadNameInformation
,
thread_desc
,
sizeof
(
*
thread_desc
));
...
...
@@ -2450,7 +2450,7 @@ static void test_thread_description(void)
status
=
NtSetInformationThread
(
GetCurrentThread
(),
ThreadNameInformation
,
NULL
,
sizeof
(
*
thread_desc
));
ok
(
status
==
STATUS_ACCESS_VIOLATION
,
"Unexpected status %#x.
\n
"
,
status
);
thread_desc
->
Description
.
Buffer
=
NULL
;
thread_desc
->
ThreadName
.
Buffer
=
NULL
;
status
=
pNtSetInformationThread
(
GetCurrentThread
(),
ThreadNameInformation
,
thread_desc
,
sizeof
(
*
thread_desc
));
ok
(
status
==
STATUS_ACCESS_VIOLATION
,
"Unexpected status %#x.
\n
"
,
status
);
...
...
dlls/kernelbase/thread.c
View file @
e7afddd2
...
...
@@ -417,7 +417,7 @@ BOOL WINAPI DECLSPEC_HOTPATCH SetThreadContext( HANDLE thread, const CONTEXT *co
*/
HRESULT
WINAPI
DECLSPEC_HOTPATCH
SetThreadDescription
(
HANDLE
thread
,
PCWSTR
description
)
{
THREAD_
DESCRIPTION
_INFORMATION
info
;
THREAD_
NAME
_INFORMATION
info
;
int
length
;
TRACE
(
"(%p, %s)
\n
"
,
thread
,
debugstr_w
(
description
));
...
...
@@ -427,8 +427,8 @@ HRESULT WINAPI DECLSPEC_HOTPATCH SetThreadDescription( HANDLE thread, PCWSTR des
if
(
length
>
USHRT_MAX
)
return
HRESULT_FROM_NT
(
STATUS_INVALID_PARAMETER
);
info
.
Description
.
Length
=
info
.
Description
.
MaximumLength
=
length
;
info
.
Description
.
Buffer
=
(
WCHAR
*
)
description
;
info
.
ThreadName
.
Length
=
info
.
ThreadName
.
MaximumLength
=
length
;
info
.
ThreadName
.
Buffer
=
(
WCHAR
*
)
description
;
return
HRESULT_FROM_NT
(
NtSetInformationThread
(
thread
,
ThreadNameInformation
,
&
info
,
sizeof
(
info
)
));
}
...
...
@@ -438,7 +438,7 @@ HRESULT WINAPI DECLSPEC_HOTPATCH SetThreadDescription( HANDLE thread, PCWSTR des
*/
HRESULT
WINAPI
DECLSPEC_HOTPATCH
GetThreadDescription
(
HANDLE
thread
,
WCHAR
**
description
)
{
THREAD_
DESCRIPTION
_INFORMATION
*
info
;
THREAD_
NAME
_INFORMATION
*
info
;
NTSTATUS
status
;
ULONG
length
;
...
...
@@ -457,13 +457,13 @@ HRESULT WINAPI DECLSPEC_HOTPATCH GetThreadDescription( HANDLE thread, WCHAR **de
status
=
NtQueryInformationThread
(
thread
,
ThreadNameInformation
,
info
,
length
,
&
length
);
if
(
!
status
)
{
if
(
!
(
*
description
=
LocalAlloc
(
0
,
info
->
Description
.
Length
+
sizeof
(
WCHAR
))))
if
(
!
(
*
description
=
LocalAlloc
(
0
,
info
->
ThreadName
.
Length
+
sizeof
(
WCHAR
))))
status
=
STATUS_NO_MEMORY
;
else
{
if
(
info
->
Description
.
Length
)
memcpy
(
*
description
,
info
->
Description
.
Buffer
,
info
->
Description
.
Length
);
(
*
description
)[
info
->
Description
.
Length
/
sizeof
(
WCHAR
)]
=
0
;
if
(
info
->
ThreadName
.
Length
)
memcpy
(
*
description
,
info
->
ThreadName
.
Buffer
,
info
->
ThreadName
.
Length
);
(
*
description
)[
info
->
ThreadName
.
Length
/
sizeof
(
WCHAR
)]
=
0
;
}
}
...
...
dlls/ntdll/unix/thread.c
View file @
e7afddd2
...
...
@@ -2037,7 +2037,7 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
case
ThreadNameInformation
:
{
THREAD_
DESCRIPTION
_INFORMATION
*
info
=
data
;
THREAD_
NAME
_INFORMATION
*
info
=
data
;
data_size_t
len
,
desc_len
=
0
;
WCHAR
*
ptr
;
...
...
@@ -2056,8 +2056,8 @@ NTSTATUS WINAPI NtQueryInformationThread( HANDLE handle, THREADINFOCLASS class,
if
(
!
info
)
status
=
STATUS_BUFFER_TOO_SMALL
;
else
if
(
status
==
STATUS_SUCCESS
)
{
info
->
Description
.
Length
=
info
->
Description
.
MaximumLength
=
desc_len
;
info
->
Description
.
Buffer
=
ptr
;
info
->
ThreadName
.
Length
=
info
->
ThreadName
.
MaximumLength
=
desc_len
;
info
->
ThreadName
.
Buffer
=
ptr
;
}
if
(
ret_len
&&
(
status
==
STATUS_SUCCESS
||
status
==
STATUS_BUFFER_TOO_SMALL
))
...
...
@@ -2230,18 +2230,18 @@ NTSTATUS WINAPI NtSetInformationThread( HANDLE handle, THREADINFOCLASS class,
case
ThreadNameInformation
:
{
const
THREAD_
DESCRIPTION
_INFORMATION
*
info
=
data
;
const
THREAD_
NAME
_INFORMATION
*
info
=
data
;
if
(
length
!=
sizeof
(
*
info
))
return
STATUS_INFO_LENGTH_MISMATCH
;
if
(
!
info
)
return
STATUS_ACCESS_VIOLATION
;
if
(
info
->
Description
.
Length
!=
info
->
Description
.
MaximumLength
)
return
STATUS_INVALID_PARAMETER
;
if
(
info
->
Description
.
Length
&&
!
info
->
Description
.
Buffer
)
return
STATUS_ACCESS_VIOLATION
;
if
(
info
->
ThreadName
.
Length
!=
info
->
ThreadName
.
MaximumLength
)
return
STATUS_INVALID_PARAMETER
;
if
(
info
->
ThreadName
.
Length
&&
!
info
->
ThreadName
.
Buffer
)
return
STATUS_ACCESS_VIOLATION
;
SERVER_START_REQ
(
set_thread_info
)
{
req
->
handle
=
wine_server_obj_handle
(
handle
);
req
->
mask
=
SET_THREAD_INFO_DESCRIPTION
;
wine_server_add_data
(
req
,
info
->
Description
.
Buffer
,
info
->
Description
.
Length
);
wine_server_add_data
(
req
,
info
->
ThreadName
.
Buffer
,
info
->
ThreadName
.
Length
);
status
=
wine_server_call
(
req
);
}
SERVER_END_REQ
;
...
...
dlls/wow64/process.c
View file @
e7afddd2
...
...
@@ -934,10 +934,10 @@ NTSTATUS WINAPI wow64_NtQueryInformationThread( UINT *args )
return
status
;
}
case
ThreadNameInformation
:
/* THREAD_
DESCRIPTION
_INFORMATION */
case
ThreadNameInformation
:
/* THREAD_
NAME
_INFORMATION */
{
THREAD_
DESCRIPTION
_INFORMATION
*
info
;
THREAD_
DESCRIPTION
_INFORMATION32
*
info32
=
ptr
;
THREAD_
NAME
_INFORMATION
*
info
;
THREAD_
NAME
_INFORMATION32
*
info32
=
ptr
;
ULONG
size
,
ret_size
;
if
(
len
>=
sizeof
(
*
info32
))
...
...
@@ -947,10 +947,10 @@ NTSTATUS WINAPI wow64_NtQueryInformationThread( UINT *args )
status
=
NtQueryInformationThread
(
handle
,
class
,
info
,
size
,
&
ret_size
);
if
(
!
status
)
{
info32
->
Description
.
Length
=
info
->
Description
.
Length
;
info32
->
Description
.
MaximumLength
=
info
->
Description
.
MaximumLength
;
info32
->
Description
.
Buffer
=
PtrToUlong
(
info32
+
1
);
memcpy
(
info32
+
1
,
info
+
1
,
min
(
len
,
info
->
Description
.
MaximumLength
));
info32
->
ThreadName
.
Length
=
info
->
ThreadName
.
Length
;
info32
->
ThreadName
.
MaximumLength
=
info
->
ThreadName
.
MaximumLength
;
info32
->
ThreadName
.
Buffer
=
PtrToUlong
(
info32
+
1
);
memcpy
(
info32
+
1
,
info
+
1
,
min
(
len
,
info
->
ThreadName
.
MaximumLength
));
}
}
else
status
=
NtQueryInformationThread
(
handle
,
class
,
NULL
,
0
,
&
ret_size
);
...
...
@@ -1190,13 +1190,13 @@ NTSTATUS WINAPI wow64_NtSetInformationThread( UINT *args )
}
else
return
STATUS_INVALID_PARAMETER
;
case
ThreadNameInformation
:
/* THREAD_
DESCRIPTION
_INFORMATION */
if
(
len
==
sizeof
(
THREAD_
DESCRIPTION
_INFORMATION32
))
case
ThreadNameInformation
:
/* THREAD_
NAME
_INFORMATION */
if
(
len
==
sizeof
(
THREAD_
NAME
_INFORMATION32
))
{
THREAD_
DESCRIPTION
_INFORMATION32
*
info32
=
ptr
;
THREAD_
DESCRIPTION
_INFORMATION
info
;
THREAD_
NAME
_INFORMATION32
*
info32
=
ptr
;
THREAD_
NAME
_INFORMATION
info
;
if
(
!
unicode_str_32to64
(
&
info
.
Description
,
&
info32
->
Description
))
if
(
!
unicode_str_32to64
(
&
info
.
ThreadName
,
&
info32
->
ThreadName
))
return
STATUS_ACCESS_VIOLATION
;
return
NtSetInformationThread
(
handle
,
class
,
&
info
,
sizeof
(
info
)
);
}
...
...
dlls/wow64/struct32.h
View file @
e7afddd2
...
...
@@ -363,8 +363,8 @@ typedef struct
typedef
struct
{
UNICODE_STRING32
Description
;
}
THREAD_
DESCRIPTION
_INFORMATION32
;
UNICODE_STRING32
ThreadName
;
}
THREAD_
NAME
_INFORMATION32
;
typedef
struct
{
...
...
include/winternl.h
View file @
e7afddd2
...
...
@@ -1905,10 +1905,10 @@ typedef struct _THREAD_DESCRIPTOR_INFORMATION
LDT_ENTRY
Entry
;
}
THREAD_DESCRIPTOR_INFORMATION
,
*
PTHREAD_DESCRIPTOR_INFORMATION
;
typedef
struct
_THREAD_
DESCRIPTION
_INFORMATION
typedef
struct
_THREAD_
NAME
_INFORMATION
{
UNICODE_STRING
Description
;
}
THREAD_
DESCRIPTION_INFORMATION
,
*
PTHREAD_DESCRIPTION
_INFORMATION
;
UNICODE_STRING
ThreadName
;
}
THREAD_
NAME_INFORMATION
,
*
PTHREAD_NAME
_INFORMATION
;
typedef
struct
_KERNEL_USER_TIMES
{
LARGE_INTEGER
CreateTime
;
...
...
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