Play your Steam library's Windows games on a jailbroken PS5.
C++
Accept untitled processes in the running-game check
Leonardo Lobato15f481f09642
diff --git a/src/platform/ps5/title_activity.cpp b/src/platform/ps5/title_activity.cppindex 5888f3e..8eccbda 100644--- a/src/platform/ps5/title_activity.cpp+++ b/src/platform/ps5/title_activity.cpp@@ -49,10 +49,10 @@ runtime::NativeActivity QueryTitleActivity(const std::string& title, const Title// The first process whose identity cannot be trusted, and how many there are.std::string untrusted; unsigned untrusted_count = 0;auto valid_identity = [&](std::int32_t pid, const std::optional<ProcessTitleIdentity>& value) {- // FW13.60 PID 1 has app_id zero and a valid system title. A successful- // title identity is authoritative regardless of app_id; only an untitled- // identity requires app_id zero. Failed calls never become non-apps.- if (value && ((value->app_id == 0 && value->title_id.empty()) || ValidTitleId(value->title_id))) return true;+ // A running title always reports its title ID, so a successful call with no+ // title is not a title, whatever its app_id (FW13.60 PID 1 has app_id zero;+ // some payloads report app_id 1). Failed calls never become non-apps.+ if (value && (value->title_id.empty() || ValidTitleId(value->title_id))) return true;if (!untrusted_count++)untrusted = "pid=" + std::to_string(pid) + (value ? " app_id=" + std::to_string(value->app_id) +" title=\"" + value->title_id + "\" is not a title"diff --git a/tests/title_activity_test.cpp b/tests/title_activity_test.cppindex 3a9d44b..045f0a9 100644--- a/tests/title_activity_test.cpp+++ b/tests/title_activity_test.cpp@@ -36,9 +36,12 @@ int main() {api.identity = [](int) { return std::optional<ProcessTitleIdentity>{}; };CHECK(QueryTitleActivity("FAKE78002", api, &reason) == NativeActivity::kUnknown);CHECK(reason == "pid=100 identity unavailable (+1 more)");- api.identity = [](int pid) { return std::optional<ProcessTitleIdentity>({pid == 201 ? 123u : 0u, ""}); };+ // An untitled process is not a title, whatever its app_id (a payload with app_id 1, say).+ api.identity = [](int pid) { return std::optional<ProcessTitleIdentity>({pid == 201 ? 1u : 0u, ""}); };+ CHECK(QueryTitleActivity("FAKE78002", api, &reason) == NativeActivity::kStopped);+ api.identity = [](int pid) { return std::optional<ProcessTitleIdentity>({pid == 201 ? 123u : 0u, pid == 201 ? "ABC" : ""}); };CHECK(QueryTitleActivity("FAKE78002", api, &reason) == NativeActivity::kUnknown);- CHECK(reason == "pid=201 app_id=123 title=\"\" is not a title");+ CHECK(reason == "pid=201 app_id=123 title=\"ABC\" is not a title");// An untrusted identity does not hide a positively identified target.api.identity = [](int pid) { return std::optional<ProcessTitleIdentity>({pid == 201 ? 123u : 7u, pid == 201 ? "FAKE78001" : ""}); };CHECK(QueryTitleActivity("FAKE78001", api) == NativeActivity::kActive);