refactor: nuke all widestrings and widechars everywhere

This commit is contained in:
Tropical
2026-04-07 23:20:09 -05:00
parent f1f1d116b3
commit 2912e9ae2e
1323 changed files with 23207 additions and 23399 deletions

View File

@@ -87,16 +87,16 @@ void setThreadNamePlatform([[maybe_unused]] std::uint32_t threadId,
if (threadId == static_cast<std::uint32_t>(-1) ||
threadId == ::GetCurrentThreadId()) {
using SetThreadDescriptionFn = int32_t(WINAPI*)(void*, PCWSTR);
const HMODULE kernel = ::GetModuleHandleW(L"Kernel32.dll");
const HMODULE kernel = ::GetModuleHandleW("Kernel32.dll");
if (kernel) {
const auto fn = reinterpret_cast<SetThreadDescriptionFn>(
::GetProcAddress(kernel, "SetThreadDescription"));
if (fn) {
wchar_t wide[64];
const auto n = std::mbstowcs(
char wide[64];
const auto n = std::strncpy(
wide, name, (sizeof(wide) / sizeof(wide[0])) - 1);
if (n != static_cast<std::size_t>(-1)) {
wide[n] = L'\0';
wide[n] = '\0';
(void)fn(::GetCurrentThread(), wide);
return;
}