Ejemplo n.º 1
0
        protected T GetObject <T>(ServiceCtx context, int index) where T : IpcService
        {
            int objId = context.Request.ObjectIds[index];

            IpcService obj = _parent.GetObject(objId);

            return(obj is T t ? t : null);
        }
Ejemplo n.º 2
0
        protected static T GetObject <T>(ServiceCtx context, int index) where T : IpcService
        {
            IpcService service = context.Session.Service;

            if (!service._isDomain)
            {
                int handle = context.Request.HandleDesc.ToMove[index];

                KSession session = context.Process.HandleTable.GetObject <KSession>(handle);

                return(session?.Service is T ? (T)session.Service : null);
            }

            int objId = context.Request.ObjectIds[index];

            IIpcService obj = service.GetObject(objId);

            return(obj is T ? (T)obj : null);
        }
Ejemplo n.º 3
0
        protected static T GetObject <T>(ServiceCtx Context, int Index) where T : IpcService
        {
            IpcService Service = Context.Session.Service;

            if (!Service.IsDomain)
            {
                int Handle = Context.Request.HandleDesc.ToMove[Index];

                KSession Session = Context.Process.HandleTable.GetObject <KSession>(Handle);

                return(Session?.Service is T ? (T)Session.Service : null);
            }

            int ObjId = Context.Request.ObjectIds[Index];

            IIpcService Obj = Service.GetObject(ObjId);

            return(Obj is T ? (T)Obj : null);
        }