1
0
mirror of https://github.com/momo5502/hypervisor.git synced 2025-07-05 18:51:53 +00:00

Support copying

This commit is contained in:
momo5502
2022-04-24 11:13:37 +02:00
parent 4a3958d149
commit 1b14d5f657
2 changed files with 24 additions and 2 deletions

View File

@ -35,6 +35,28 @@ namespace process
return *this;
}
process_handle::process_handle(const process_handle& obj)
{
this->operator=(std::move(obj));
}
process_handle& process_handle::operator=(const process_handle& obj)
{
if (this != &obj)
{
this->release();
this->own_ = obj.own_;
this->handle_ = obj.handle_;
if(this->own_ && this->handle_)
{
ObReferenceObject(this->handle_);
}
}
return *this;
}
process_handle::operator bool() const
{
return this->handle_ != nullptr;