0
0
Fork 0
mirror of https://github.com/ryujinx-mirror/ryujinx.git synced 2024-12-27 17:45:46 +00:00
ryujinx-fork/Ryujinx/OsHle/Objects/ObjHelper.cs
Stary 2001 2f2b60db4c Make HSessionObj implement IDisposable (#10)
* Make HSessionObj implement IDisposable, so that objects that have handles created to them are disposed when the handles are closed.

* Spelling fix: GenertateObjectId -> GenerateObjectId
2018-02-10 15:31:40 -03:00

24 lines
No EOL
651 B
C#

using Ryujinx.OsHle.Handles;
using Ryujinx.OsHle.Ipc;
namespace Ryujinx.OsHle.Objects
{
static class ObjHelper
{
public static void MakeObject(ServiceCtx Context, object Obj)
{
if (Context.Session is HDomain Dom)
{
Context.Response.ResponseObjIds.Add(Dom.GenerateObjectId(Obj));
}
else
{
HSessionObj HndData = new HSessionObj(Context.Session, Obj);
int VHandle = Context.Ns.Os.Handles.GenerateId(HndData);
Context.Response.HandleDesc = IpcHandleDesc.MakeMove(VHandle);
}
}
}
}