mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-11-15 09:35:27 +00:00
Ensure SM service won't listen to closed sessions (#6246)
* Ensure SM service won't listen to closed sessions * PR feedback
This commit is contained in:
parent
c94f0fbb83
commit
d704bcd93b
|
@ -287,6 +287,10 @@ namespace Ryujinx.HLE.HOS.Services
|
||||||
_wakeEvent.WritableEvent.Clear();
|
_wakeEvent.WritableEvent.Clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (rc == KernelResult.PortRemoteClosed && signaledIndex >= 0)
|
||||||
|
{
|
||||||
|
DestroySession(handles[signaledIndex]);
|
||||||
|
}
|
||||||
|
|
||||||
_selfProcess.CpuMemory.Write(messagePtr + 0x0, 0);
|
_selfProcess.CpuMemory.Write(messagePtr + 0x0, 0);
|
||||||
_selfProcess.CpuMemory.Write(messagePtr + 0x4, 2 << 10);
|
_selfProcess.CpuMemory.Write(messagePtr + 0x4, 2 << 10);
|
||||||
|
@ -299,6 +303,16 @@ namespace Ryujinx.HLE.HOS.Services
|
||||||
Dispose();
|
Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void DestroySession(int serverSessionHandle)
|
||||||
|
{
|
||||||
|
_context.Syscall.CloseHandle(serverSessionHandle);
|
||||||
|
|
||||||
|
if (RemoveSessionObj(serverSessionHandle, out var session))
|
||||||
|
{
|
||||||
|
(session as IDisposable)?.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private bool Process(int serverSessionHandle, ulong recvListAddr)
|
private bool Process(int serverSessionHandle, ulong recvListAddr)
|
||||||
{
|
{
|
||||||
IpcMessage request = ReadRequest();
|
IpcMessage request = ReadRequest();
|
||||||
|
@ -412,11 +426,7 @@ namespace Ryujinx.HLE.HOS.Services
|
||||||
}
|
}
|
||||||
else if (request.Type == IpcMessageType.CmifCloseSession || request.Type == IpcMessageType.TipcCloseSession)
|
else if (request.Type == IpcMessageType.CmifCloseSession || request.Type == IpcMessageType.TipcCloseSession)
|
||||||
{
|
{
|
||||||
_context.Syscall.CloseHandle(serverSessionHandle);
|
DestroySession(serverSessionHandle);
|
||||||
if (RemoveSessionObj(serverSessionHandle, out var session))
|
|
||||||
{
|
|
||||||
(session as IDisposable)?.Dispose();
|
|
||||||
}
|
|
||||||
shouldReply = false;
|
shouldReply = false;
|
||||||
}
|
}
|
||||||
// If the type is past 0xF, we are using TIPC
|
// If the type is past 0xF, we are using TIPC
|
||||||
|
|
Loading…
Reference in a new issue