From 97f262c1f5c39e51d6fe2e32429610599299db60 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 4 Oct 2017 12:23:08 -0500 Subject: [PATCH] SVC: Removed GetPointer usage in the GetResourceLimit functions. --- src/core/hle/svc.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index b72ca3581..e8ca419d5 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp @@ -644,9 +644,9 @@ static ResultCode GetResourceLimit(Kernel::Handle* resource_limit, Kernel::Handl } /// Get resource limit current values -static ResultCode GetResourceLimitCurrentValues(s64* values, Kernel::Handle resource_limit_handle, - u32* names, u32 name_count) { - LOG_TRACE(Kernel_SVC, "called resource_limit=%08X, names=%p, name_count=%d", +static ResultCode GetResourceLimitCurrentValues(VAddr values, Kernel::Handle resource_limit_handle, + VAddr names, u32 name_count) { + LOG_TRACE(Kernel_SVC, "called resource_limit=%08X, names=%08X, name_count=%d", resource_limit_handle, names, name_count); SharedPtr resource_limit = @@ -654,16 +654,19 @@ static ResultCode GetResourceLimitCurrentValues(s64* values, Kernel::Handle reso if (resource_limit == nullptr) return ERR_INVALID_HANDLE; - for (unsigned int i = 0; i < name_count; ++i) - values[i] = resource_limit->GetCurrentResourceValue(names[i]); + for (unsigned int i = 0; i < name_count; ++i) { + u32 name = Memory::Read32(names + i * sizeof(u32)); + s64 value = resource_limit->GetCurrentResourceValue(name); + Memory::Write64(values + i * sizeof(u64), value); + } return RESULT_SUCCESS; } /// Get resource limit max values -static ResultCode GetResourceLimitLimitValues(s64* values, Kernel::Handle resource_limit_handle, - u32* names, u32 name_count) { - LOG_TRACE(Kernel_SVC, "called resource_limit=%08X, names=%p, name_count=%d", +static ResultCode GetResourceLimitLimitValues(VAddr values, Kernel::Handle resource_limit_handle, + VAddr names, u32 name_count) { + LOG_TRACE(Kernel_SVC, "called resource_limit=%08X, names=%08X, name_count=%d", resource_limit_handle, names, name_count); SharedPtr resource_limit = @@ -671,8 +674,11 @@ static ResultCode GetResourceLimitLimitValues(s64* values, Kernel::Handle resour if (resource_limit == nullptr) return ERR_INVALID_HANDLE; - for (unsigned int i = 0; i < name_count; ++i) - values[i] = resource_limit->GetMaxResourceValue(names[i]); + for (unsigned int i = 0; i < name_count; ++i) { + u32 name = Memory::Read32(names + i * sizeof(u32)); + s64 value = resource_limit->GetMaxResourceValue(names); + Memory::Write64(values + i * sizeof(u64), value); + } return RESULT_SUCCESS; }