I started playing with coremul last night and after figuring out how
to export the DLL function properly i came up with a _very simple_
solution to mscoree.dll problem. Here's basically how it works:
__declspec(dllexport) __int32 _CorExeMain(void)
/* Get the full pathname of the application */
GetModuleFileName(0, path, 1023);
sprintf(cmd, "%s \"%s\"", "ilrun", path);
/* Execute 'ilrun "path/app.exe"' */
I've compiled the DLL (on mingw) this way:
gcc -c cocreate.cpp
gcc -c guid.cpp
gcc -c shim.c
dllwrap --output-lib=libmscoreedll.a --dllname=mscoree.dll
--driver-name=gcc cocreate.o guid.o shim.o
As you can see, it's a really half-assed approach (EXEs only),
completely disregarding the way the 'shim' should work in real life.
Obviously, this approach only works on Windows, I don't even know if
mscoree.dll would be useful on other platforms. But it works for
simple testing, you no longer have to type 'ilrun app.exe' on Windows
to execute .NET applications.
If you're interested in having this until I come up with a better
solution, I can submit a patch.
Please let me know what you think about it.
Developers mailing list