Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / February 2008

Tip: Looking for answers? Try searching our database.

ICorModule interface

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
knattetjatte@googlemail.com - 04 Feb 2008 10:52 GMT
Hi,

Does anyone know how to get to the ICorModule interface? There is
documentation about
it on MSDN for the 3.5 .NET framework but in a post[1] in 2004 a MS
employee (?) says the
implementation was removed but the definitions in the header files
were accidently left
in... ..but I find it hard to believe that now, 4 years later, this
still has not been corrected
so maybe is has not been pulled?

What I want to do in the end is to host my own CLR, create new
assemblies with
exported functions through vtables, load them into the CLR and then
call them
through the vtable pointers inside the meta data that I will lookup
manually. I need to
do this using unmanaged code so I cannot use ILGenerator,
Assembly.Load etc.

[1] http://www.dotnet247.com/247reference/msgs/55/275716.aspx

/joakim
Jeroen Mostert - 04 Feb 2008 19:25 GMT
> Does anyone know how to get to the ICorModule interface? There is
> documentation about it on MSDN for the 3.5 .NET framework but in a
> post[1] in 2004 a MS employee (?) says the implementation was removed but
> the definitions in the header files were accidently left in... ..but I
> find it hard to believe that now, 4 years later, this still has not been
> corrected so maybe is has not been pulled?

Unlikely. I don't know why you find it so hard to believe that an unusable
interface wasn't removed from a header file. It's sloppy, but no more than that.

Note also that even the ICor* interfaces that *are* implemented are all
between deprecated and unusable for the 2.0 CLR. They will only work for 1.x
hosts.

> What I want to do in the end is to host my own CLR, create new assemblies
> with exported functions through vtables, load them into the CLR and then
> call them through the vtable pointers inside the meta data that I will
> lookup manually. I need to do this using unmanaged code so I cannot use
> ILGenerator, Assembly.Load etc.

The post you linked to mentions a replacement candidate: CreateICeeFileGen()
from mscorpe.dll. (It's marked as deprecated, but it works for 2.0, and CLR
3.0 is still a long way away.) It seems to have all the necessary
accoutrements. Unfortunately, ICeeFileGen is not documented and not
supported, so you're on your own getting the necessary details.

For future investment, though (not to mention ease of implementation) it's
really still a better idea to use the managed classes. There's no particular
reason you couldn't. You can let managed code generate the assemblies and
have unmanaged code host them (through the IHostAssemblyManager interface).

Signature

J.

knattetjatte@googlemail.com - 05 Feb 2008 09:43 GMT
First off, thank you for the response.

> knattetja...@googlemail.com wrote:
>
[quoted text clipped - 9 lines]
> accoutrements. Unfortunately, ICeeFileGen is not documented and not
> supported, so you're on your own getting the necessary details.

Yes, I have been producing assemblies on disk using IMetaDataEmit and
the ICeeFileGen interface though I have not yet been able to figure
out how to get the manifest and vtables in there.. Exactly as you
said, not documented nor supported so it is hard to get it working all
the way.

> For future investment, though (not to mention ease of implementation) it's
> really still a better idea to use the managed classes. There's no particular
> reason you couldn't. You can let managed code generate the assemblies and
> have unmanaged code host them (through the IHostAssemblyManager interface).

I was suspecting someone would say that and I know you are right...
Thank you for the advice.

/joakim
Jeroen Mostert - 05 Feb 2008 19:04 GMT
<snip>
>> For future investment, though (not to mention ease of implementation) it's
>> really still a better idea to use the managed classes. There's no particular
[quoted text clipped - 3 lines]
> I was suspecting someone would say that and I know you are right...
> Thank you for the advice.

Let me put it another way: if you want to generate assemblies from unmanaged
code, you can, but you have to do all the work yourself (and/or borrow code
from Mono), since Microsoft isn't providing you with a free lunch anymore.
Given the choice between that and getting over your resentment for doing it
in managed code, I think it's an easy decision...

You could always NGEN the managed code and pretend it's unmanaged. :-)

Signature

J.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.