0

I am using the 'COM Surrogate' method to host a 32 bit dll, so that it can be called from a 64-bit C# exe. This uses the 'DllSurrogate' method described in Hosting a .NET DLL as an Out-Of-Process COM Server (EXE) .

This works well, but I now have a need for the 32-bit process to allow more than 2GB of address space. It seems that for a normal exe you can use editbin to make the exe largeaddressaware. For example: How to make a .NET application “large address aware”?.

My question is how to make that work when the dll will be hosted in the system COM Surrogate?

Ant Waters
  • 510
  • 1
  • 5
  • 22
  • COM+ server applications can be configured to use additional address space by setting the appropriate option. – Aurora May 16 '18 at 14:17
  • 1
    "*for a normal exe you can use editbin to make the exe largeaddressaware*": that's like slapping a decal on a watch that says "waterproof" in order to make the watch waterproof. I trust you know there is a lot more to it than setting a flag. All your EXE code, and every single DLL you link to, needs to be "aware of large addresses". Otherwise you will crash badly and randomly. COM of course doesn't change any of that. – Euro Micelli May 16 '18 at 20:03
  • @Euro Micelli : I own up to complete ignorance on this, so thanks for the warning! And I'm curious how this can work? If you write a C++ or C# exe you are obviously referencing or linking to the Microsoft dlls, so why doesn't that cause a problem? – Ant Waters May 17 '18 at 08:35
  • It depends on what the program does but it can be surprisingly easy to end up with an unexpected third-party add-on/accessory/plug-in/driver DLL in your process. For example, a program with an Open File dialog box brings into the process every shell extension in the machine. You have to research and test your specific case. The "why" largeaddressaware is such a problem is out of scope for comments. Good luck! – Euro Micelli May 17 '18 at 12:12

0 Answers0