mirror of
https://github.com/wiiu-env/FunctionPatcherModule.git
synced 2026-09-07 16:45:48 -05:00
Patch functions while holding the lock
This commit is contained in:
@@ -38,8 +38,9 @@ FunctionPatcherStatus FPAddFunctionPatch(function_replacement_data_t *function_d
|
|||||||
return FUNCTION_PATCHER_RESULT_UNKNOWN_ERROR;
|
return FUNCTION_PATCHER_RESULT_UNKNOWN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
std::lock_guard lock(gPatchedFunctionsMutex);
|
||||||
auto &functionData = functionDataOpt.value();
|
auto &functionData = functionDataOpt.value();
|
||||||
|
|
||||||
// PatchFunction calls OSFatal on fatal errors.
|
// PatchFunction calls OSFatal on fatal errors.
|
||||||
// If this function returns false the target function was not patched
|
// If this function returns false the target function was not patched
|
||||||
// Usually this means the target RPL is not (yet) loaded.
|
// Usually this means the target RPL is not (yet) loaded.
|
||||||
@@ -52,8 +53,6 @@ FunctionPatcherStatus FPAddFunctionPatch(function_replacement_data_t *function_d
|
|||||||
*outHandle = functionData->getHandle();
|
*outHandle = functionData->getHandle();
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
std::lock_guard lock(gPatchedFunctionsMutex);
|
|
||||||
gPatchedFunctions.push_back(std::move(functionData));
|
gPatchedFunctions.push_back(std::move(functionData));
|
||||||
|
|
||||||
OSMemoryBarrier();
|
OSMemoryBarrier();
|
||||||
|
|||||||
Reference in New Issue
Block a user