[Mono-list] Marshal.Release not implemented error

Kornél Pál kornelpal at gmail.com
Fri Jan 12 17:10:31 EST 2007


Marshal.Release is for COM object memory can be freed using 
Marshal.FreeHGlobal and Marshal.FreeCoTaskMem depending on how the memory 
was allocated.

Kornél

----- Original Message ----- 
From: "David Abrames" <abramesd at kmbs.konicaminolta.us>
To: <mono-list at lists.ximian.com>
Sent: Friday, January 12, 2007 10:56 PM
Subject: [Mono-list] Marshal.Release not implemented error


> Hello,
>
> I am porting some .NET 2.0 code over to mono 1.2.2.1 compiling with gmcs.
> Here is the code snippet:
>
>     IntPtr pszDest = Serializer.CreateStringPtr(cPortBuffer);
>     int ret = DllCaller.EnumPorts2(hwkbsys, flCtrl, pszDest, cPortBuffer);
>     string sOut = Serializer.GetPtrString(pszDest);
>     string[] strRet = sOut.Split('|');
>     Marshal.Release(pszDest);
>
> My problem is the Marshal.Release(pszDest) call produces a runtime error 
> of:
>
> Unhandled Exception: System.NotImplementedException: The requested feature
> is not implemented.
> in <0x0001d> System.Runtime.InteropServices.Marshal:Release (IntPtr pUnk)
> in <0x000a5> MyAPI.MyFoo ()
>
> Is there another way to release the pointer 'pszDest' instead of using
> Marshal.Release?
>
> Thank you
> David Abrames
>
>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list 



More information about the Mono-list mailing list