1
0
mirror of https://github.com/momo5502/hypervisor.git synced 2025-07-04 18:21:55 +00:00

More irp implementation

This commit is contained in:
momo5502
2022-04-03 19:10:04 +02:00
parent 01ed54e8a2
commit 42c7f649f9
12 changed files with 271 additions and 4 deletions

46
src/driver/process.hpp Normal file
View File

@ -0,0 +1,46 @@
#pragma once
namespace process
{
class process_handle
{
public:
process_handle() = default;
process_handle(PEPROCESS handle);
~process_handle();
process_handle(process_handle&& obj) noexcept;
process_handle& operator=(process_handle&& obj) noexcept;
process_handle(const process_handle&) = delete;
process_handle& operator=(const process_handle&) = delete;
operator bool() const;
operator PEPROCESS() const;
bool is_alive() const;
private:
PEPROCESS handle_{nullptr};
void release();
};
process_handle find_process_by_id(uint32_t process_id);
class scoped_process_attacher
{
public:
scoped_process_attacher(const process_handle& process);
~scoped_process_attacher();
scoped_process_attacher(scoped_process_attacher&& obj) noexcept = delete;
scoped_process_attacher& operator=(scoped_process_attacher&& obj) noexcept = delete;
scoped_process_attacher(const scoped_process_attacher&) = delete;
scoped_process_attacher& operator=(const scoped_process_attacher&) = delete;
private:
KAPC_STATE apc_state_{};
};
}