int real_buffer_size=0; // allocate a dump memory space in order to retrieve nb of connexion int BufferSize = 100*CMIB_TCPEXROW.size_ex+4;//NumEntries*CMIB_TCPEXROW.size_ex+4 IntPtr lpTable = Marshal.AllocHGlobal(BufferSize); } //get the number of entries in the table Error Line==> Int32 NumEntries= (int)Marshal.ReadIntPtr(lpTable); real_buffer_size=NumEntries*CMIB_TCPEXROW.size_ex+4; // check if memory was enougth (needed buffer size: NumEntries*MIB_UDPEXROW.size_ex +4 (for dwNumEntries)) if (BufferSize<real_buffer_size) { // free the buffer Marshal.FreeHGlobal(lpTable); // get the needed buffer size: NumEntries*MIB_TCPEXROW.size_ex +4 (for dwNumEntries) BufferSize = real_buffer_size; // Allocate memory lpTable = Marshal.AllocHGlobal(BufferSize);
Quote:OverflowException occurred Arithmetic operation resulted in an overflow.
Int32 NumEntries= (int)Marshal.ReadIntPtr(lpTable);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)