Call ApplicationEnd-hooks inside WUMS_APPLICATIONS_ENDS, remove __init_wut()/__fini_wut() calls

This commit is contained in:
Maschell 2020-12-28 14:38:08 +01:00
parent 96cfe71230
commit 75bbf9b457
2 changed files with 8 additions and 9 deletions

View File

@ -9,13 +9,13 @@
#include "plugin/PluginContainerPersistence.h"
#include "PluginManagement.h"
#include "utils/logger.h"
#include "hooks.h"
WUMS_MODULE_EXPORT_NAME("homebrew_wupsbackend");
std::vector<PluginContainer> loadPlugins(const std::vector<PluginData> &pluginList, MEMHeapHandle heapHandle);
WUMS_INITIALIZE(args) {
__init_wut();
WHBLogUdpInit();
gModuleData = args.module_information;
@ -26,11 +26,15 @@ WUMS_INITIALIZE(args) {
OSFatal("WUPS-Backend: The module information struct version does not match.");
}
WHBLogPrintf("Init successful");
__fini_wut();
}
WUMS_APPLICATION_ENDS() {
DEBUG_FUNCTION_LINE("Call hooks");
CallHook(gPluginInformation, WUPS_LOADER_HOOK_APPLICATION_END);
CallHook(gPluginInformation, WUPS_LOADER_HOOK_FINI_WUT_DEVOPTAB);
}
WUMS_APPLICATION_STARTS() {
__init_wut();
WHBLogUdpInit();
uint32_t upid = OSGetUPID();
if (upid != 2 && upid != 15) {

View File

@ -255,12 +255,7 @@ DECL_FUNCTION(uint32_t, OSReceiveMessage, OSMessageQueue *queue, OSMessage *mess
if (message->args[0] == 0xFACEF000) {
CallHook(gPluginInformation, WUPS_LOADER_HOOK_ACQUIRED_FOREGROUND);
} else if (message->args[0] == 0xD1E0D1E0) {
CallHook(gPluginInformation, WUPS_LOADER_HOOK_APPLICATION_END);
CallHook(gPluginInformation, WUPS_LOADER_HOOK_FINI_WUT_DEVOPTAB);
__fini_wut();
//gInBackground = false;
//DCFlushRange(&gInBackground,4);
//unmount_sd_fat("sd");
// Implemented via WUMS Hook
}
}
lastData0 = message->args[0];