Tech Off Post

Single Post Permalink

View Thread: Undo auto program compatibility in Vista
  • User profile image
    Chris Jackson

    This PCA dialog detects that the target application (Firefox) called the CreateProcess API to create a process that requires elevation (either through installer detection or manifest). This makes sense, since you are actively trying to install something. From a development point of view, you should call ShellExecute(Ex) instead. Regardless, what we have set is the ElevateCreateProcess shim for this executable. That means that if you call CreateProcess and it returns ERROR_ELEVATION_REQUIRED, then we will try again, this time prompting for elevation.

    So, this compatibility mode doesn't really hurt anything, and will help you out the next time Firefox calls CreateProcess on another exe that requires elevation. Other than that, it won't interfere with anything - presumably you aren't calling CreateProcess much in normal web browsing, so you won't even run this shim code much.

    If you want to see what we are doing, you can go to:

    HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers

    The path and layer should be listed.

    Why don't we give this particular PCA dialog an opt-out button? Because we are 100% certain that the fix for ERROR_ELEVATION_REQUIRED when calling CreateProcess is to shim with ElevateCreateProcess, and the fix is very low overhead.