internal MQCHARV(bool input, bool output) { this.isInputCapable = input; this.isOutputCapable = output; this.useNativePtrSz = true; this.mqcharv = default(MQBase.structMQCHARV); this.mqcharv32 = default(MQBase.structMQCHARV32); this.vsString = ""; this.VSCCSID = 1208; this.VSLength = 0; this.VSBufSize = 0; this.VSOffset = 0; this.VSPtr = IntPtr.Zero; this.VSPtr32 = 0; }
internal MQCHARV(bool input, bool output) { base.TrConstructor("%Z% %W% %I% %E% %U%", new object[] { input, output }); this.isInputCapable = input; this.isOutputCapable = output; this.useNativePtrSz = true; this.mqcharv = new MQBase.structMQCHARV(); this.mqcharv32 = new MQBase.structMQCHARV32(); this.vsString = ""; this.VSCCSID = 0x4b8; this.VSLength = 0; this.VSBufSize = 0; this.VSOffset = 0; this.VSPtr = IntPtr.Zero; this.VSPtr32 = 0; }
internal int ReadStruct(byte[] b, int structPos, int offset) { uint method = 0x35e; this.TrEntry(method, new object[] { b, structPos, offset }); int length = this.GetLength(); IntPtr zero = IntPtr.Zero; try { if (zero == IntPtr.Zero) { zero = Marshal.AllocCoTaskMem(length); } Marshal.Copy(b, offset, zero, length); if (this.useNativePtrSz) { this.mqcharv = (MQBase.structMQCHARV)Marshal.PtrToStructure(zero, typeof(MQBase.structMQCHARV)); } else { this.mqcharv32 = (MQBase.structMQCHARV32)Marshal.PtrToStructure(zero, typeof(MQBase.structMQCHARV32)); } if (this.VSLength != 0) { int index = structPos + this.VSOffset; if (this.VSLength == -1) { this.VSLength = 0; int num4 = index; while (b[num4] != 0) { num4++; this.VSLength++; } } if (this.isOutputCapable) { int count = Math.Min(this.VSLength, this.VSBufSize); if (count != 0) { this.vsString = Encoding.ASCII.GetString(b, index, count); return(length); } this.vsString = null; } return(length); } this.VSOffset = 0; } finally { if (zero != IntPtr.Zero) { Marshal.FreeCoTaskMem(zero); zero = IntPtr.Zero; } base.TrExit(method); } return(length); }
private void ClearInvalidFields(int ver) { uint method = 0x33b; this.TrEntry(method, new object[] { ver }); if (ver == 0) { this.StrucId = new byte[] { 0x53, 0x44, 0x20, 0x20 }; this.ObjectName = ""; this.AlternateUserId = ""; this.AlternateSecurityId = ""; this.SubExpiry = -1; this.SubCorrelId = ""; this.PubPriority = -3; this.PubAccountingToken = ""; this.PubApplIdentityData = ""; MQBase.structMQCHARV tmqcharv = new MQBase.structMQCHARV(); tmqcharv.VSPtr = IntPtr.Zero; tmqcharv.VSOffset = 0; tmqcharv.VSLength = 0; tmqcharv.VSCCSID = 0x4b8; this.mqSD.ObjectString = tmqcharv; MQBase.structMQCHARV tmqcharv2 = new MQBase.structMQCHARV(); tmqcharv2.VSPtr = IntPtr.Zero; tmqcharv2.VSOffset = 0; tmqcharv2.VSLength = 0; tmqcharv2.VSCCSID = 0x4b8; this.mqSD.SubName = tmqcharv2; MQBase.structMQCHARV tmqcharv3 = new MQBase.structMQCHARV(); tmqcharv3.VSPtr = IntPtr.Zero; tmqcharv3.VSOffset = 0; tmqcharv3.VSLength = 0; tmqcharv3.VSCCSID = 0x4b8; this.mqSD.SubUserData = tmqcharv3; MQBase.structMQCHARV tmqcharv4 = new MQBase.structMQCHARV(); tmqcharv4.VSPtr = IntPtr.Zero; tmqcharv4.VSOffset = 0; tmqcharv4.VSLength = 0; tmqcharv4.VSCCSID = 0x4b8; this.mqSD.SelectionString = tmqcharv4; this.SubLevel = 1; MQBase.structMQCHARV tmqcharv5 = new MQBase.structMQCHARV(); tmqcharv5.VSPtr = IntPtr.Zero; tmqcharv5.VSOffset = 0; tmqcharv5.VSLength = 0; tmqcharv5.VSCCSID = 0x4b8; this.mqSD.ResObjectString = tmqcharv5; MQBase.structMQCHARV32 tmqcharv6 = new MQBase.structMQCHARV32(); tmqcharv6.VSPtr = 0; tmqcharv6.VSOffset = 0; tmqcharv6.VSLength = 0; tmqcharv6.VSCCSID = 0x4b8; this.mqSD32.ObjectString = tmqcharv6; MQBase.structMQCHARV32 tmqcharv7 = new MQBase.structMQCHARV32(); tmqcharv7.VSPtr = 0; tmqcharv7.VSOffset = 0; tmqcharv7.VSLength = 0; tmqcharv7.VSCCSID = 0x4b8; this.mqSD32.SubName = tmqcharv7; MQBase.structMQCHARV32 tmqcharv8 = new MQBase.structMQCHARV32(); tmqcharv8.VSPtr = 0; tmqcharv8.VSOffset = 0; tmqcharv8.VSLength = 0; tmqcharv8.VSCCSID = 0x4b8; this.mqSD32.SubUserData = tmqcharv8; MQBase.structMQCHARV32 tmqcharv9 = new MQBase.structMQCHARV32(); tmqcharv9.VSPtr = 0; tmqcharv9.VSOffset = 0; tmqcharv9.VSLength = 0; tmqcharv9.VSCCSID = 0x4b8; this.mqSD32.SelectionString = tmqcharv9; MQBase.structMQCHARV32 tmqcharv10 = new MQBase.structMQCHARV32(); tmqcharv10.VSPtr = 0; tmqcharv10.VSOffset = 0; tmqcharv10.VSLength = 0; tmqcharv10.VSCCSID = 0x4b8; this.mqSD32.ResObjectString = tmqcharv10; } if (ver == 0) { this.Version = 1; } base.TrExit(method); }
private void ClearInvalidFields(int ver) { uint method = 500; this.TrEntry(method, new object[] { ver }); switch (ver) { case 0: this.StrucId = new byte[] { 0x4f, 0x44, 0x20, 0x20 }; this.ObjectType = 1; this.ObjectName = ""; this.ObjectQMgrName = ""; this.DynamicQName = "AMQ.*"; this.AlternateUserId = ""; break; case 1: break; case 2: goto Label_00F5; case 3: goto Label_011C; default: goto Label_0282; } this.RecordsPresent = 0; this.KnownDestCount = 0; this.UnknownDestCount = 0; this.InvalidDestCount = 0; this.ObjectRecordOffset = 0; this.ResponseRecordOffset = 0; this.ObjectRecordPtr = IntPtr.Zero; this.ResponseRecordPtr = IntPtr.Zero; this.ObjectRecordPtr32 = 0; this.ResponseRecordPtr32 = 0; Label_00F5: this.AlternateSecurityId = new byte[40]; this.ResolvedQueueName = new byte[0x30]; this.ResolvedQueueManagerName = new byte[0x30]; Label_011C: this.ResolvedType = 0; MQBase.structMQCHARV tmqcharv = new MQBase.structMQCHARV(); tmqcharv.VSPtr = IntPtr.Zero; tmqcharv.VSOffset = 0; tmqcharv.VSLength = 0; tmqcharv.VSCCSID = 0x4b8; this.mqOD.ObjectString = tmqcharv; MQBase.structMQCHARV tmqcharv2 = new MQBase.structMQCHARV(); tmqcharv2.VSPtr = IntPtr.Zero; tmqcharv2.VSOffset = 0; tmqcharv2.VSLength = 0; tmqcharv2.VSCCSID = 0x4b8; this.mqOD.SelectionString = tmqcharv2; MQBase.structMQCHARV tmqcharv3 = new MQBase.structMQCHARV(); tmqcharv3.VSPtr = IntPtr.Zero; tmqcharv3.VSOffset = 0; tmqcharv3.VSLength = 0; tmqcharv3.VSCCSID = 0x4b8; this.mqOD.ResolvedObjectString = tmqcharv3; MQBase.structMQCHARV32 tmqcharv4 = new MQBase.structMQCHARV32(); tmqcharv4.VSPtr = 0; tmqcharv4.VSOffset = 0; tmqcharv4.VSLength = 0; tmqcharv4.VSCCSID = 0x4b8; this.mqOD32.ObjectString = tmqcharv4; MQBase.structMQCHARV32 tmqcharv5 = new MQBase.structMQCHARV32(); tmqcharv5.VSPtr = 0; tmqcharv5.VSOffset = 0; tmqcharv5.VSLength = 0; tmqcharv5.VSCCSID = 0x4b8; this.mqOD32.SelectionString = tmqcharv5; MQBase.structMQCHARV32 tmqcharv6 = new MQBase.structMQCHARV32(); tmqcharv6.VSPtr = 0; tmqcharv6.VSOffset = 0; tmqcharv6.VSLength = 0; tmqcharv6.VSCCSID = 0x4b8; this.mqOD32.ResolvedObjectString = tmqcharv6; Label_0282: if (ver == 0) { this.Version = 1; } this.calculateOffsets(); base.TrExit(method); }
internal int ReadStruct(byte[] b, int structPos, int offset) { int length = this.GetLength(); IntPtr intPtr = IntPtr.Zero; try { if (intPtr == IntPtr.Zero) { intPtr = Marshal.AllocCoTaskMem(length); } Marshal.Copy(b, offset, intPtr, length); if (this.useNativePtrSz) { this.mqcharv = (MQBase.structMQCHARV)Marshal.PtrToStructure(intPtr, typeof(MQBase.structMQCHARV)); } else { this.mqcharv32 = (MQBase.structMQCHARV32)Marshal.PtrToStructure(intPtr, typeof(MQBase.structMQCHARV32)); } if (this.VSLength != 0) { int num = structPos + this.VSOffset; if (this.VSLength == -1) { this.VSLength = 0; int num2 = num; while (b[num2] != 0) { num2++; this.VSLength++; } } if (this.isOutputCapable) { int num3 = Math.Min(this.VSLength, this.VSBufSize); if (num3 != 0) { this.vsString = Encoding.ASCII.GetString(b, num, num3); } else { this.vsString = null; } } } else { this.VSOffset = 0; } } finally { if (intPtr != IntPtr.Zero) { Marshal.FreeCoTaskMem(intPtr); intPtr = IntPtr.Zero; } } return(length); }