DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 5AQAWl7T2904304
Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com
Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 5AQAWl7T2904304
Authentication-Results: delorie.com;
	dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=kXacm3L2
X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9639D3858D38
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1764153165;
	bh=M+kuarZHzm6zUGytnzHEPG85Zf1RoKC0vKvQDGHjEXk=;
	h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
	 From;
	b=kXacm3L2Zx/eDAJhFhMqbTWQpmHG3qXWB1rhQ2/ZiTxUs5xJR0kKidMWv/Uh/sC//
	 lOPh+HyMfeSfCKvyHJLd0T4XPSDvKso8kha/uf4cNITSZbkBH+Ru/+nC+Q7Si+Bfa8
	 r99vR7MhodAftKiusCJN3Yz/ZrlwqKGRuvwtzmSo=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 366413858D32
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 366413858D32
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1764153142; cv=none;
 b=fzvspJlrnowW2/xknyX3sCJxFxQJGhAU29xI0nlgzTPH5Vt7EcjvuwRgOO/5uEs07L1SmrIMr3q30Iz9hoeUJ2APTpdfkADuwv6uJMgxrq0ri03NHEHbrpPndypz7QG3FmL0XfTN7RKBFgDeJLUU5za4XydeFDitaMUFOL5aS8c=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
 t=1764153142; c=relaxed/simple;
 bh=wt+T3LTJazXJOFYghPYi1l1YSGzPKrDecyZLgLdip3g=;
 h=Date:From:To:Subject:Message-Id:Mime-Version:DKIM-Signature;
 b=BW6hXaJMLX1q8YFFRdA+f02Kqjs+99iME2X0fA/8EqsiQ6jlWGc9AB7Qq1Lz/mNtOXcGC7w08mfOM2GEfQu4+v72E/XQ550JxSy+d6J5KgZcKiHn7/qYmtnd+Ajy6GfQZeVRJWsvPGl7m8XdI8U1G+4ogL5ruUUdkAAyoWwHgVE=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 366413858D32
Date: Wed, 26 Nov 2025 19:32:20 +0900
To: cygwin@cygwin.com
Subject: Re: dynamic conpty loading
Message-Id: <20251126193220.1b890f58a121add2f0d05fa5@nifty.ne.jp>
In-Reply-To: <cc6b613b-1c02-41e3-b045-5b1723b706ab@towo.net>
References: <f52d9663-b210-497a-867b-5193b420ea0b@towo.net>
 <30deef29-ba20-49d9-9b38-28020941b0ef@towo.net>
 <707f4d4c-a20d-4f1d-bdbd-65a2392dea15@towo.net>
 <20251121190433.4a37dc959848a0aea89a8922@nifty.ne.jp>
 <62f3c1ae-1fd9-477d-a837-d865094dab06@towo.net>
 <aSCXcoeDbrGOrUTu@calimero.vinschen.de>
 <cc6b613b-1c02-41e3-b045-5b1723b706ab@towo.net>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.30
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Takashi Yano via Cygwin <cygwin@cygwin.com>
Reply-To: Takashi Yano <takashi.yano@nifty.ne.jp>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces~archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie.com@cygwin.com>

On Fri, 21 Nov 2025 17:58:01 +0100
Thomas Wolff wrote:

> Am 21.11.2025 um 17:46 schrieb Corinna Vinschen via Cygwin:
> > Hi Thomas,
> >
> > On Nov 21 16:46, Thomas Wolff via Cygwin wrote:
> >> Am 21.11.2025 um 11:04 schrieb Takashi Yano via Cygwin:
> >>> On Sun, 5 Oct 2025 10:15:55 +0200
> >>> Thomas Wolff wrote:
> >>>>>> The procedure seems to be:
> >>>>>> try LoadLibrary("conpty.dll"), (if not successful, fallback to
> >>>>>> GetModuleHandle("kernel32") instead) to retrieve GetProcAddress for
> >>>>>> CreatePseudoConsole, ResizePseudoConsole, ClosePseudoConsole, and
> >>>>>> then somehow (?) use those while calling CreateProcess.
> >>>>>> The latter is woven into the cygwin library and I don't think it's a
> >>>>>> good idea to clone that out of cygwin for a patched process creation
> >>>>>> in mintty.
> >>>>>>
> >>>>>> My question/suggestion:
> >>>>>> Can a cygwin mode switch to a selected conpty library instead of the
> >>>>>> default one please?
> > Where do you expect this conpty.dll to reside?
> >
> > If we do something like that, I would suggest to make sure that this
> > conpty.dll is in a well-defined place. /bin or /lib might be a good
> > idea. And if it exists in this defined place, it will be used by Cygwin.
> >
> > We can tweak the autoload mechanism to allow a primary DLL and a fallback
> > DLL, that drops the need to set the CYWIN env var.
> >
> > The mintty package could contain a post-install script, or some other
> > script in /bin to allow a user with admin rights downloading the latest
> > (or the most sensible) conpty.dll from MSFT.
> >
> > Would that make sense?
> >
> >
> > Corinna
> >
> That makes much sense, yes, thank you. /bin/conpty.dll would probably be 
> a good place.

I checked the source of conpty.dll
https://github.com/microsoft/terminal/blob/main/src/winconpty/winconpty.cpp

conpty.dll seems to launch OpenConsole.exe in the directory where
WindowsTerminal is installed.
However, BUILTIN\Users does not have permission to execute OpenConsole.exe.

Do you have some idea how to solve this problem?
WindowsTerminal itself can launch OpenConsole.exe, so there should be
some solutions, I think.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
