| 132 | } |
| 133 | |
| 134 | static DWORD findProcess(LPCWSTR name) { |
| 135 | PROCESSENTRY32W entry; |
| 136 | entry.dwSize = sizeof(PROCESSENTRY32W); |
| 137 | |
| 138 | const auto snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL); |
| 139 | |
| 140 | if (!Process32FirstW(snapshot, &entry)) { |
| 141 | CloseHandle(snapshot); |
| 142 | return -1; |
| 143 | } |
| 144 | |
| 145 | do { |
| 146 | std::wstring executableName(entry.szExeFile); |
| 147 | if (executableName == name) { |
| 148 | CloseHandle(snapshot); |
| 149 | return entry.th32ProcessID; |
| 150 | } |
| 151 | } |
| 152 | while (Process32NextW(snapshot, &entry)); |
| 153 | |
| 154 | CloseHandle(snapshot); |
| 155 | return -1; |
| 156 | } |
| 157 | |
| 158 | static bool launchDFHack(color_ostream& out) { |
| 159 | if (is_running_on_wine()) { |
no test coverage detected