summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar comex2022-06-25 18:00:29 -0700
committerGravatar GitHub2022-06-25 18:00:29 -0700
commita14438d013b96dac4ff6a31cb6fed1e51ef98f40 (patch)
tree30e86fa6a0b9122517b4172e4d4628af5c0f1a15 /src
parentSupport InfoType_MesosphereCurrentProcess (diff)
downloadyuzu-a14438d013b96dac4ff6a31cb6fed1e51ef98f40.tar.gz
yuzu-a14438d013b96dac4ff6a31cb6fed1e51ef98f40.tar.xz
yuzu-a14438d013b96dac4ff6a31cb6fed1e51ef98f40.zip
Update src/core/hle/kernel/svc.cpp
Co-authored-by: liamwhite <liamwhite@users.noreply.github.com>
Diffstat (limited to 'src')
-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;