From 5eb057f422ac316cd1b943f6cd00aabc673dc238 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 3 Dec 2018 22:50:16 -0500 Subject: 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. --- src/core/hle/kernel/object.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core/hle/kernel/object.h') diff --git a/src/core/hle/kernel/object.h b/src/core/hle/kernel/object.h index 69082ce3e..f1606a204 100644 --- a/src/core/hle/kernel/object.h +++ b/src/core/hle/kernel/object.h @@ -19,7 +19,8 @@ using Handle = u32; enum class HandleType : u32 { Unknown, - Event, + WritableEvent, + ReadableEvent, SharedMemory, Thread, Process, -- cgit v1.2.3