DllExport
DllExport copied to clipboard
Allow exporting of variables / constants
Read this comment.
Depends on:
- [ ] https://github.com/3F/coreclr/issues/4 - Improve ILAsm grammar for export variables into Export Directory (IMAGE_OPTIONAL_HEADER - NT PE32/PE32+)
But first we need to improve ILAsm grammar + writer and probably mscorpe I will look this later with similar task from #23
Today only this:
for(WORD j = 0; (pMD = pClass->m_MethodList.PEEK(j)); j++)
{
...
EATEntry* pEATE;
/*
struct EATEntry
{
DWORD dwStubRVA;
DWORD dwOrdinal;
char* szAlias;
};
*/
...
m_EATList.PUSH(pEATE);
another interesting, I forgot to implement support of this variables (constants) for Conari engine, hmm...
to be clear for '.field' directives:
.field public static literal int32 'MyField' at '@00007400' // RVA: 0x00001CE8
will create field that have RVA associated with it, but that's another story with IMAGE_COR20_HEADER
This would be super useful. For example NVIDIA and AMD drivers use variable to decide when to switch to dedicated video card.
extern "C"
{
__declspec(dllexport) unsigned long NvOptimusEnablement = 0x00000001;
}