Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
 public static XDRPCReference AllocateRPC(
     this IXboxConsole console,
     XDRPCArgumentInfo lpvBufArg)
 {
     return(console.AllocateRPC(lpvBufArg, XDRPCMode.System));
 }
Exemplo n.º 4
0
 public static XDRPCReference AllocateRPC(this IXboxConsole console, int size)
 {
     return(console.AllocateRPC(size, XDRPCMode.System));
 }
Exemplo n.º 5
0
 public static XDRPCReference AllocateRPC <T>(this IXboxConsole console) where T : struct
 {
     return(console.AllocateRPC <T>(XDRPCMode.System));
 }