summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 0aa068f1d..fdfd69ebd 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -917,17 +917,25 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle
917 *result = system.Kernel().CurrentScheduler()->GetIdleThread()->GetCpuTime(); 917 *result = system.Kernel().CurrentScheduler()->GetIdleThread()->GetCpuTime();
918 return ResultSuccess; 918 return ResultSuccess;
919 } 919 }
920 case GetInfoType::MesosphereCurrentProcess: { 920 // Verify the input handle is invalid.
921 R_UNLESS(handle == InvalidHandle, ResultInvalidHandle); 921 R_UNLESS(handle == InvalidHandle, ResultInvalidHandle);
922
923 // Verify the sub-type is valid.
922 R_UNLESS(info_sub_id == 0, ResultInvalidCombination); 924 R_UNLESS(info_sub_id == 0, ResultInvalidCombination);
923 925
924 KProcess* const current_process = system.Kernel().CurrentProcess(); 926 // Get the handle table.
925 Handle process_handle{}; 927 KProcess* current_process = system.Kernel().CurrentProcess();
926 R_TRY(current_process->GetHandleTable().Add(&process_handle, current_process)); 928 KHandleTable& handle_table = current_process->GetHandleTable();
929
930 // Get a new handle for the current process.
931 Handle tmp;
932 R_TRY(handle_table.Add(&tmp, current_process));
927 933
928 *result = process_handle; 934 // Set the output.
935 *result = tmp;
936
937 // We succeeded.
929 return ResultSuccess; 938 return ResultSuccess;
930 }
931 default: 939 default:
932 LOG_ERROR(Kernel_SVC, "Unimplemented svcGetInfo id=0x{:016X}", info_id); 940 LOG_ERROR(Kernel_SVC, "Unimplemented svcGetInfo id=0x{:016X}", info_id);
933 return ResultInvalidEnumValue; 941 return ResultInvalidEnumValue;