aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-03-24 00:43:34 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-03-24 00:48:16 +0300
commiteaf76a222e709f81e9d7c71b6c47ee172604af05 (patch)
treebf2fd37b9f5e4c6805d05be219d41d75156245cc /include
parentTravis: incremental Docker builds (diff)
downloadwinapi-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 'include')
-rw-r--r--include/pdb/all.hpp1
-rw-r--r--include/pdb/process.hpp32
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