diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2020-03-24 00:43:34 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2020-03-24 00:48:16 +0300 |
commit | eaf76a222e709f81e9d7c71b6c47ee172604af05 (patch) | |
tree | bf2fd37b9f5e4c6805d05be219d41d75156245cc /include | |
parent | Travis: incremental Docker builds (diff) | |
download | winapi-debug-eaf76a222e709f81e9d7c71b6c47ee172604af05.tar.gz winapi-debug-eaf76a222e709f81e9d7c71b6c47ee172604af05.zip |
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.
Diffstat (limited to '')
-rw-r--r-- | include/pdb/all.hpp | 1 | ||||
-rw-r--r-- | include/pdb/process.hpp | 32 |
2 files changed, 33 insertions, 0 deletions
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 <windows.h> + +#include <string> + +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 |