From eaf76a222e709f81e9d7c71b6c47ee172604af05 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 24 Mar 2020 00:43:34 +0300 Subject: add Process class It's intended to be used for the future dump writing functionality, to generate a meaningful file name, etc. Also, add Boost.Nowide, which provides handy UTF-8 conversion functions. I'm not sure about this, but things indicate that it's about to be included in Boost. --- include/pdb/all.hpp | 1 + include/pdb/process.hpp | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 include/pdb/process.hpp (limited to 'include') diff --git a/include/pdb/all.hpp b/include/pdb/all.hpp index 36a68d3..0794362 100644 --- a/include/pdb/all.hpp +++ b/include/pdb/all.hpp @@ -11,6 +11,7 @@ #include "error.hpp" #include "handle.hpp" #include "module.hpp" +#include "process.hpp" #include "repo.hpp" #include "symbol.hpp" #include "utils/file.hpp" diff --git a/include/pdb/process.hpp b/include/pdb/process.hpp new file mode 100644 index 0000000..3ddb6b4 --- /dev/null +++ b/include/pdb/process.hpp @@ -0,0 +1,32 @@ +#pragma once + +#include "handle.hpp" + +#include + +#include + +namespace pdb { + +class Process { +public: + using ID = DWORD; + + static Process current(); + static Process open(ID); + + ID get_id() const { return id; } + + const Handle& get_handle() const { return handle; } + + std::string get_executable_path() const; + +private: + explicit Process(Handle&&); + Process(ID, Handle&&); + + ID id; + Handle handle; +}; + +} // namespace pdb -- cgit v1.2.3