From 3717fad76e497213b7975ac8821c4f73b1bb19c3 Mon Sep 17 00:00:00 2001 From: Alex Alabuzhev Date: Wed, 18 Aug 2021 18:08:09 +0100 Subject: [PATCH] Clarify errror messages --- loader/loader.cpp | 2 +- unicon/inject.cpp | 4 ++++ unicon/plugin.cpp | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/loader/loader.cpp b/loader/loader.cpp index 5fb14ec..961d5a7 100644 --- a/loader/loader.cpp +++ b/loader/loader.cpp @@ -15,7 +15,7 @@ int main(int const Argc, char const* const Argv[]) } catch (std::exception const& e) { - std::cerr << e.what() << std::endl; + std::cerr << "Error: " << e.what() << std::endl; return 1; } } diff --git a/unicon/inject.cpp b/unicon/inject.cpp index 713a909..66326ef 100644 --- a/unicon/inject.cpp +++ b/unicon/inject.cpp @@ -65,6 +65,10 @@ inline HMODULE GetCurrentModuleHandle() __declspec(dllexport) void inject(unsigned Pid) { + BOOL IsWow64{}; + if (IsWow64Process(GetCurrentProcess(), &IsWow64) && IsWow64) + throw std::runtime_error("WOW64 is not supported. Please use the x64 version."); + if (!Pid) { Pid = GetProcessConsoleHostProcessId(GetCurrentProcess()); diff --git a/unicon/plugin.cpp b/unicon/plugin.cpp index bb74be9..67fdab2 100644 --- a/unicon/plugin.cpp +++ b/unicon/plugin.cpp @@ -45,7 +45,7 @@ extern "C" void WINAPI SetStartupInfoW(const struct PluginStartupInfo* PSInfo) const wchar_t* Items[] { - L"Error", + L"Unicon: error", Str.data() };