[Mono-dev] HandleRef regression in mono 1.2.3

Miguel de Icaza miguel at novell.com
Sat Feb 10 22:44:40 EST 2007


> my team has been using HandleRef for marshaling (as mono
> http://www.mono-project.com/Interop_with_Native_Libraries and msdn
> http://msdn2.microsoft.com/en-us/library/system.runtime.interopservices.handleref.aspx
> suggest) for quite a long time. To our surprise, HandleRef no longer
> works with the new release of mono.

There is no regression, since HandleRef was never implemented in the
Marshaller.   Either you just started using it, or you were getting
corrupted data all along. 

That being said, it will be available in Mono 1.2.4, I have just
implemented it.

> Everything works fine with 2.0 profile. On 1.0, when I pass a
> HandleRef to a native library expecting a pointer, marshaller feeds
> garbage to the native code. The problem occurs both on linux and
> windows. And yes, I can work around this problem by replacing
> HandleRef by plain IntPtr's, but that's not the point, is it?
> I was also quite surprised by this bugzilla entry:
> http://bugzilla.ximian.com/show_bug.cgi?id=80515 Does this mean that
> the maintainer of interop stack is aware of the regression?

I only recently discovered that we lacked support for this (while going
through some Moma reports, as a couple of P/Invoke signatures had it,
and I found out we did not support it).


More information about the Mono-devel-list mailing list