Can't use Marshal.PtrToStructure(IntPtr, object) with boxed value types. Reverting to object Marshal.PtrToStructure(IntPtr, Type).

This commit is contained in:
the_fiddler 2008-01-25 13:38:39 +00:00
parent 3e45bbc85c
commit a62e0fb6a6

View file

@ -1349,7 +1349,7 @@ XF86VidModeGetGammaRampSize(
for (int i = 0; i < nsizes; i++) for (int i = 0; i < nsizes; i++)
{ {
array[i] = new XRRScreenSize(); array[i] = new XRRScreenSize();
Marshal.PtrToStructure((IntPtr)data, array[i]); array[i] = (XRRScreenSize)Marshal.PtrToStructure((IntPtr)data, typeof(XRRScreenSize));
data += Marshal.SizeOf(typeof(XRRScreenSize)); data += Marshal.SizeOf(typeof(XRRScreenSize));
} }
XFree(ptr); XFree(ptr);