示例#1
0
        [Command(11)] // 3.0.0+
        // Ioctl2(u32, u32, buffer<bytes, 0x21>, buffer<bytes, 0x21>) -> (u32, buffer<bytes, 0x22>)
        public ResultCode Ioctl(ServiceCtx context)
        {
            int fd  = context.RequestData.ReadInt32();
            int cmd = context.RequestData.ReadInt32();

            NvFd fdData = Fds.GetData <NvFd>(context.Process, fd);

            int result = 0;

            if (_ioctlProcessors.TryGetValue(fdData.Name, out IoctlProcessor process))
            {
                result = process(context, cmd);
            }
            else if (!ServiceConfiguration.IgnoreMissingServices)
            {
                throw new NotImplementedException($"{fdData.Name} {cmd:x4}");
            }

            // TODO: Verify if the error codes needs to be translated.
            context.ResponseData.Write(result);

            return(ResultCode.Success);
        }
示例#2
0
        public long Ioctl(ServiceCtx Context)
        {
            int Fd  = Context.RequestData.ReadInt32();
            int Cmd = Context.RequestData.ReadInt32();

            NvFd FdData = Fds.GetData <NvFd>(Context.Process, Fd);

            int Result;

            if (IoctlProcessors.TryGetValue(FdData.Name, out IoctlProcessor Process))
            {
                Result = Process(Context, Cmd);
            }
            else
            {
                throw new NotImplementedException($"{FdData.Name} {Cmd:x4}");
            }

            //TODO: Verify if the error codes needs to be translated.
            Context.ResponseData.Write(Result);

            return(0);
        }