Merge pull request #14189 from sum2012/kernel-patch

sceKernelFindModuleByName:Add delay for Fake module
This commit is contained in:
Henrik Rydgård 2021-02-27 18:17:50 +01:00 committed by GitHub
commit e12888844c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2449,12 +2449,18 @@ u32 sceKernelFindModuleByName(const char *name)
PSPModule *module = kernelObjects.Get<PSPModule>(moduleId, error);
if (!module)
continue;
if (!module->isFake && strcmp(name, module->nm.name) == 0) {
INFO_LOG(SCEMODULE, "%d = sceKernelFindModuleByName(%s)", module->modulePtr, name);
return module->modulePtr;
if (strcmp(name, module->nm.name) == 0) {
if (!module->isFake) {
INFO_LOG(SCEMODULE, "%d = sceKernelFindModuleByName(%s)", module->modulePtr, name);
return module->modulePtr;
}
else {
WARN_LOG(SCEMODULE, "0 = sceKernelFindModuleByName(%s): Module Fake", name);
return hleDelayResult(0, "Module Fake", 1000 * 1000);
}
}
}
WARN_LOG(SCEMODULE, "0 = sceKernelFindModuleByName(%s): Module Not Found or Fake", name);
WARN_LOG(SCEMODULE, "0 = sceKernelFindModuleByName(%s): Module Not Found", name);
return 0;
}