Exemplo n.º 1
0
        private static int ProcessIoctl(ServiceCtx context, int cmd, IoctlProcessor processor)
        {
            if (CmdIn(cmd) && context.Request.GetBufferType0x21().Position == 0)
            {
                Logger.PrintError(LogClass.ServiceNv, "Input buffer is null!");

                return(NvResult.InvalidInput);
            }

            if (CmdOut(cmd) && context.Request.GetBufferType0x22().Position == 0)
            {
                Logger.PrintError(LogClass.ServiceNv, "Output buffer is null!");

                return(NvResult.InvalidInput);
            }

            return(processor(context, cmd));
        }
Exemplo n.º 2
0
        private static int ProcessIoctl(ServiceCtx Context, int Cmd, IoctlProcessor Processor)
        {
            if (CmdIn(Cmd) && Context.Request.GetBufferType0x21().Position == 0)
            {
                Context.Ns.Log.PrintError(LogClass.ServiceNv, "Input buffer is null!");

                return(NvResult.InvalidInput);
            }

            if (CmdOut(Cmd) && Context.Request.GetBufferType0x22().Position == 0)
            {
                Context.Ns.Log.PrintError(LogClass.ServiceNv, "Output buffer is null!");

                return(NvResult.InvalidInput);
            }

            return(Processor(Context, Cmd));
        }
Exemplo n.º 3
0
        protected static NvInternalResult CallIoctlMethod <T>(IoctlProcessor <T> callback, Span <byte> arguments) where T : struct
        {
            Debug.Assert(arguments.Length == Unsafe.SizeOf <T>());

            return(PrintResult(callback.Method, callback(ref MemoryMarshal.Cast <byte, T>(arguments)[0])));
        }