Hi Pete,
I've been working on a SimConnect addon, and I've discovered a bug that could have serious ramifications for all addon developers. I've found that FSX will CTD when one client has already been loaded, and has begun making calls to the SimConnect server, and a second client is in the process of being loaded, but has generated a security warning because it is not trusted. It seems that the combination of one client communicating with the SimConnect server in the background, while FSX is displaying the security warning dialog in the foreground causes FSX to crash. If the second client is trusted and does not generate a warning, everything works fine.
I discovered this working on my FS Force program, which is comprised of an .exe and a .dll. I found that whenever I recompiled the .dll and ran FSX, FSX would crash as soon as the security warning came up for the .dll. In this case, the .exe had already been loaded and had begun talking to SimConnect.
I just found out yesterday that the same thing happens with your FSUIPC program. I sent an update of FS Force to one of my beta testers (Bill Womack), who also has FSUIPC installed. His dll.xml file was configured to load FSUIPC first and FS Force second. When he tried to start FSX, FSForce.dll triggered a security warning and FSX immediately CTD'd. I checked his SimConnect.log file, and noticed that FSUIPC was making a lot of calls to the SimConnect server immediately after the SimConnect_Open call. I instructed him to disable FSUIPC from loading, and then he was able to start FSX normally, and tell FSX to trust FSForce.dll. Then he was able to re-enable FSUIPC, after which everything worked together just fine.
If this is a confirmed bug, then I think this is going to be a big problem for developers and users of addons. Every time a developer issues an updated version that does not have a signed security certificate, it could potentially cause FSX to crash if there is another addon that is being loaded ahead of the updated one. The user will have to go through the hassle of disabling all other addons except the new one so he can tell FSX to trust the new one, after which he will be able to re-enable all the other addons.
There is a workaround however. What seems to cause the problem is when the early loading addon makes calls to either RequestDataOnSimObject or RequestDataOnSimObjectType immediately after the call to SimConnect_Open. If instead the addon waits until the simulator has actually started (via a SimStart event, or RequestSystemState), then there are no problems.
I hope you will experiment with this to confirm. My suggestion to reproduce the problem is to set up your dll.xml file to load FSUIPC first, and some other .dll second. Make sure the second .dll is not trusted, and then start FSX.
If you can confirm all this, then we need to put pressure on MS to fix this as soon as possible. I've bugged it as ID 215790. I think it would also be good to try to get the word out to developers to implement the workaround.
Regards,
Russ Dirks