Skip to content

Commit 1c05d53

Browse files
committed
fix: use wchar_t for module filename buffer in windows api
- replace TCHAR with wchar_t for consistency with GetModuleFileNameW - update sizeof calculation to use wchar_t instead of TCHAR
1 parent 6f081f8 commit 1c05d53

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/BinaryValidate.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ auto FindLoadedLibraries(const QStringList &keywords) -> QStringList {
124124

125125
if (EnumProcessModules(h_process, h_mods, sizeof(h_mods), &cb_needed)) {
126126
for (unsigned int i = 0; i < (cb_needed / sizeof(HMODULE)); ++i) {
127-
TCHAR sz_mod_name[MAX_PATH];
128-
if (GetModuleFileName(h_mods[i], sz_mod_name,
129-
sizeof(sz_mod_name) / sizeof(TCHAR))) {
127+
wchar_t sz_mod_name[MAX_PATH];
128+
if (GetModuleFileNameW(h_mods[i], sz_mod_name,
129+
sizeof(sz_mod_name) / sizeof(wchar_t))) {
130130
auto mod = QString::fromWCharArray(sz_mod_name);
131131
for (const auto &kw : keywords) {
132132
if (mod.contains(kw, Qt::CaseInsensitive)) {

0 commit comments

Comments
 (0)