Update process_management.cpp
This commit is contained in:
1 parent
4efe27ca91
commit
127c6f947b
1 file changed
+16
-16
@@ -43,18 +43,18 @@ namespace hos {
|
|||||||
void InitializeProcessManagement() {
|
void InitializeProcessManagement() {
|
||||||
Result rc = 0;
|
Result rc = 0;
|
||||||
|
|
||||||
rc = pmdmntInitialize();
|
rc = pmdmnt::Initialize();
|
||||||
ASSERT_RESULT_OK(rc, "pmdmntInitialize");
|
ASSERT_RESULT_OK(rc, "pmdmntInitialize");
|
||||||
|
|
||||||
rc = pminfoInitialize();
|
rc = pminfo::Initialize();
|
||||||
ASSERT_RESULT_OK(rc, "pminfoInitialize");
|
ASSERT_RESULT_OK(rc, "pminfoInitialize");
|
||||||
|
|
||||||
rc = pdmqryInitialize();
|
rc = pdmqry::Initialize();
|
||||||
ASSERT_RESULT_OK(rc, "pdmqryInitialize");
|
ASSERT_RESULT_OK(rc, "pdmqryInitialize");
|
||||||
|
|
||||||
Service *pdmqrySrv = pdmqryGetServiceSession();
|
Service *pdmqrySrv = pdmqry::GetServiceSession();
|
||||||
serviceClone(pdmqrySrv, &pdmqryClone);
|
service::Clone(pdmqrySrv, &pdmqryClone);
|
||||||
serviceClose(pdmqrySrv);
|
service::Close(pdmqrySrv);
|
||||||
memcpy(pdmqrySrv, &pdmqryClone, sizeof(Service));
|
memcpy(pdmqrySrv, &pdmqryClone, sizeof(Service));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ namespace hos {
|
|||||||
Result rc = 0;
|
Result rc = 0;
|
||||||
u64 pid = 0;
|
u64 pid = 0;
|
||||||
do {
|
do {
|
||||||
rc = pmdmntGetProcessId(&pid, Qlaunch);
|
rc = pmdmnt::GetProcessId(&pid, Qlaunch);
|
||||||
svc::SleepThread(50 * 1000000ULL); // 50ms
|
svc::SleepThread(50 * 1000000ULL); // 50ms
|
||||||
} while (R_FAILED(rc));
|
} while (R_FAILED(rc));
|
||||||
}
|
}
|
||||||
@@ -77,14 +77,14 @@ namespace hos {
|
|||||||
u64 TIDnow;
|
u64 TIDnow;
|
||||||
u64 PIDnow;
|
u64 PIDnow;
|
||||||
|
|
||||||
Result rc = pmdmntGetApplicationProcessId(&PIDnow);
|
Result rc = pmdmnt::GetApplicationProcessId(&PIDnow);
|
||||||
if (R_FAILED(rc))
|
if (R_FAILED(rc))
|
||||||
return rc;
|
return rc;
|
||||||
rc = pmdmntGetProgramId(&TIDnow, PIDnow);
|
rc = pmdmnt::GetProgramId(&TIDnow, PIDnow);
|
||||||
if (R_FAILED(rc))
|
if (R_FAILED(rc))
|
||||||
return rc;
|
return rc;
|
||||||
|
|
||||||
rc = pdmqryGetAvailablePlayEventRange(&total_entries, &start_entry_index, &end_entry_index);
|
rc = pdmqry::GetAvailablePlayEventRange(&total_entries, &start_entry_index, &end_entry_index);
|
||||||
if (R_FAILED(rc))
|
if (R_FAILED(rc))
|
||||||
return rc;
|
return rc;
|
||||||
if (total_entries == last_total_entries) {
|
if (total_entries == last_total_entries) {
|
||||||
@@ -98,7 +98,7 @@ namespace hos {
|
|||||||
s32 start_entry = end_entry_index - 15;
|
s32 start_entry = end_entry_index - 15;
|
||||||
if (start_entry < 0)
|
if (start_entry < 0)
|
||||||
start_entry = 0;
|
start_entry = 0;
|
||||||
rc = pdmqryQueryPlayEvent(start_entry, events, sizeof(events) / sizeof(events[0]), &out);
|
rc = pdmqry::QueryPlayEvent(start_entry, events, sizeof(events) / sizeof(events[0]), &out);
|
||||||
if (R_FAILED(rc))
|
if (R_FAILED(rc))
|
||||||
return rc;
|
return rc;
|
||||||
if (out == 0)
|
if (out == 0)
|
||||||
@@ -140,7 +140,7 @@ namespace hos {
|
|||||||
Result rc = 0;
|
Result rc = 0;
|
||||||
u64 pid = 0;
|
u64 pid = 0;
|
||||||
u64 tid = 0;
|
u64 tid = 0;
|
||||||
rc = pmdmntGetApplicationProcessId(&pid);
|
rc = pmdmnt::GetApplicationProcessId(&pid);
|
||||||
|
|
||||||
if (rc == IsQlaunch) {
|
if (rc == IsQlaunch) {
|
||||||
return Qlaunch;
|
return Qlaunch;
|
||||||
@@ -148,7 +148,7 @@ namespace hos {
|
|||||||
|
|
||||||
ASSERT_RESULT_OK(rc, "pmdmntGetApplicationProcessId");
|
ASSERT_RESULT_OK(rc, "pmdmntGetApplicationProcessId");
|
||||||
|
|
||||||
rc = pminfoGetProgramId(&tid, pid);
|
rc = pminfo::GetProgramId(&tid, pid);
|
||||||
|
|
||||||
if (rc == IsQlaunch) {
|
if (rc == IsQlaunch) {
|
||||||
return Qlaunch;
|
return Qlaunch;
|
||||||
@@ -160,9 +160,9 @@ namespace hos {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ExitProcessManagement() {
|
void ExitProcessManagement() {
|
||||||
pmdmntExit();
|
pmdmnt::Exit();
|
||||||
pminfoExit();
|
pminfo::Exit();
|
||||||
pdmqryExit();
|
pdmqry::Exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace hos
|
} // namespace hos
|
||||||
Reference in new issue
Block a user