From c3875796dfbdca8dcbaeaa0be4005d1badfca5fb Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 22 Apr 2019 09:50:45 -0700 Subject: [PATCH] dmnt: update for ldr/ro api change --- stratosphere/dmnt/source/dmnt_cheat_manager.cpp | 4 ++-- stratosphere/dmnt/source/dmnt_main.cpp | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/stratosphere/dmnt/source/dmnt_cheat_manager.cpp b/stratosphere/dmnt/source/dmnt_cheat_manager.cpp index 0c5ac6f22..42cb5c48f 100644 --- a/stratosphere/dmnt/source/dmnt_cheat_manager.cpp +++ b/stratosphere/dmnt/source/dmnt_cheat_manager.cpp @@ -886,7 +886,7 @@ Result DmntCheatManager::ForceOpenCheatProcess() { { LoaderModuleInfo proc_modules[2]; u32 num_modules; - if (R_FAILED((rc = ldrDmntGetModuleInfos(g_cheat_process_metadata.process_id, proc_modules, sizeof(proc_modules), &num_modules)))) { + if (R_FAILED((rc = ldrDmntGetModuleInfos(g_cheat_process_metadata.process_id, proc_modules, sizeof(proc_modules)/sizeof(proc_modules[0]), &num_modules)))) { return rc; } @@ -981,7 +981,7 @@ void DmntCheatManager::OnNewApplicationLaunch() { { LoaderModuleInfo proc_modules[2]; u32 num_modules; - if (R_FAILED((rc = ldrDmntGetModuleInfos(g_cheat_process_metadata.process_id, proc_modules, sizeof(proc_modules), &num_modules)))) { + if (R_FAILED((rc = ldrDmntGetModuleInfos(g_cheat_process_metadata.process_id, proc_modules, sizeof(proc_modules)/sizeof(proc_modules[0]), &num_modules)))) { fatalSimple(rc); } diff --git a/stratosphere/dmnt/source/dmnt_main.cpp b/stratosphere/dmnt/source/dmnt_main.cpp index 77571d4ed..eb864e8ce 100644 --- a/stratosphere/dmnt/source/dmnt_main.cpp +++ b/stratosphere/dmnt/source/dmnt_main.cpp @@ -86,14 +86,10 @@ void __appInit(void) { fatalSimple(rc); } - /* - if (kernelAbove300()) { - rc = roDmntInitialize(); - if (R_FAILED(rc)) { - fatalSimple(rc); - } + rc = roDmntInitialize(); + if (R_FAILED(rc)) { + fatalSimple(rc); } - */ rc = nsdevInitialize(); if (R_FAILED(rc)) { @@ -142,7 +138,7 @@ void __appExit(void) { setExit(); lrExit(); nsdevExit(); - /* if (kernelAbove300()) { roDmntExit(); } */ + roDmntExit(); ldrDmntExit(); pmdmntExit(); smExit();