delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2022/05/27/09:33:23

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 936773AA8CB9
Authentication-Results: sourceware.org;
dmarc=fail (p=none dis=none) header.from=nifty.ne.jp
Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=nifty.ne.jp
DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-02.nifty.com 24RCaSD8020135
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.ne.jp;
s=dec2015msa; t=1653654988;
bh=9fo3aZhy3pm63vK8BaiQtZNPZHqcvhPWm5obnKe/LcI=;
h=Date:From:To:Subject:In-Reply-To:References:From;
b=vU51juIVvCFbxIXpU7ewoYyEPkGhq9RxO+Wgjw3VwnUfhV1CD2rPftGtRYbbIdvkc
HyalRd3UzwPwunF2OlW2ALAiKADf0sdeLSqKEYXRcVQlXPfydIfZNuMN6p79pVuq/B
udGQGRc3t8Mm2lJXHW3J+yHWoOHgq4yYw0nsZGAy9xsma/l3gwPMSIo5yxRILtjkcd
f1v3mFmpTkdcwaMPi+NlK1hYOKTpnUL+xsoT8xWxbvkojeE7C5d1eMXK2wP8n0+Xuk
wn01XT+yWaK8P0Mdk8jys49lSIx6vIZJOa3eAdyBQmGLEoQYdyzsOJqt/72HANnPlO
sIGAmyhikIr9A==
X-Nifty-SrcIP: [119.150.44.95]
Date: Fri, 27 May 2022 21:36:29 +0900
From: Takashi Yano <takashi DOT yano AT nifty DOT ne DOT jp>
To: cygwin AT cygwin DOT com
Subject: Re: Unable to execute Cygwin application within UDF format
Message-Id: <20220527213629.64893e46789e0e6f7244b0fd@nifty.ne.jp>
In-Reply-To: <20220527212813.9bdc5d02d5da3172103bbbce@nifty.ne.jp>
References: <CANe7G9EE5Q9kd7FM=+ERhhB2zBxyNo1Tx7Rbuy=X4svaG2m0fw AT mail DOT gmail DOT com>
<20220527133120 DOT 58530edd99f4a87c605b8a04 AT nifty DOT ne DOT jp>
<CANe7G9EZbuKOJt_X2mq1X70Y=tWFiy5_w9fnKp59EgCGQjAUAw AT mail DOT gmail DOT com>
<20220527181849 DOT 6baaa5d9e8446f3e7d23cbee AT nifty DOT ne DOT jp>
<20220527195123 DOT abd2d66a17e28b51f1a745a3 AT nifty DOT ne DOT jp>
<20220527212813 DOT 9bdc5d02d5da3172103bbbce AT nifty DOT ne DOT jp>
X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32)
Mime-Version: 1.0
X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A,
RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP,
T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

On Fri, 27 May 2022 21:28:13 +0900
Takashi Yano wrote:
> On Fri, 27 May 2022 19:51:23 +0900
> Takashi Yano wrote:
> > diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
> > index 01b49468e..c4031b919 100644
> > --- a/winsup/cygwin/cygheap.cc
> > +++ b/winsup/cygwin/cygheap.cc
> > @@ -183,6 +183,8 @@ init_cygheap::init_installation_root ()
> >  	  if (p)
> >  	    p = wcschr (p + 1, L'\\');  /* Skip share name */
> >  	}
> > +      else
> > +	p = installation_root_buf + 4; /* 4 is the length of "\\\\?\\" */
> >      }
> >    installation_root_buf[1] = L'?';
> >    RtlInitEmptyUnicodeString (&installation_key, installation_key_buf,
> 
> I think the following patch makes more sense.
> 
> diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
> index 01b49468e..5623c9f5f 100644
> --- a/winsup/cygwin/cygheap.cc
> +++ b/winsup/cygwin/cygheap.cc
> @@ -183,6 +183,11 @@ init_cygheap::init_installation_root ()
>  	  if (p)
>  	    p = wcschr (p + 1, L'\\');  /* Skip share name */
>  	}
> +      else if (!wcsncmp (p + 2, L"?\\", 2))
> +	{
> +	  len = 4;
> +	  p = installation_root_buf + 4;
> +	}
>      }
>    installation_root_buf[1] = L'?';
>    RtlInitEmptyUnicodeString (&installation_key, installation_key_buf,

Ah, wcsncmp() check is redundant here. So it is better:

diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
index 01b49468e..34c9e2bc7 100644
--- a/winsup/cygwin/cygheap.cc
+++ b/winsup/cygwin/cygheap.cc
@@ -183,6 +183,11 @@ init_cygheap::init_installation_root ()
 	  if (p)
 	    p = wcschr (p + 1, L'\\');  /* Skip share name */
 	}
+      else
+	{
+	  len = 4;
+	  p = installation_root_buf + 4;
+	}
     }
   installation_root_buf[1] = L'?';
   RtlInitEmptyUnicodeString (&installation_key, installation_key_buf,


-- 
Takashi Yano <takashi DOT yano AT nifty DOT ne DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019