internal MQMessageDescriptor(MQMessageDescriptor md) { MQMD mQMD = md.mqmd; this.mqmd.StrucId = (byte[])this.mqmd.StrucId.Clone(); this.mqmd.Version = mQMD.Version; this.mqmd.Report = mQMD.Report; this.mqmd.MsgType = mQMD.MsgType; this.mqmd.Expiry = mQMD.Expiry; this.mqmd.Feedback = mQMD.Feedback; this.mqmd.Encoding = mQMD.Encoding; this.mqmd.CodedCharacterSetId = mQMD.CodedCharacterSetId; this.mqmd.Format = (byte[])mQMD.Format.Clone(); this.mqmd.Priority = mQMD.Priority; this.mqmd.Persistence = mQMD.Persistence; this.mqmd.MsgId = (byte[])mQMD.MsgId.Clone(); this.mqmd.CorrelId = (byte[])mQMD.CorrelId.Clone(); this.mqmd.BackoutCount = mQMD.BackoutCount; this.mqmd.ReplyToQ = (byte[])mQMD.ReplyToQ.Clone(); this.mqmd.ReplyToQMgr = (byte[])mQMD.ReplyToQMgr.Clone(); this.mqmd.UserId = (byte[])mQMD.UserId.Clone(); this.mqmd.AccountingToken = (byte[])mQMD.AccountingToken.Clone(); this.mqmd.ApplIdentityData = (byte[])mQMD.ApplIdentityData.Clone(); this.mqmd.PutApplType = mQMD.PutApplType; this.mqmd.PutApplName = (byte[])mQMD.PutApplName.Clone(); this.mqmd.PutDate = (byte[])mQMD.PutDate.Clone(); this.mqmd.PutTime = (byte[])mQMD.PutTime.Clone(); this.mqmd.ApplOriginData = (byte[])mQMD.ApplOriginData.Clone(); this.mqmd.GroupId = (byte[])mQMD.GroupId.Clone(); this.mqmd.MsgSequenceNumber = mQMD.MsgSequenceNumber; this.mqmd.Offset = mQMD.Offset; this.mqmd.MsgFlags = mQMD.MsgFlags; this.mqmd.OriginalLength = mQMD.OriginalLength; }
internal int ReadStruct(byte[] b, int Offset) { IntPtr intPtr = IntPtr.Zero; int num = this.GetLength(); int num2 = 0; intPtr = Marshal.AllocCoTaskMem(num); if (num > b.Length - Offset) { num = b.Length - Offset; } Marshal.Copy(b, Offset, intPtr, num); this.mqmd = (MQMD)Marshal.PtrToStructure(intPtr, typeof(MQMD)); this.ClearInvalidFields(this.mqmd.Version); Marshal.FreeCoTaskMem(intPtr); num2 = Offset + this.GetVersionLength(); return(num2); }