TdzResourceDllLoader: load DLLs from a resource in 64 bit programs
Brought to you by:
twm
Since [bugs:#56] was fixed, TdzResourceDllLoader looks up entry points in 64 bit programs too, but Create(DllName) raises EDllLoadError there: loading a DLL from a RESOURCEDLL resource is only supported in 32 bit programs. TDzDllApi then falls back to the DLL file.
Loading a 64 bit DLL from a resource would need, in LoadDll and UnloadDll:
IMAGE_REL_BASED_DIR64; only IMAGE_REL_BASED_HIGHLOW is handled nowIMAGE_ORDINAL_FLAG64 for imports by ordinal; they are read and written as PDWORD nowPointer field, which is 8 bytes on Win64DWORD/Cardinal/Integer casts, and DllMain called with a pointer sized handle.pdata) registered with RtlAddFunctionTable and removed again on unload; without that, an exception raised inside the DLL cannot be handledTesting it needs a small 32 bit and a 64 bit DLL embedded as RESOURCEDLL in the test program, so either checked in binaries or a build step in the test set.