> 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.