waoywssy / linfu

Automatically exported from code.google.com/p/linfu
0 stars 0 forks source link

IntPtr methods not proxyable #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a Proxy for a method with an IntPtr type in it

What version of the product are you using? On what operating system?

Please provide any additional information below.

Here is the stack trace
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at LinFu.DynamicProxy.DefaultMethodEmitter.PackageReturnType(MethodInfo
method, ILGenerator IL) in
C:\3rdParty\LinFu\LinFu.DynamicProxy\DefaultMethodEmitter.cs:line 247

I am going to work around this locally by modifying DefaultMethodEmitter.cs
to include that type in the _opCodeMap array.

Original issue reported on code.google.com by nigel.th...@gmail.com on 23 Jan 2008 at 12:31

GoogleCodeExporter commented 9 years ago
_opCodeMap? Did you mean the stindMap? Anyway, I went ahead and added the 
following
line to DefaultMethodEmitter.cs:

            stindMap["IntPtr"] = OpCodes.Stind_I4;

This should fix the issue with using a method with an IntPtr. I'll commit the 
changes
to SVN right away, so don't forget to checkout the latest version if you haven't
already done so. I hope that helps!

Original comment by Philip.L...@gmail.com on 25 Jan 2008 at 11:01

GoogleCodeExporter commented 9 years ago

Original comment by Philip.L...@gmail.com on 15 Apr 2008 at 10:20