public int ReadStruct(byte[] b, int Offset) { uint method = 0x29f; this.TrEntry(method, new object[] { b, Offset }); IntPtr zero = IntPtr.Zero; int hdrLength = this.GetHdrLength(); int result = 0; try { zero = Marshal.AllocCoTaskMem(this.GetLength()); if (hdrLength > (b.Length - Offset)) { hdrLength = b.Length - Offset; } Marshal.Copy(b, Offset, zero, hdrLength); this.spiQueryOutHdr = (SPIQUERYOUTHDR)Marshal.PtrToStructure(zero, typeof(SPIQUERYOUTHDR)); hdrLength = this.GetHdrVersionLength(); for (int i = 0; i < this.spiQueryOutHdr.arraySize; i++) { int length = Marshal.SizeOf(this.verbArray[i]); Marshal.Copy(b, Offset + hdrLength, zero, length); this.verbArray[i] = (SPIQUERYVERB)Marshal.PtrToStructure(zero, typeof(SPIQUERYVERB)); hdrLength += length; } Marshal.FreeCoTaskMem(zero); result = Offset + hdrLength; } finally { base.TrExit(method, result); } return(result); }
public MQSPIQueryOut(int version) { base.TrConstructor("%Z% %W% %I% %E% %U%", new object[] { version }); this.spiQueryOutHdr = new SPIQUERYOUTHDR(); this.spiQueryOutHdr.ID = rfpVB_ID_QUERY_OUT; this.Version = version; this.spiQueryOutHdr.arraySize = 12; this.verbArray = new SPIQUERYVERB[this.spiQueryOutHdr.arraySize]; for (int i = 0; i < this.verbArray.Length; i++) { SPIQUERYVERB spiqueryverb1 = this.verbArray[i]; } }