From 0a2e837b5b0959cb599147a910b779dba16e7b4d Mon Sep 17 00:00:00 2001 From: Maschell Date: Sat, 23 Mar 2024 08:12:10 +0100 Subject: [PATCH] Using api functions in PluginUtils --- source/PluginUtils.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/source/PluginUtils.cpp b/source/PluginUtils.cpp index 5c4323f..39f5841 100644 --- a/source/PluginUtils.cpp +++ b/source/PluginUtils.cpp @@ -16,9 +16,9 @@ ****************************************************************************/ #include "wups_backend/PluginUtils.h" -#include "imports.h" #include "logger.h" #include "utils.h" +#include "wups_backend/api.h" #include #include @@ -46,7 +46,7 @@ std::optional> getMetaInformation(const w std::optional> PluginUtils::getMetaInformationForBuffer(char *buffer, size_t size) { wups_backend_plugin_information info; - if (WUPSGetPluginMetaInformationByBuffer(&info, buffer, size) != PLUGIN_BACKEND_API_ERROR_NONE) { + if (WUPSBackend_GetPluginMetaInformationByBuffer(&info, buffer, size) != PLUGIN_BACKEND_API_ERROR_NONE) { DEBUG_FUNCTION_LINE_ERR("Failed to load meta infos for buffer %08X with size %08X", buffer, size); return {}; } @@ -56,7 +56,7 @@ std::optional> PluginUtils::getMetaInform std::optional> PluginUtils::getMetaInformationForPath(const std::string &path) { wups_backend_plugin_information info = {}; - if (WUPSGetPluginMetaInformationByPath(&info, path.c_str()) != PLUGIN_BACKEND_API_ERROR_NONE) { + if (WUPSBackend_GetPluginMetaInformationByPath(&info, path.c_str()) != PLUGIN_BACKEND_API_ERROR_NONE) { DEBUG_FUNCTION_LINE_ERR("Failed to load meta infos for %s", path.c_str()); return {}; } @@ -72,7 +72,7 @@ std::optional> PluginUtils::getPluginForPath(co } wups_backend_plugin_data_handle dataHandle; - if (WUPSLoadPluginAsDataByPath(&dataHandle, path.c_str()) != PLUGIN_BACKEND_API_ERROR_NONE) { + if (WUPSBackend_LoadPluginAsDataByPath(&dataHandle, path.c_str()) != PLUGIN_BACKEND_API_ERROR_NONE) { DEBUG_FUNCTION_LINE_ERR("WUPSLoadPluginAsDataByPath failed for path %s", path.c_str()); return {}; } @@ -100,7 +100,7 @@ std::optional> PluginUtils::getPluginForBuffer( } wups_backend_plugin_data_handle dataHandle; - if (WUPSLoadPluginAsDataByBuffer(&dataHandle, buffer, size) != PLUGIN_BACKEND_API_ERROR_NONE) { + if (WUPSBackend_LoadPluginAsDataByBuffer(&dataHandle, buffer, size) != PLUGIN_BACKEND_API_ERROR_NONE) { DEBUG_FUNCTION_LINE_ERR("WUPSLoadPluginAsDataByBuffer failed for buffer %08X (%d bytes)", buffer, size); return {}; } @@ -137,7 +137,7 @@ std::vector> PluginUtils::getLoadedPlugins(uint uint32_t plugin_information_version = 0; - if (WUPSGetLoadedPlugins(handles.get(), maxSize, &realSize, &plugin_information_version) != PLUGIN_BACKEND_API_ERROR_NONE) { + if (WUPSBackend_GetLoadedPlugins(handles.get(), maxSize, &realSize, &plugin_information_version) != PLUGIN_BACKEND_API_ERROR_NONE) { DEBUG_FUNCTION_LINE_ERR("WUPSGetLoadedPlugins: Failed"); return result; } @@ -152,7 +152,7 @@ std::vector> PluginUtils::getLoadedPlugins(uint return result; } - if (WUPSGetPluginDataForContainerHandles(handles.get(), dataHandles.get(), realSize) != PLUGIN_BACKEND_API_ERROR_NONE) { + if (WUPSBackend_GetPluginDataForContainerHandles(handles.get(), dataHandles.get(), realSize) != PLUGIN_BACKEND_API_ERROR_NONE) { DEBUG_FUNCTION_LINE_ERR("Failed to get plugin data"); return result; } @@ -162,7 +162,7 @@ std::vector> PluginUtils::getLoadedPlugins(uint DEBUG_FUNCTION_LINE_ERR("Not enough memory"); return result; } - if (WUPSGetMetaInformation(handles.get(), information.get(), realSize) != PLUGIN_BACKEND_API_ERROR_NONE) { + if (WUPSBackend_GetMetaInformation(handles.get(), information.get(), realSize) != PLUGIN_BACKEND_API_ERROR_NONE) { DEBUG_FUNCTION_LINE_ERR("Failed to get meta information for handles"); return result; } @@ -218,5 +218,5 @@ int32_t PluginUtils::LoadAndLinkOnRestart(const std::vector