public int ReadStruct(byte[] b, int Offset, int Length)
        {
            uint method = 0x341;

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

            try
            {
                if (zero == IntPtr.Zero)
                {
                    zero          = Marshal.AllocCoTaskMem(length);
                    this.mqSDSize = length;
                }
                Marshal.Copy(b, Offset, zero, length);
                if (this.useNativePtrSz)
                {
                    this.mqSD = (MQBase.MQSD)Marshal.PtrToStructure(zero, typeof(MQBase.MQSD));
                    this.copyToMQSD32();
                }
                else
                {
                    this.mqSD32 = (MQBase.MQSD32)Marshal.PtrToStructure(zero, typeof(MQBase.MQSD32));
                    this.copyToMQSD();
                }
                this.objectString.ReadStruct(b, Offset, Offset + this.OBJSTRING_OFFSET);
                this.objectString.GetEndPosAligned(Offset);
                this.subName.ReadStruct(b, Offset, Offset + this.SUBNAME_OFFSET);
                this.subName.GetEndPosAligned(Offset);
                this.subUserData.ReadStruct(b, Offset, Offset + this.SUBUSERDATA_OFFSET);
                this.subUserData.GetEndPosAligned(Offset);
                this.selectionString.ReadStruct(b, Offset, Offset + this.SELSTRING_OFFSET);
                this.selectionString.GetEndPosAligned(Offset);
                this.resObjectString.ReadStruct(b, Offset, Offset + this.ROBJSTRING_OFFSET);
                this.resObjectString.GetEndPosAligned(Offset);
                this.ClearInvalidFields(this.Version);
            }
            finally
            {
                if (zero != IntPtr.Zero)
                {
                    Marshal.FreeCoTaskMem(zero);
                    zero = IntPtr.Zero;
                }
                base.TrExit(method);
            }
            return((((((Offset + this.GetVersionLength()) + this.objectString.VSLength) + this.subName.VSLength) + this.subUserData.VSLength) + this.selectionString.VSLength) + this.resObjectString.VSLength);
        }
Example #2
0
 public static extern void MQSUB(int hConn, ref MQBase.MQSD mqsd, ref int hObj, out int hSub, out int compCode, out int reason);