/// <summary> /// Parse LongArray_r structure. /// </summary> /// <param name="ptr">A pointer points to memory allocated.</param> /// <returns>Instance of LongArray_r structure.</returns> public static LongArray_r ParseLongArray_r(IntPtr ptr) { LongArray_r longArray = new LongArray_r { Values = (uint)Marshal.ReadInt32(ptr) }; if (longArray.Values == 0) { longArray.Lpl = null; } else { IntPtr laaddr = new IntPtr(Marshal.ReadInt32(ptr, sizeof(uint))); longArray.Lpl = new int[longArray.Values]; int offset = 0; for (uint i = 0; i < longArray.Values; i++, offset += sizeof(int)) { longArray.Lpl[i] = Marshal.ReadInt32(laaddr, offset); } } return(longArray); }
/// <summary> /// Parse LongArray_r structure. /// </summary> /// <param name="ptr">A pointer points to the allocated memory.</param> /// <returns>Instance of LongArray_r structure.</returns> public static LongArray_r ParseLongArray_r(IntPtr ptr) { LongArray_r longArray = new LongArray_r { CValues = (uint)Marshal.ReadInt32(ptr) }; if (longArray.CValues == 0) { longArray.Lpl = null; } else { if (AdapterHelper.Transport.ToLower(System.Globalization.CultureInfo.CurrentCulture) != "mapi_http") { IntPtr laaddr = new IntPtr(Marshal.ReadInt32(ptr, sizeof(uint))); ptr = laaddr; } longArray.Lpl = new int[longArray.CValues]; int offset = 0; for (uint i = 0; i < longArray.CValues; i++, offset += sizeof(int)) { longArray.Lpl[i] = Marshal.ReadInt32(ptr, offset); } } return longArray; }