mirror of
https://github.com/momo5502/hypervisor.git
synced 2025-07-05 18:51:53 +00:00
Support copying
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user