Application crash with 64bit
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.
Hi! Could you please try with version from dev branch?
Thank you for your response. I've tried dev, unfortunately the same error occured. But when I deactivate the code lines after "if Module.IsDLL then ..." (which is "true" for my 64bit-DLL) and directly execute
@Module.ExeEntry := Pointer(PByte(Code) + Module.Headers.OptionalHeader.AddressOfEntryPoint)
it works!
Probably this is your issue. You don't have to execute the ExeEntry line just comment out DllEntry(...) one. But keep in mind that your DLL could have something important in DLL_PROCESS_ATTACH section so you could face troubles sooner or later.