Skip to content

Commit d1538c1

Browse files
authored
Revert fuzzer windows changes (#83551)
1 parent d458a19 commit d1538c1

File tree

1 file changed

+4
-21
lines changed

1 file changed

+4
-21
lines changed

compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp

+4-21
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,10 @@
2121
#include <signal.h>
2222
#include <stdio.h>
2323
#include <sys/types.h>
24-
// clang-format off
2524
#include <windows.h>
26-
// These must be included after windows.h.
27-
// archicture need to be set before including
28-
// libloaderapi
29-
#include <libloaderapi.h>
30-
#include <stringapiset.h>
25+
26+
// This must be included after windows.h.
3127
#include <psapi.h>
32-
// clang-format on
3328

3429
namespace fuzzer {
3530

@@ -239,20 +234,8 @@ size_t PageSize() {
239234
}
240235

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

258241
} // namespace fuzzer

0 commit comments

Comments
 (0)