From: art yerkes
I wonder if there's any way to make this configurable so that it could be tailored a bit. Is there a way to take action based on what exe or dll we were called from? Maybe we shouldn't do it now, but it sounds like it might be convenient later.
There's code in ntdll (ntdll/ldr/startup.c LoadCompatibilitySettings) which does this. It uses the exe name to look up a registry entry in HKLM\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers and sets the PEB fields accordingly. The PEB fields are then later used in GetVersionEx(). Doesn't solve the problem for VB though, since it keys on exe name and not dll name.
Ge van Geldorp.