Exemple #1
0
        protected static void MakeObject(ServiceCtx context, IpcService obj)
        {
            IpcService service = context.Session.Service;

            if (service._isDomain)
            {
                context.Response.ObjectIds.Add(service.Add(obj));
            }
            else
            {
                KSession session = new KSession(context.Device.System.KernelContext);

                session.ClientSession.Service = obj;

                if (context.Process.HandleTable.GenerateHandle(session.ClientSession, out int handle) != KernelResult.Success)
                {
                    throw new InvalidOperationException("Out of handles!");
                }

                session.ServerSession.DecrementReferenceCount();
                session.ClientSession.DecrementReferenceCount();

                context.Response.HandleDesc = IpcHandleDesc.MakeMove(handle);
            }
        }
Exemple #2
0
        protected static void MakeObject(ServiceCtx Context, IpcService Obj)
        {
            IpcService Service = Context.Session.Service;

            if (Service.IsDomain)
            {
                Context.Response.ObjectIds.Add(Service.Add(Obj));
            }
            else
            {
                KSession Session = new KSession(Obj, Context.Session.ServiceName);

                int Handle = Context.Process.HandleTable.OpenHandle(Session);

                Context.Response.HandleDesc = IpcHandleDesc.MakeMove(Handle);
            }
        }
Exemple #3
0
        protected void MakeObject(ServiceCtx context, IpcService obj)
        {
            obj.TrySetServer(_parent.Server);

            if (_parent._isDomain)
            {
                obj._parent = _parent;

                context.Response.ObjectIds.Add(_parent.Add(obj));
            }
            else
            {
                context.Device.System.KernelContext.Syscall.CreateSession(false, 0, out int serverSessionHandle, out int clientSessionHandle);

                obj.Server.AddSessionObj(serverSessionHandle, obj);

                context.Response.HandleDesc = IpcHandleDesc.MakeMove(clientSessionHandle);
            }
        }
Exemple #4
0
        protected static void MakeObject(ServiceCtx context, IpcService obj)
        {
            IpcService service = context.Session.Service;

            if (service._isDomain)
            {
                context.Response.ObjectIds.Add(service.Add(obj));
            }
            else
            {
                KSession session = new KSession(obj, context.Session.ServiceName);

                if (context.Process.HandleTable.GenerateHandle(session, out int handle) != KernelResult.Success)
                {
                    throw new InvalidOperationException("Out of handles!");
                }

                context.Response.HandleDesc = IpcHandleDesc.MakeMove(handle);
            }
        }
Exemple #5
0
        protected static void MakeObject(ServiceCtx Context, IpcService Obj)
        {
            IpcService Service = Context.Session.Service;

            if (Service.IsDomain)
            {
                Context.Response.ObjectIds.Add(Service.Add(Obj));
            }
            else
            {
                KSession Session = new KSession(Obj, Context.Session.ServiceName);

                if (Context.Process.HandleTable.GenerateHandle(Session, out int Handle) != KernelResult.Success)
                {
                    throw new InvalidOperationException("Out of handles!");
                }

                Context.Response.HandleDesc = IpcHandleDesc.MakeMove(Handle);
            }
        }