mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-21 11:05:46 +00:00
kernel/object: Amend handle types to distinguish between readable and writable events
Two kernel object should absolutely never have the same handle ID type. This can cause incorrect behavior when it comes to retrieving object types from the handle table. In this case it allows converting a WritableEvent into a ReadableEvent and vice-versa, which is undefined behavior, since the object types are not the same. This also corrects ClearEvent() to check both kernel types like the kernel itself does.
This commit is contained in:
parent
9ca1a2dcbc
commit
59a4ed0d24
6 changed files with 20 additions and 11 deletions
|
@ -153,7 +153,7 @@ QString WaitTreeWaitObject::GetText() const {
|
|||
|
||||
std::unique_ptr<WaitTreeWaitObject> WaitTreeWaitObject::make(const Kernel::WaitObject& object) {
|
||||
switch (object.GetHandleType()) {
|
||||
case Kernel::HandleType::Event:
|
||||
case Kernel::HandleType::ReadableEvent:
|
||||
return std::make_unique<WaitTreeEvent>(static_cast<const Kernel::ReadableEvent&>(object));
|
||||
case Kernel::HandleType::Timer:
|
||||
return std::make_unique<WaitTreeTimer>(static_cast<const Kernel::Timer&>(object));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue