After a long odyssey I finally found a solution for fixing a problem in our Delphi project that caused from time to...

After a long odyssey I finally found a solution for fixing a problem in our Delphi project that caused from time to time some unexpected and hard to trace crashes during the startup phase of our software on a Terminal Server (in a RDP session). The software crashed about 1 out of 20 starts and it took us almost 2 years to understand and find the source of the problem.

Keeping this story short ...

The final solution was to add the following line to the dpr files in our project:

{$SETPEOPTFLAGS IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE}

As I understand this case: If this flag is missing, the terminal server produces some "hick ups" in the initialization process of a program within a RDP session due to some mix up of DLL initialization that happens only during a RDP session.

My question is now: Is there any good reason NOT to add this line to any project? What are the possible side effects?
Via Google I found only sources explaining how to add this /TSAWARE flag to a Delphi project but didn't find any further background information why it must be added and why this isn't the default for any software.

Comments