mirror of
https://github.com/wiiu-env/WiiUPluginLoaderBackend.git
synced 2024-11-06 04:55:07 +01:00
cc5acd0980
- avoid using const std::unique_ptr& and const std::shared_ptr& - avoid wrapping results in std::optional - prefer std::string_view over const std::string& - update FSUtils::LoadFileToMem to write into std::vector<uint8_t> - use std::span when possible - Avoid unnessecary copies in PluginDataFactory - allocate plugins as HeapMemoryFixedSize which bascially is a std::unique_ptr with fixed size
30 lines
1.3 KiB
C++
30 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#include "plugin/PluginContainer.h"
|
|
#include <coreinit/dynload.h>
|
|
#include <map>
|
|
#include <memory>
|
|
#include <set>
|
|
#include <wums/defines/relocation_defines.h>
|
|
|
|
class PluginManagement {
|
|
public:
|
|
static std::vector<std::unique_ptr<PluginContainer>> loadPlugins(
|
|
const std::set<std::shared_ptr<PluginData>> &pluginDataList,
|
|
std::vector<relocation_trampoline_entry_t> &trampolineData);
|
|
|
|
static void callInitHooks(const std::vector<std::unique_ptr<PluginContainer>> &plugins);
|
|
|
|
static bool doRelocations(const std::vector<std::unique_ptr<PluginContainer>> &plugins,
|
|
std::vector<relocation_trampoline_entry_t> &trampData,
|
|
std::map<std::string, OSDynLoad_Module> &usedRPls);
|
|
|
|
static bool doRelocation(const std::vector<std::unique_ptr<RelocationData>> &relocData,
|
|
std::vector<relocation_trampoline_entry_t> &trampData,
|
|
uint32_t trampolineID,
|
|
std::map<std::string, OSDynLoad_Module> &usedRPls);
|
|
|
|
static bool DoFunctionPatches(const std::vector<std::unique_ptr<PluginContainer>> &plugins);
|
|
|
|
static bool RestoreFunctionPatches(const std::vector<std::unique_ptr<PluginContainer>> &plugins);
|
|
}; |