Arithmetic operation resulted in an overflow c#
问题 I am getting the following error when unlocking a file Arithmetic operation resulted in an overflow System.IntPtr.ToInt32 I suspect it is the following line to pBuffer.ToInt32() : IntPtr iPtr = new IntPtr(pBuffer.ToInt32() + (i * Marshal.SizeOf(fi3))); I am unable to reproduce the error myself and the error is not displaying the correct line number. I am looking for a way to reproduce this or any feedback on the possible cause. Thanks public void Close() { const int MAX_PREFERRED_LENGTH = -1;