delphiarmcross-platform

On Win11, can an ARM native dll call on to an x64 native COM dll


We have a Windows printer driver that needs to be ported to ARM

Currently the build targets x64 and the driver can be installed on intel Windows 7 - Windows 11

The driver makes two COM calls - one to an x64 native COM dll written in Delphi, and the other to a dotnet AnyCPU COM dll written in C#

I'm pretty confident that the native ARM to AnyCPU dll calls will work without me needing to modify the build of the AnyCPU dll.

My question is - do I need to rebuild the Delphi COM dll so it targets ARM too, or will the x64 emulator built in to ARM Windows take care of it?


Solution

  • do I need to rebuild the Delphi COM dll so it targets ARM too

    Delphi doesn't have any equivalent to AnyCPU building, so if you want your DLL to run natively then you need a separate build for each target CPU.

    will the x64 emulator built in to ARM Windows take care of it?

    The emulator applies to the process as a whole, not to individual DLLs. Since your driver DLL is already running under ARM, that means the calling process that uses it must be running under ARM as well, and thus can't load x64 DLLs only ARM DLLs. A process can never mix CPU architectures.

    On the other hand, since your Delphi DLL is a COM DLL, perhaps you can define a DLL Surrogate to run the DLL in a separate process, and then maybe that process can run under the emulator.