diff options
Diffstat (limited to '')
-rw-r--r-- | include/pdb/process.hpp | 1 | ||||
-rw-r--r-- | src/process.cpp | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/include/pdb/process.hpp b/include/pdb/process.hpp index e73ffff..023a741 100644 --- a/include/pdb/process.hpp +++ b/include/pdb/process.hpp @@ -25,6 +25,7 @@ public: const Handle& get_handle() const { return handle; } std::string get_executable_path() const; + static std::string get_executable_path(const Handle&); private: explicit Process(Handle&&); diff --git a/src/process.cpp b/src/process.cpp index 281ee86..683312c 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -114,6 +114,10 @@ Process::Process(Handle&& handle) : Process{::GetProcessId(handle.get()), std::m Process::Process(ID id, Handle&& handle) : id{id}, handle{std::move(handle)} {} std::string Process::get_executable_path() const { + return get_executable_path(handle); +} + +std::string Process::get_executable_path(const Handle& handle) { if (handle.get() == ::GetCurrentProcess()) { return pdb::get_current_executable_path(); } else { |