Forráskód Böngészése

kernel/svc: Correct output parameter for svcGetProcessId

svcGetProcessId's out parameter is a pointer to a 64-bit value, not a
32-bit one.
Lioncash 7 éve
szülő
commit
43e1189688
2 módosított fájl, 10 hozzáadás és 2 törlés
  1. 1 1
      src/core/hle/kernel/svc.cpp
  2. 9 1
      src/core/hle/kernel/svc_wrap.h

+ 1 - 1
src/core/hle/kernel/svc.cpp

@@ -365,7 +365,7 @@ static ResultCode GetThreadId(u32* thread_id, Handle thread_handle) {
 }
 }
 
 
 /// Get the ID of the specified process
 /// Get the ID of the specified process
-static ResultCode GetProcessId(u32* process_id, Handle process_handle) {
+static ResultCode GetProcessId(u64* process_id, Handle process_handle) {
     LOG_TRACE(Kernel_SVC, "called process=0x{:08X}", process_handle);
     LOG_TRACE(Kernel_SVC, "called process=0x{:08X}", process_handle);
 
 
     const auto& handle_table = Core::CurrentProcess()->GetHandleTable();
     const auto& handle_table = Core::CurrentProcess()->GetHandleTable();

+ 9 - 1
src/core/hle/kernel/svc_wrap.h

@@ -73,7 +73,15 @@ void SvcWrap() {
 template <ResultCode func(u32*, u64)>
 template <ResultCode func(u32*, u64)>
 void SvcWrap() {
 void SvcWrap() {
     u32 param_1 = 0;
     u32 param_1 = 0;
-    u32 retval = func(&param_1, Param(1)).raw;
+    const u32 retval = func(&param_1, Param(1)).raw;
+    Core::CurrentArmInterface().SetReg(1, param_1);
+    FuncReturn(retval);
+}
+
+template <ResultCode func(u64*, u32)>
+void SvcWrap() {
+    u64 param_1 = 0;
+    const u32 retval = func(&param_1, static_cast<u32>(Param(1))).raw;
     Core::CurrentArmInterface().SetReg(1, param_1);
     Core::CurrentArmInterface().SetReg(1, param_1);
     FuncReturn(retval);
     FuncReturn(retval);
 }
 }