Marshal class in Interop is catching memory errors better
I was recently testing some interop code that uses P/Invoke calls. I was allocating a block of memory to represent an array of handles. I erroneously specified the size of this block as "IntPtr.Size" instead of "nRows * IntPtr.Size". Running the program under .NET 2.0 caused it to fail on a call to Marshal.FreeHGlobal with the pointer every time, as opposed to compiling and running it under .NET 1.1, where it only failed sporadically.
Good job to the Interop team for improving reliability!
Chuck

