SharpCrafters Forum – Reversed P/Invoke

SharpCrafters Support Forum

        


Reversed P/Invoke Expand / Collapse
Author
Message
Posted 10/21/2009 9:47:41 PM


Community Member
Hi,

I'm looking into Reversed P/Invoke as a solution to a C++/.NET interop problem I have.
In short: reversed P/Invoke exposes managed constructs to unmanaged code.

There are some tools that use ilasm and ildasm to manipulate the IL of a compiled managed assembly and tweak it so unmanaged code can access it.

But I would much rather have a solid robust framework (like PostSharp?) do all the IL manipulation for me.

I was wondering if anything of this nature exists and/or if it's hard to create (once you know what tweak to make to the IL)??

Any suggestions would be most welcome.

PS: The project involved is VST.NET and currently implements this interop problem in a mixed C++/Managed C++ assembly called Interop.
Post #3667
Posted 10/24/2009 9:18:25 AM


Gael Fraiteur

SharpCrafters
I don't think it's difficult to do. There is a thing called "vtfixup" in msil, which exposes managed methods as native ones. But PostSharp does not support vtfixups. They are not properly documented (I think they are not a part of the ECMA standard).

-gael
Post #3668
Posted 10/24/2009 7:28:04 PM


Community Member
I don't think it's difficult to do. There is a thing called "vtfixup" in msil, which exposes managed methods as native ones. But PostSharp does not support vtfixups. They are not properly documented (I think they are not a part of the ECMA standard).


Too bad PostSharp doesn't support vtfixup. <!-- s:-( --> <!-- s:-( -->
Well, I have the source code of one of those tools. Lets see what I can do with that <!-- s;-) --> <!-- s;-) -->

Thanx,
Marc
Post #3669
« Prev Topic | Next Topic »


All times are GMT +1:00, Time now is 11:44am

Powered By InstantForum.NET v4.1.4 © 2010
Execution: 0.054. 7 queries. Compression Disabled.