Skip to content

Commit c522d48

Browse files
committed
Revert "[compiler-rt][Fuzzer] SetThreadName windows implementation new try. (llvm#76761)"
This reverts commit 2cdf611.
1 parent 6a07a4f commit c522d48

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@
1818
#include <errno.h>
1919
#include <io.h>
2020
#include <iomanip>
21-
#include <libloaderapi.h>
2221
#include <signal.h>
2322
#include <stdio.h>
24-
#include <stringapiset.h>
2523
#include <sys/types.h>
2624
#include <windows.h>
2725

@@ -236,20 +234,8 @@ size_t PageSize() {
236234
}
237235

238236
void SetThreadName(std::thread &thread, const std::string &name) {
239-
typedef HRESULT(WINAPI * proc)(HANDLE, PCWSTR);
240-
HMODULE kbase = GetModuleHandleA("KernelBase.dll");
241-
proc ThreadNameProc =
242-
reinterpret_cast<proc>(GetProcAddress, "SetThreadDescription");
243-
if (proc) {
244-
std::wstring buf;
245-
auto sz = MultiByteToWideChar(CP_UTF8, 0, name.data(), -1, nullptr, 0);
246-
if (sz > 0) {
247-
buf.resize(sz);
248-
if (MultyByteToWideChar(CP_UTF8, 0, name.data(), -1, &buf[0], sz) > 0) {
249-
(void)ThreadNameProc(thread.native_handle(), buf.c_str());
250-
}
251-
}
252-
}
237+
// TODO ?
238+
// to UTF-8 then SetThreadDescription ?
253239
}
254240

255241
} // namespace fuzzer

0 commit comments

Comments
 (0)