public static XDRPCReference AllocateRPC(
     this IXboxConsole console,
     XDRPCArgumentInfo lpvBufArg,
     XDRPCMode mode)
 {
     if (lpvBufArg.PassBy == ArgumentType.ByValue)
     {
         throw new XDRPCInvalidOperationException("Allocating XDRPCArgumentInfo with ByValue argument type is not allowed.");
     }
     if (lpvBufArg.GetRequiredReferenceSize() > 0)
     {
         throw new XDRPCInvalidOperationException("Struct type containing references is not supported by the XDRPC allocation system. You will need to use the XDRPC allocation system to create the data for the references on the Xbox and change the struct to have uints filled with the XDRPCReference.Pointer values for that data instead of the references. See the How to Use XDRPC documentation for more info.");
     }
     return(console.AllocateRPC(lpvBufArg.GetRequiredBufferSize(), mode));
 }
        public static XDRPCReference AllocateRPC <T>(
            this IXboxConsole console,
            XDRPCMode mode)
            where T : struct
        {
            Type t = typeof(T);

            if (!XDRPCMarshaler.IsValidArgumentType(t))
            {
                throw new XDRPCInvalidTypeException(t, string.Format("Invalid type {0}: Cannot allocate type not supported by XDRPC.", (object)t.Name));
            }
            XDRPCArgumentInfo argumentInfo = XDRPCMarshaler.GenerateArgumentInfo(t, (object)default(T), ArgumentType.ByRef);

            return(console.AllocateRPC(argumentInfo, mode));
        }
 public static XDRPCReference AllocateRPC(
     this IXboxConsole console,
     XDRPCArgumentInfo lpvBufArg)
 {
     return(console.AllocateRPC(lpvBufArg, XDRPCMode.System));
 }
 public static XDRPCReference AllocateRPC(this IXboxConsole console, int size)
 {
     return(console.AllocateRPC(size, XDRPCMode.System));
 }
 public static XDRPCReference AllocateRPC <T>(this IXboxConsole console) where T : struct
 {
     return(console.AllocateRPC <T>(XDRPCMode.System));
 }