coreinit: Return error code instead of success in Acquire failure (#260)

Spotted by @Fs00
It's currently not known if any games are affected by this
This commit is contained in:
Exzap 2022-09-16 14:25:38 +02:00 committed by GitHub
parent 664d7ee902
commit 63206eb9a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,14 +94,13 @@ namespace coreinit
RPLLoader_Link(); RPLLoader_Link();
RPLLoader_CallEntrypoints(); RPLLoader_CallEntrypoints();
rplHandle = RPLLoader_GetHandleByModuleName(libName); rplHandle = RPLLoader_GetHandleByModuleName(libName);
if (rplHandle == RPL_INVALID_HANDLE)
rplHandle = 0;
} }
*moduleHandleOut = rplHandle;
// return module not found error code
if (rplHandle == RPL_INVALID_HANDLE) if (rplHandle == RPL_INVALID_HANDLE)
return 0xFFFCFFE9; *moduleHandleOut = 0;
else
*moduleHandleOut = rplHandle;
if (rplHandle == RPL_INVALID_HANDLE)
return 0xFFFCFFE9; // module not found
return 0; return 0;
} }