Opc.Ua.Com.ComUtils.GetUInt32s C# (CSharp) Method

GetUInt32s() public static method

Unmarshals and frees an array of 32 bit integers.
public static GetUInt32s ( IntPtr &pArray, int size, bool deallocate ) : int[]
pArray System.IntPtr
size int
deallocate bool
return int[]
        public static int[] GetUInt32s(ref IntPtr pArray, int size, bool deallocate)
        {
            if (pArray == IntPtr.Zero || size <= 0)
            {
                return null;
            }

            int[] array = new int[size];
            Marshal.Copy(pArray, array, 0, size);

            if (deallocate)
            {
                Marshal.FreeCoTaskMem(pArray);
                pArray = IntPtr.Zero;
            }

            return array;
        }