示例#1
0
        public int ReadStruct(byte[] b, int Offset)
        {
            uint method = 0x430;

            this.TrEntry(method, new object[] { b, Offset });
            IntPtr zero      = IntPtr.Zero;
            int    hdrLength = this.GetHdrLength();

            try
            {
                zero = Marshal.AllocCoTaskMem(this.GetRequiredBufferSize());
                if (hdrLength > (b.Length - Offset))
                {
                    hdrLength = b.Length - Offset;
                }
                Marshal.Copy(b, Offset, zero, hdrLength);
                this.spiOpenOutHdr = (SPIOPENOUTHDR)Marshal.PtrToStructure(zero, typeof(SPIOPENOUTHDR));
                Marshal.FreeCoTaskMem(zero);
                Offset += this.GetHdrLength();
                Offset  = this.openOptions.ReadStruct(b, Offset);
                Offset  = this.mqod.ReadStruct(b, Offset, b.Length);
            }
            finally
            {
                base.TrExit(method, Offset);
            }
            return(Offset);
        }
示例#2
0
 public MQSPIOpenOut(NmqiEnvironment nmqiEnv, int version) : base(nmqiEnv)
 {
     base.TrConstructor("%Z% %W%  %I% %E% %U%", new object[] { nmqiEnv, version });
     this.spiOpenOutHdr    = new SPIOPENOUTHDR();
     this.spiOpenOutHdr.ID = rfpVB_ID_OPEN_OUT;
     this.Version          = version;
     this.openOptions      = new SpiOpenOptions();
     this.mqod             = new MQObjectDescriptor();
 }