From 3cb31a4cec0822fa663b8d5b344e3f32f11298e4 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sat, 26 Dec 2020 12:55:24 +0100 Subject: [PATCH] coreinit: add OSDynLoad_AddNotifyCallback and OSDynLoad_DelNotifyCallback --- include/coreinit/dynload.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/coreinit/dynload.h b/include/coreinit/dynload.h index 76b27b7..da89814 100644 --- a/include/coreinit/dynload.h +++ b/include/coreinit/dynload.h @@ -67,6 +67,10 @@ WUT_CHECK_OFFSET(OSDynLoad_NotifyData, 0x20, readOffset); WUT_CHECK_OFFSET(OSDynLoad_NotifyData, 0x24, readSize); WUT_CHECK_SIZE(OSDynLoad_NotifyData, 0x28); +typedef void (*OSDynLoadNotifyFunc)(OSDynLoad_Module module, + void *userContext, + int isLoad, + OSDynLoad_NotifyData *infos); /** * Load a module. @@ -170,6 +174,20 @@ OSDynLoad_GetRPLInfo(uint32_t first, OSDynLoad_NotifyData *outInfos); +/** +* Registers a callback that's called whenever a new .rpl is loaded +**/ +OSDynLoad_Error +OSDynLoad_AddNotifyCallback(OSDynLoadNotifyFunc notifyFn, + void *userContext); + +/** +* Registers a callback that's called whenever a .rpl is unloaded +**/ +OSDynLoad_Error +OSDynLoad_DelNotifyCallback(OSDynLoadNotifyFunc notifyFn, + void *userContext); + /** * The prototype for an RPL entry point. *