I have a valid DLL as 32bit version and 64bit version (LoadLibrary works). Your code works perfect with the 32bit DLL, but when I try to load the 64bit DLL, my application completely crashes when executing
successfull := DllEntry(HINST(code), DLL_PROCESS_ATTACH, nil);
Tested with XE2 and 10.2.