Windows 10 SetThreadDescription failing
SetThreadDescription seems to fail on Windows 10.
However, after further analysis it succeeds.
The line S_OK == result
(p_threads.c) that checks for success is not correct.
Success should be checked using the SUCCEEDED
macro from winerror.h
.
(Thread naming is working, has been verified using the toolkit_test_server
in Visual Studio 2019)
Moreover, the flag /DWIN32_WINNT
set to 0x0600 is not working since the ifdef
is using _WIN32_WINNT
.
We can safely remove this flag because the presence of the SetThreadDescription
function is checked at runtime.
On older windows, it should not find it and not name the thread. On Windows 10, it should find the function and set the name.
source: SUCCEEDED microsoft doc
Edited by Paul Luperini