mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-26 13:52:21 +00:00
pm: work around HOS bug
This commit is contained in:
parent
00f4e5158f
commit
7e169bc7df
1 changed files with 13 additions and 10 deletions
|
@ -110,18 +110,21 @@ namespace {
|
||||||
|
|
||||||
/* This uses debugging SVCs to retrieve a process's title id. */
|
/* This uses debugging SVCs to retrieve a process's title id. */
|
||||||
sts::ncm::TitleId GetProcessTitleId(u64 process_id) {
|
sts::ncm::TitleId GetProcessTitleId(u64 process_id) {
|
||||||
/* Get a debug handle, or return our title id. */
|
/* Check if we should return our title id. */
|
||||||
AutoHandle debug_handle;
|
/* Doing this here works around a bug fixed in 6.0.0. */
|
||||||
if (R_FAILED(svcDebugActiveProcess(debug_handle.GetPointer(), process_id))) {
|
/* Not doing so will cause svcDebugActiveProcess to deadlock on lower firmwares if called for it's own process. */
|
||||||
u64 current_process_id = 0;
|
u64 current_process_id = 0;
|
||||||
R_ASSERT(svcGetProcessId(¤t_process_id, CUR_PROCESS_HANDLE));
|
R_ASSERT(svcGetProcessId(¤t_process_id, CUR_PROCESS_HANDLE));
|
||||||
if (current_process_id == process_id) {
|
if (current_process_id == process_id) {
|
||||||
return __stratosphere_title_id;
|
return __stratosphere_title_id;
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
/* Get a debug handle. */
|
||||||
|
AutoHandle debug_handle;
|
||||||
|
if (R_FAILED(svcDebugActiveProcess(debug_handle.GetPointer(), process_id))) {
|
||||||
/* If we fail to debug a process other than our own, abort. */
|
/* If we fail to debug a process other than our own, abort. */
|
||||||
std::abort();
|
std::abort();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Loop until we get the event that tells us about the process. */
|
/* Loop until we get the event that tells us about the process. */
|
||||||
DebugEventInfo d;
|
DebugEventInfo d;
|
||||||
|
|
Loading…
Reference in a new issue