From 9d688e37d68dd88770ce0e4c7b133645ef7d0eec Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 14 Jul 2021 14:09:00 -0300 Subject: [PATCH] Close transfer memory properly on nvservices (#2477) --- Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs b/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs index 24c784c3fa..9efe206fc5 100644 --- a/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs +++ b/Ryujinx.HLE/HOS/Services/Nv/INvDrvServices.cs @@ -314,7 +314,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv public ResultCode Initialize(ServiceCtx context) { long transferMemSize = context.RequestData.ReadInt64(); - int transferMemHandle = context.Request.HandleDesc.ToCopy[0]; + int transferMemHandle = context.Request.HandleDesc.ToCopy[1]; // TODO: When transfer memory will be implemented, this could be removed. _transferMemInitialized = true; @@ -327,7 +327,8 @@ namespace Ryujinx.HLE.HOS.Services.Nv context.ResponseData.Write((uint)NvResult.Success); - // Close transfer memory immediately as we don't use it. + // Close the process and transfer memory handles immediately as we don't use them. + context.Device.System.KernelContext.Syscall.CloseHandle(clientHandle); context.Device.System.KernelContext.Syscall.CloseHandle(transferMemHandle); return ResultCode.Success;