示例#1
0
        internal int ReadStruct(NmqiEnvironment env, byte[] b, int Offset)
        {
            uint method = 0x49e;

            this.TrEntry(method, new object[] { env, b, Offset });
            IntPtr zero    = IntPtr.Zero;
            int    cb      = 0;
            int    version = BitConverter.ToInt32(b, Offset + 4);

            cb   = GetLength(env, version, 4);
            zero = Marshal.AllocCoTaskMem(cb);
            if (cb > (b.Length - Offset))
            {
                cb = b.Length - Offset;
            }
            try
            {
                Marshal.Copy(b, Offset, zero, cb);
                this.spiConnectOptions = (structSPICONNECTOPTIONS)Marshal.PtrToStructure(zero, typeof(structSPICONNECTOPTIONS));
            }
            finally
            {
                Marshal.FreeCoTaskMem(zero);
                base.TrExit(method);
            }
            return(Offset + GetLength(env, version, 4));
        }
示例#2
0
 public SpiConnectOptions()
 {
     base.TrConstructor("%Z% %W%  %I% %E% %U%");
     this.spiConnectOptions                 = new structSPICONNECTOPTIONS();
     this.spiConnectOptions.structId        = new byte[] { 0x4c, 0x43, 0x4e, 0x4f };
     this.spiConnectOptions.version         = 1;
     this.spiConnectOptions.options         = 0;
     this.spiConnectOptions.connectionClass = 0;
     this.spiConnectOptions.authToken       = 0;
     this.spiConnectOptions.uuid            = new byte[0x30];
     this.spiConnectOptions.cluster         = new byte[0x30];
     this.spiConnectOptions.pRecipientUUID  = IntPtr.Zero;
     this.spiConnectOptions.qmOffset        = 0;
     this.spiConnectOptions.pChannelName    = IntPtr.Zero;
     this.spiConnectOptions.environment     = IntPtr.Zero;
     this.spiConnectOptions.channel         = IntPtr.Zero;
     this.spiConnectOptions.connectionName  = IntPtr.Zero;
     this.spiConnectOptions.cmdLevel        = 0;
     this.spiConnectOptions.subCmdLevel     = new int[4];
 }