Beispiel #1
0
 public static T ExecuteRPC <T>(
     this IXboxConsole console,
     XDRPCExecutionOptions options,
     out ulong postMethodCallReturn)
     where T : struct
 {
     XDRPCArgumentInfo[] xdrpcArgumentInfoArray = new XDRPCArgumentInfo[0];
     return(XDRPCMarshaler.ExecuteRPC <T>(console, options, out postMethodCallReturn, xdrpcArgumentInfoArray));
 }
Beispiel #2
0
 public static T ExecuteRPC <T>(
     this IXboxConsole console,
     XDRPCExecutionOptions options,
     params object[] args)
     where T : struct
 {
     XDRPCArgumentInfo[] argumentInfoArray = XDRPCMarshaler.GenerateArgumentInfoArray(args);
     return(XDRPCMarshaler.ExecuteRPC <T>(console, options, argumentInfoArray));
 }
Beispiel #3
0
        public static T ExecuteRPC <T>(
            this IXboxConsole console,
            XDRPCExecutionOptions options,
            params XDRPCArgumentInfo[] args)
            where T : struct
        {
            ulong postMethodCallReturn;

            return(XDRPCMarshaler.ExecuteRPC <T>(console, options, out postMethodCallReturn, args));
        }
Beispiel #4
0
        private void Get(XDRPCArgumentInfo lpvBufArg)
        {
            int num = this.ValidateSize(lpvBufArg, nameof(Get));
            XDRPCExecutionOptions    options            = new XDRPCExecutionOptions(XDRPCMode.System, "xbdm.xex", 10);
            XDRPCArgumentInfo <uint> argumentInfo       = this.GetArgumentInfo();
            XDRPCArgumentInfo <int>  xdrpcArgumentInfo1 = new XDRPCArgumentInfo <int>(num);
            XDRPCArgumentInfo <int>  xdrpcArgumentInfo2 = new XDRPCArgumentInfo <int>(0, ArgumentType.Out);

            this.ValidateReturn(XDRPCMarshaler.ExecuteRPC <int>(this.XboxConsole, options, (XDRPCArgumentInfo)argumentInfo, (XDRPCArgumentInfo)xdrpcArgumentInfo1, lpvBufArg, (XDRPCArgumentInfo)xdrpcArgumentInfo2), nameof(Get));
            this.ValidateReturnSize(xdrpcArgumentInfo2.Value, num, nameof(Get));
        }
Beispiel #5
0
        public static T ExecuteRPC <T>(
            this IXboxConsole console,
            string threadName,
            uint functionAddress,
            params object[] args)
            where T : struct
        {
            XDRPCExecutionOptions options = new XDRPCExecutionOptions(threadName, functionAddress);

            XDRPCArgumentInfo[] argumentInfoArray = XDRPCMarshaler.GenerateArgumentInfoArray(args);
            return(XDRPCMarshaler.ExecuteRPC <T>(console, options, argumentInfoArray));
        }
Beispiel #6
0
        public static T ExecuteRPC <T>(
            this IXboxConsole console,
            XDRPCMode mode,
            string module,
            int ordinal,
            params object[] args)
            where T : struct
        {
            XDRPCExecutionOptions options = new XDRPCExecutionOptions(mode, module, ordinal);

            XDRPCArgumentInfo[] argumentInfoArray = XDRPCMarshaler.GenerateArgumentInfoArray(args);
            return(XDRPCMarshaler.ExecuteRPC <T>(console, options, argumentInfoArray));
        }
Beispiel #7
0
        public static T ExecuteRPC <T>(
            this IXboxConsole console,
            string threadName,
            string module,
            int ordinal,
            out ulong postMethodCallReturn,
            params object[] args)
            where T : struct
        {
            XDRPCExecutionOptions options = new XDRPCExecutionOptions(threadName, module, ordinal);

            XDRPCArgumentInfo[] argumentInfoArray = XDRPCMarshaler.GenerateArgumentInfoArray(args);
            return(XDRPCMarshaler.ExecuteRPC <T>(console, options, out postMethodCallReturn, argumentInfoArray));
        }
Beispiel #8
0
        public static T ExecuteRPC <T>(
            this IXboxConsole console,
            XDRPCExecutionOptions options,
            out ulong postMethodCallReturn,
            params XDRPCArgumentInfo[] args)
            where T : struct
        {
            Type t = typeof(T);

            postMethodCallReturn = 0UL;
            if (!XDRPCMarshaler.IsValidReturnType(t))
            {
                if (!t.IsValueType)
                {
                    throw new XDRPCInvalidReturnTypeException(t);
                }
                XDRPCStructArgumentInfo <T> structArgumentInfo     = new XDRPCStructArgumentInfo <T>(default(T), ArgumentType.Out);
                XDRPCArgumentInfo[]         xdrpcArgumentInfoArray = new XDRPCArgumentInfo[args.Length + 1];
                xdrpcArgumentInfoArray[0] = (XDRPCArgumentInfo)structArgumentInfo;
                Array.Copy((Array)args, 0, (Array)xdrpcArgumentInfoArray, 1, args.Length);
                int num = (int)XDRPCMarshaler.ExecuteRPC <uint>(console, options, xdrpcArgumentInfoArray);
                return(structArgumentInfo.Value);
            }
            XDRPCExecutionState.XDRPCCallFlags flags = XDRPCExecutionState.XDRPCCallFlags.IntegerReturn;
            if (t == typeof(float) || t == typeof(double))
            {
                flags = XDRPCExecutionState.XDRPCCallFlags.FloatingPointReturn;
            }
            XDRPCExecutionState xdrpcExecutionState = new XDRPCExecutionState(console, options, args, flags);

            xdrpcExecutionState.NoDevkit = XDRPCMarshaler.NoDevkit;
            xdrpcExecutionState.Invoke();
            if (options.PostMethodCall != XDRPCPostMethodCall.None)
            {
                postMethodCallReturn = xdrpcExecutionState.PostMethodCallReturnValue;
            }
            object obj = XDRPCMarshaler.UnpackReturnType(t, xdrpcExecutionState.ReturnValue);

            if (obj == null)
            {
                return(default(T));
            }
            return((T)obj);
        }