diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-05-15 23:36:29 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-05-15 23:36:29 +0300 |
commit | 46ef2fbd49b2e48206a0554ae9a7d84f5961d817 (patch) | |
tree | d25e78e4c7e8a36c960a1157e06be77d39a0afcf /src/process.cpp | |
parent | rename the project (diff) | |
download | winapi-debug-46ef2fbd49b2e48206a0554ae9a7d84f5961d817.tar.gz winapi-debug-46ef2fbd49b2e48206a0554ae9a7d84f5961d817.zip |
use error reporting from winapi-common
Diffstat (limited to 'src/process.cpp')
-rw-r--r-- | src/process.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/process.cpp b/src/process.cpp index b70bf89..7763720 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -5,6 +5,7 @@ #include <pdb/all.hpp> +#include <winapi/error.hpp> #include <winapi/utf8.hpp> #include <windows.h> @@ -24,7 +25,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(), "OpenProcess"); + throw winapi::error::windows(GetLastError(), "OpenProcess"); } return process; } @@ -62,7 +63,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(), "GetModuleFileNameW"); + throw winapi::error::windows(GetLastError(), "GetModuleFileNameW"); } if (ec == buffer.get_size() && GetLastError() == ERROR_INSUFFICIENT_BUFFER) { @@ -92,7 +93,7 @@ std::string get_executable_path(const Handle& process, PathBuffer& buffer) { return get_executable_path(process, buffer); } - throw error::windows(GetLastError(), "QueryFullProcessImageNameW"); + throw winapi::error::windows(GetLastError(), "QueryFullProcessImageNameW"); } std::string get_executable_path(const Handle& process) { |