mirror of
https://github.com/wiiu-env/WiiUPluginSystem.git
synced 2025-01-11 09:09:06 +01:00
When loading a plugin via wiiload the plugin loader now only closes when the plugin was linked successfully.
This commit is contained in:
parent
982e013a30
commit
3066de2d76
@ -226,10 +226,9 @@ int TcpReceiver::loadToMemory(s32 clientSocket, u32 ipAddress) {
|
|||||||
PluginLoader * pluginLoader = PluginLoader::getInstance();
|
PluginLoader * pluginLoader = PluginLoader::getInstance();
|
||||||
pluginLoader->resetPluginLoader();
|
pluginLoader->resetPluginLoader();
|
||||||
std::vector<PluginInformation* > pluginList = pluginLoader->getPluginInformation(WUPS_TEMP_PLUGIN_PATH);
|
std::vector<PluginInformation* > pluginList = pluginLoader->getPluginInformation(WUPS_TEMP_PLUGIN_PATH);
|
||||||
if(pluginList.size() == 0) {
|
if(pluginList.size() == 0 || !pluginLoader->loadAndLinkPlugins(pluginList)) {
|
||||||
return NOT_A_VALID_PLUGIN;
|
return NOT_A_VALID_PLUGIN;
|
||||||
}
|
}
|
||||||
pluginLoader->loadAndLinkPlugins(pluginList);
|
|
||||||
Application::instance()->quit(APPLICATION_CLOSE_APPLY);
|
Application::instance()->quit(APPLICATION_CLOSE_APPLY);
|
||||||
|
|
||||||
return fileSize;
|
return fileSize;
|
||||||
|
@ -90,13 +90,15 @@ std::vector<PluginInformation *> PluginLoader::getPluginsLoadedInMemory() {
|
|||||||
return pluginInformation;
|
return pluginInformation;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginLoader::loadAndLinkPlugins(std::vector<PluginInformation *> pluginInformation) {
|
bool PluginLoader::loadAndLinkPlugins(std::vector<PluginInformation *> pluginInformation) {
|
||||||
std::vector<PluginData *> loadedPlugins;
|
std::vector<PluginData *> loadedPlugins;
|
||||||
|
bool success = true;
|
||||||
for(size_t i = 0; i < pluginInformation.size(); i++) {
|
for(size_t i = 0; i < pluginInformation.size(); i++) {
|
||||||
PluginInformation * cur_info = pluginInformation[i];
|
PluginInformation * cur_info = pluginInformation[i];
|
||||||
PluginData * pluginData = loadAndLinkPlugin(cur_info);
|
PluginData * pluginData = loadAndLinkPlugin(cur_info);
|
||||||
if(pluginData == NULL) {
|
if(pluginData == NULL) {
|
||||||
DEBUG_FUNCTION_LINE("loadAndLinkPlugins failed for %d\n",i) ;
|
DEBUG_FUNCTION_LINE("loadAndLinkPlugins failed for %d\n",i) ;
|
||||||
|
success = false;
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
loadedPlugins.push_back(pluginData);
|
loadedPlugins.push_back(pluginData);
|
||||||
@ -108,6 +110,7 @@ void PluginLoader::loadAndLinkPlugins(std::vector<PluginInformation *> pluginInf
|
|||||||
|
|
||||||
DCFlushRange((void*)this->startAddress,(u32)this->endAddress - (u32)this->startAddress);
|
DCFlushRange((void*)this->startAddress,(u32)this->endAddress - (u32)this->startAddress);
|
||||||
ICInvalidateRange((void*)this->startAddress,(u32)this->endAddress - (u32)this->startAddress);
|
ICInvalidateRange((void*)this->startAddress,(u32)this->endAddress - (u32)this->startAddress);
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginLoader::clearPluginData(std::vector<PluginData *> pluginData) {
|
void PluginLoader::clearPluginData(std::vector<PluginData *> pluginData) {
|
||||||
|
@ -85,8 +85,10 @@ public:
|
|||||||
Also the hooks of the plugins will be called in the order their plugin where passed to this method.
|
Also the hooks of the plugins will be called in the order their plugin where passed to this method.
|
||||||
|
|
||||||
\param A list of plugin that should be linked (relocated) an loaded into memory
|
\param A list of plugin that should be linked (relocated) an loaded into memory
|
||||||
|
|
||||||
|
\return Returns true if all plugins were linked successfully. Returns false if at least one plugin failed while linking.
|
||||||
**/
|
**/
|
||||||
void loadAndLinkPlugins(std::vector<PluginInformation *> pluginInformation);
|
bool loadAndLinkPlugins(std::vector<PluginInformation *> pluginInformation);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\brief Iterates through the vector and delete all it's elements
|
\brief Iterates through the vector and delete all it's elements
|
||||||
|
Loading…
x
Reference in New Issue
Block a user