internal MQSPI(int VerbId, int OutStructVersion, int OutStructLength) { base.TrConstructor("%Z% %W% %I% %E% %U%", new object[] { VerbId, OutStructVersion, OutStructLength }); this.spi = new structMQSPI(); this.spi.verbId = VerbId; this.spi.outStructVersion = OutStructVersion; this.spi.outStructLength = OutStructLength; }
internal int ReadStruct(byte[] b, int Offset) { uint method = 0x278; this.TrEntry(method, new object[] { b, Offset }); IntPtr zero = IntPtr.Zero; int result = 0; int length = this.GetLength(); try { zero = Marshal.AllocCoTaskMem(length); Marshal.Copy(b, Offset, zero, length); this.spi = (structMQSPI)Marshal.PtrToStructure(zero, typeof(structMQSPI)); Marshal.FreeCoTaskMem(zero); result = Offset + length; } finally { base.TrExit(method, result); } return(result); }