コード例 #1
0
ファイル: MQCBC.cs プロジェクト: halfsilvered/TestCodes
        public int ReadStruct(byte[] b, int Offset)
        {
            uint method = 0x48e;

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

            zero = Marshal.AllocCoTaskMem(length);
            if (length > (b.Length - Offset))
            {
                length = b.Length - Offset;
            }
            try
            {
                Marshal.Copy(b, Offset, zero, length);
                this.mqcbc = (MQBase.structMQCBC)Marshal.PtrToStructure(zero, typeof(MQBase.structMQCBC));
            }
            finally
            {
                Marshal.FreeCoTaskMem(zero);
                base.TrExit(method);
            }
            return(Offset + this.GetLength());
        }
コード例 #2
0
ファイル: MQCBC.cs プロジェクト: halfsilvered/TestCodes
 public MQCBC()
 {
     base.TrConstructor("%Z% %W% %I% %E% %U%");
     this.mqcbc                = new MQBase.structMQCBC();
     this.mqcbc.strucId        = new byte[] { 0x43, 0x42, 0x43, 0x20 };
     this.mqcbc.version        = 1;
     this.mqcbc.callType       = 1;
     this.mqcbc.hobj           = -1;
     this.mqcbc.callbackArea   = IntPtr.Zero;
     this.mqcbc.connectionArea = IntPtr.Zero;
     this.mqcbc.compCode       = 0;
     this.mqcbc.reason         = 0;
     this.mqcbc.state          = 0;
     this.mqcbc.dataLength     = 0;
     this.mqcbc.bufferLength   = 0;
     this.mqcbc.flags          = 0;
 }