From 9ee8085a645dae7a7046221408076dc5f3b13001 Mon Sep 17 00:00:00 2001 From: Maschell Date: Thu, 28 May 2020 20:51:56 +0200 Subject: [PATCH] OSReceiveMessage hook: Only look into the message if the result is true --- source/patcher/hooks_patcher_static.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/patcher/hooks_patcher_static.cpp b/source/patcher/hooks_patcher_static.cpp index cb5b057..b27bdb9 100644 --- a/source/patcher/hooks_patcher_static.cpp +++ b/source/patcher/hooks_patcher_static.cpp @@ -260,7 +260,7 @@ DECL(uint32_t, OSReceiveMessage, OSMessageQueue *queue, OSMessage *message, uint } int32_t res = real_OSReceiveMessage(queue, message, flags); if (queue == OSGetSystemMessageQueue()) { - if (message != NULL) { + if (message != NULL && res) { if (lastData0 != message->args[0]) { if (message->args[0] == 0xFACEF000) { CallHook(gPluginInformation, WUPS_LOADER_HOOK_ACQUIRED_FOREGROUND);