summaryrefslogtreecommitdiffstats
path: root/src/core/hle
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2022-06-26 03:00:29 +0200
committerGitHub <noreply@github.com>2022-06-26 03:00:29 +0200
commita14438d013b96dac4ff6a31cb6fed1e51ef98f40 (patch)
tree30e86fa6a0b9122517b4172e4d4628af5c0f1a15 /src/core/hle
parentSupport InfoType_MesosphereCurrentProcess (diff)
downloadyuzu-a14438d013b96dac4ff6a31cb6fed1e51ef98f40.tar
yuzu-a14438d013b96dac4ff6a31cb6fed1e51ef98f40.tar.gz
yuzu-a14438d013b96dac4ff6a31cb6fed1e51ef98f40.tar.bz2
yuzu-a14438d013b96dac4ff6a31cb6fed1e51ef98f40.tar.lz
yuzu-a14438d013b96dac4ff6a31cb6fed1e51ef98f40.tar.xz
yuzu-a14438d013b96dac4ff6a31cb6fed1e51ef98f40.tar.zst
yuzu-a14438d013b96dac4ff6a31cb6fed1e51ef98f40.zip
Diffstat (limited to 'src/core/hle')
-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
*result = system.Kernel().CurrentScheduler()->GetIdleThread()->GetCpuTime();
return ResultSuccess;
}
- case GetInfoType::MesosphereCurrentProcess: {
+ // Verify the input handle is invalid.
R_UNLESS(handle == InvalidHandle, ResultInvalidHandle);
+
+ // Verify the sub-type is valid.
R_UNLESS(info_sub_id == 0, ResultInvalidCombination);
- KProcess* const current_process = system.Kernel().CurrentProcess();
- Handle process_handle{};
- R_TRY(current_process->GetHandleTable().Add(&process_handle, current_process));
+ // Get the handle table.
+ KProcess* current_process = system.Kernel().CurrentProcess();
+ KHandleTable& handle_table = current_process->GetHandleTable();
+
+ // Get a new handle for the current process.
+ Handle tmp;
+ R_TRY(handle_table.Add(&tmp, current_process));
- *result = process_handle;
+ // Set the output.
+ *result = tmp;
+
+ // We succeeded.
return ResultSuccess;
- }
default:
LOG_ERROR(Kernel_SVC, "Unimplemented svcGetInfo id=0x{:016X}", info_id);
return ResultInvalidEnumValue;