Esempio n. 1
0
 public LpiSD()
 {
     base.TrConstructor("%Z% %W% %I% %E% %U%");
     this.lpiSD           = new structLPISD();
     this.lpiSD32         = new structLPISD32();
     this.StructId        = new byte[] { 0x4c, 0x53, 0x44, 0x20 };
     this.Version         = 1;
     this.Options         = 0;
     this.subIdentity     = new MQCHARV(true, false);
     this.SubId           = new byte[0x18];
     this.DestReadAhead   = 0;
     this.DestOpenOptions = 0;
     this.LpiSubProps     = new MQBase.structLPISDSUBPROPS();
     this.useNativePtrSz  = true;
 }
Esempio n. 2
0
        public int ReadStruct(byte[] b, int Offset)
        {
            uint method = 0x356;

            this.TrEntry(method, new object[] { b, Offset });
            IntPtr zero = IntPtr.Zero;
            int    num2 = 0;
            int    requiredBufferSize = this.GetRequiredBufferSize();

            if (requiredBufferSize > (b.Length - Offset))
            {
                requiredBufferSize = b.Length - Offset;
            }
            try
            {
                zero = Marshal.AllocCoTaskMem(requiredBufferSize);
                this.lpiSDStructSize = requiredBufferSize;
                Marshal.Copy(b, Offset, zero, requiredBufferSize);
                if (this.useNativePtrSz)
                {
                    this.lpiSD = (structLPISD)Marshal.PtrToStructure(zero, typeof(structLPISD));
                    this.copyToLpiSD32();
                }
                else
                {
                    this.lpiSD32 = (structLPISD32)Marshal.PtrToStructure(zero, typeof(structLPISD32));
                    this.copyToLpiSD();
                }
                num2 = Offset + requiredBufferSize;
                this.subIdentity.ReadStruct(b, Offset, Offset + 0x20);
                this.subIdentity.GetEndPosAligned(Offset);
            }
            finally
            {
                Marshal.FreeCoTaskMem(zero);
                base.TrExit(method);
            }
            return(num2);
        }