Skip to content

Commit

Permalink
TEST
Browse files Browse the repository at this point in the history
  • Loading branch information
cristian64 committed Mar 6, 2024
1 parent 930eb9c commit 43326c4
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 16 deletions.
61 changes: 60 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,65 @@
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"vector": "cpp"
"vector": "cpp",
"array": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"cctype": "cpp",
"charconv": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"compare": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"cstdarg": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"list": "cpp",
"map": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"random": "cpp",
"source_location": "cpp",
"string_view": "cpp",
"utility": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"istream": "cpp",
"mutex": "cpp",
"new": "cpp",
"numbers": "cpp",
"ostream": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"typeinfo": "cpp",
"variant": "cpp",
"__config": "cpp",
"__debug": "cpp",
"__errc": "cpp",
"__hash_table": "cpp",
"__locale": "cpp",
"__mutex_base": "cpp",
"__split_buffer": "cpp",
"__threading_support": "cpp",
"__tree": "cpp",
"__verbose_abort": "cpp",
"ios": "cpp",
"queue": "cpp"
}
}
31 changes: 16 additions & 15 deletions Source/DolphinProcess/Windows/WindowsDolphinProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
#include "../../Common/MemoryCommon.h"

#include <Psapi.h>
#ifdef UNICODE
#include <codecvt>
#endif
// #ifdef UNICODE
// #include <codecvt>
// #endif
#include <cstdlib>
#include <string>
#include <tlhelp32.h>

namespace
{
#ifdef UNICODE
std::wstring utf8_to_wstring(const std::string& str)
{
std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv;
return myconv.from_bytes(str);
}
#endif
// #ifdef UNICODE
// std::wstring utf8_to_wstring(const std::string& str)
// {
// std::wstring_convert<std::codecvt_utf8<wchar_t>> myconv;
// return myconv.from_bytes(str);
// }
// #endif
} // namespace

namespace DolphinComm
Expand All @@ -31,7 +31,7 @@ bool WindowsDolphinProcess::findPID()
PROCESSENTRY32 entry;
entry.dwSize = sizeof(PROCESSENTRY32);

static const char* const s_dolphinProcessName{std::getenv("DME_DOLPHIN_PROCESS_NAME")};
// static const char* const s_dolphinProcessName{std::getenv("DME_DOLPHIN_PROCESS_NAME")};

HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);

Expand All @@ -42,10 +42,11 @@ bool WindowsDolphinProcess::findPID()
{
#ifdef UNICODE
const std::wstring exeFile{entry.szExeFile};
const bool match{s_dolphinProcessName ?
exeFile == utf8_to_wstring(s_dolphinProcessName) :
(exeFile == L"Dolphin.exe" || exeFile == L"DolphinQt2.exe" ||
exeFile == L"DolphinWx.exe")};
// const bool match{s_dolphinProcessName ?
// exeFile == utf8_to_wstring(s_dolphinProcessName) :
// (exeFile == L"Dolphin.exe" || exeFile == L"DolphinQt2.exe" ||
// exeFile == L"DolphinWx.exe")};
const bool match{false};
#else
const std::string exeFile{entry.szExeFile};
const bool match{s_dolphinProcessName ?
Expand Down

0 comments on commit 43326c4

Please sign in to comment.