aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/process.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/process.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/process.cpp b/src/process.cpp
index 08319fa..281ee86 100644
--- a/src/process.cpp
+++ b/src/process.cpp
@@ -24,7 +24,7 @@ constexpr DWORD permissions = PROCESS_QUERY_INFORMATION | PROCESS_VM_READ;
Handle open_process(DWORD id) {
Handle process{OpenProcess(permissions, FALSE, id)};
if (!process) {
- throw error::windows(GetLastError());
+ throw error::windows(GetLastError(), "OpenProcess");
}
return process;
}
@@ -61,7 +61,7 @@ std::string get_current_executable_path(PathBuffer& buffer) {
const auto ec = ::GetModuleFileNameW(NULL, buffer.get_data(), buffer.get_size());
if (ec == 0) {
- throw error::windows(GetLastError());
+ throw error::windows(GetLastError(), "GetModuleFileNameW");
}
if (ec == buffer.get_size() && GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
@@ -91,7 +91,7 @@ std::string get_executable_path(const Handle& process, PathBuffer& buffer) {
return get_executable_path(process, buffer);
}
- throw error::windows(GetLastError());
+ throw error::windows(GetLastError(), "QueryFullProcessImageNameW");
}
std::string get_executable_path(const Handle& process) {