[PATCH 3/3] Cygwin: improve PCA workaround

Brian Inglis Brian.Inglis@SystematicSW.ab.ca
Sat Feb 14 00:36:15 GMT 2026


On 2026-01-26 04:13, Corinna Vinschen wrote:
> From: Corinna Vinschen <corinna@vinschen.de>

> Perform the check only if we're the root process of a Cygwin process
> tree.  If we start mintty from Cygwin, the PCA trigger doesn't occur.

> diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc
> index 1d5a452b4fbc..e080aa41bca2 100644
> --- a/winsup/cygwin/dcrt0.cc
> +++ b/winsup/cygwin/dcrt0.cc
> @@ -253,6 +253,17 @@ frok::parent (volatile char * volatile stack_here)
>        systems. */
>     c_flags |= CREATE_UNICODE_ENVIRONMENT;
>   
> +  /* Despite all our executables having a valid manifest, "mintty" still
> +     triggers the "Program Compatibility Assistant (PCA) Service" for
> +     some reason, maybe due to some heuristics in PCA.
All makes sense and looks reasonable to a non-Windows type!

There are no differences between the windows or either mingw64 default 
manifests, but mintty has extra, after tweaking its order and layout to match, 
so perhaps something there needs updated in GH:

$ diff res.mft default-manifest.mft
--- res.mft	2026-02-13 17:21:21.491931500 -0700
+++ default-manifest.mft	2026-02-13 17:18:08.759527200 -0700
@@ -3,40 +3,22 @@
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
      <security>
        <requestedPrivileges>
-        <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
+        <requestedExecutionLevel level="asInvoker"/>
        </requestedPrivileges>
      </security>
    </trustInfo>
--
-  <dependency>
-    <dependentAssembly>
-      <assemblyIdentity
-        type="win32"
-        name="Microsoft.Windows.Common-Controls"
-        version="6.0.0.0"
-        publicKeyToken="6595b64144ccf1df"
-        language="*"
-        processorArchitecture="*"
-      />
-    </dependentAssembly>
-  </dependency>
-  <asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
-    <asmv3:windowsSettings>
-      <dpiAware 
xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
-      <dpiAwareness 
xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
-    </asmv3:windowsSettings>
-  </asmv3:application>
  </assembly>

Cygwin seems to have no mintty repos available!
Perhaps GH mintty/mintty should be mirrored on sourceware?

-- 
Take care. Thanks, Brian Inglis              Calgary, Alberta, Canada

La perfection est atteinte                   Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter  not when there is no more to add
mais lorsqu'il n'y a plus rien à retrancher  but when there is no more to cut
                                 -- Antoine de Saint-Exupéry


More information about the Cygwin-patches mailing list