digitalmars.D - D bug or code error?
- steeno (41/41) Jan 03 2007 hey guys,
hey guys, i just have one question.. i compiled a .dll and tried to load it in a 3rd party process, but the process just crashes. here is the code for the simple .dll import std.c.windows.windows; extern( C ) { void gc_init( ); void gc_term( ); void _minit( ); void _moduleCtor( ); void _moduleUnitTests( ); } extern( Windows ) BOOL DllMain( HINSTANCE hInstance, ULONG ulReason, LPVOID pvReserved ) { switch( ulReason ) { case DLL_PROCESS_ATTACH: gc_init( ); _minit( ); _moduleCtor( ); _moduleUnitTests( ); MessageBoxA( GetForegroundWindow( ), "dll loaded", "debug msg", MB_OK ); break; case DLL_PROCESS_DETACH: gc_term( ); break; case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: return false; } return true; } for compilation i use "dmd -oftest.dll test.d test.def" but after injection the target process crashes. i tried to load the sample .dll too, but this crashes too. i don't know y but a friend of me told me that the code gets executed just bevor the entrypoint got reached. mfg steeno
Jan 03 2007