summaryrefslogtreecommitdiff
path: root/src/core/hle/svc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/svc.cpp')
-rw-r--r--src/core/hle/svc.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index b5cf554c3..e8159fbdb 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -426,28 +426,28 @@ static ResultCode ReleaseMutex(Handle handle) {
426} 426}
427 427
428/// Get the ID of the specified process 428/// Get the ID of the specified process
429static ResultCode GetProcessId(u32* process_id, Handle handle) { 429static ResultCode GetProcessId(u32* process_id, Handle process_handle) {
430 LOG_TRACE(Kernel_SVC, "called process=0x%08X", handle); 430 LOG_TRACE(Kernel_SVC, "called process=0x%08X", process_handle);
431 431
432 const SharedPtr<Kernel::Process> process = Kernel::g_handle_table.Get<Kernel::Process>(handle); 432 const SharedPtr<Kernel::Process> process = Kernel::g_handle_table.Get<Kernel::Process>(process_handle);
433 if (process == nullptr) 433 if (process == nullptr)
434 return ERR_INVALID_HANDLE; 434 return ERR_INVALID_HANDLE;
435 435
436 *process_id = process->GetProcessId(); 436 *process_id = process->process_id;
437 return RESULT_SUCCESS; 437 return RESULT_SUCCESS;
438} 438}
439 439
440/// Get the ID of the process that owns the specified thread 440/// Get the ID of the process that owns the specified thread
441static ResultCode GetProcessIdOfThread(u32* process_id, Handle handle) { 441static ResultCode GetProcessIdOfThread(u32* process_id, Handle thread_handle) {
442 LOG_TRACE(Kernel_SVC, "called thread=0x%08X", handle); 442 LOG_TRACE(Kernel_SVC, "called thread=0x%08X", thread_handle);
443 443
444 const SharedPtr<Kernel::Thread> thread = Kernel::g_handle_table.Get<Kernel::Thread>(handle); 444 const SharedPtr<Kernel::Thread> thread = Kernel::g_handle_table.Get<Kernel::Thread>(thread_handle);
445 if (thread == nullptr) 445 if (thread == nullptr)
446 return ERR_INVALID_HANDLE; 446 return ERR_INVALID_HANDLE;
447 447
448 const SharedPtr<Kernel::Process> process = thread->owner_process; 448 const SharedPtr<Kernel::Process> process = thread->owner_process;
449 if (process == nullptr) 449
450 return ERR_INVALID_HANDLE; 450 ASSERT_MSG(process != nullptr, "Invalid parent process for thread=0x%08X", thread_handle);
451 451
452 *process_id = process->process_id; 452 *process_id = process->process_id;
453 return RESULT_SUCCESS; 453 return RESULT_SUCCESS;