public int ReadStruct(byte[] b, int Offset) { uint method = 0x4a3; this.TrEntry(method, new object[] { b, Offset }); IntPtr zero = IntPtr.Zero; int length = this.GetLength(); try { zero = Marshal.AllocCoTaskMem(length); if (length > (b.Length - Offset)) { length = b.Length - Offset; } try { Marshal.Copy(b, Offset, zero, length); this.spiOpenOptions = (MQBase.structSPIOPENOPTIONS)Marshal.PtrToStructure(zero, typeof(MQBase.structSPIOPENOPTIONS)); } finally { Marshal.FreeCoTaskMem(zero); } } finally { base.TrExit(method); } return(Offset + this.GetLength()); }
public SpiOpenOptions() { base.TrConstructor("%Z% %W% %I% %E% %U%"); this.spiOpenOptions = new MQBase.structSPIOPENOPTIONS(); this.spiOpenOptions.structId = new byte[] { 0x4c, 80, 0x4f, 0x4f }; this.spiOpenOptions.version = 1; this.spiOpenOptions.options = 0; this.spiOpenOptions.lpiOpts = 0; this.spiOpenOptions.defPersistence = -1; this.spiOpenOptions.defPutResponseType = -1; this.spiOpenOptions.defReadAhead = -1; this.spiOpenOptions.propertyControl = -1; }