From 95a6b0828ffc09b9661e43ac5003dd1e985ca0c8 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Sat, 20 Feb 2021 17:37:59 -0800 Subject: [PATCH] dmnt: set the debug process handle slightly more carefully --- stratosphere/dmnt/source/cheat/impl/dmnt_cheat_api.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_api.cpp b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_api.cpp index 365f249e0..79f3a8b84 100644 --- a/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_api.cpp +++ b/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_api.cpp @@ -834,7 +834,11 @@ namespace ams::dmnt::cheat::impl { } /* Open a debug handle. */ - R_ABORT_UNLESS_IF_NEW_PROCESS(svcDebugActiveProcess(&this->cheat_process_debug_handle, static_cast(this->cheat_process_metadata.process_id))); + svc::Handle debug_handle = svc::InvalidHandle; + R_ABORT_UNLESS_IF_NEW_PROCESS(svc::DebugActiveProcess(std::addressof(debug_handle), this->cheat_process_metadata.process_id.value)); + + /* Set our debug handle. */ + this->cheat_process_debug_handle = debug_handle; /* Cancel process guard. */ proc_guard.Cancel();