From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from conssluserg-02.nifty.com (conssluserg-02.nifty.com [210.131.2.81]) by sourceware.org (Postfix) with ESMTPS id 936773AA8CB9 for ; Fri, 27 May 2022 12:37:01 +0000 (GMT) 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 Received: from HP-Z230 (ak044095.dynamic.ppp.asahi-net.or.jp [119.150.44.95]) (authenticated) by conssluserg-02.nifty.com with ESMTP id 24RCaSD8020135 for ; Fri, 27 May 2022 21:36:28 +0900 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 To: cygwin@cygwin.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: <20220527133120.58530edd99f4a87c605b8a04@nifty.ne.jp> <20220527181849.6baaa5d9e8446f3e7d23cbee@nifty.ne.jp> <20220527195123.abd2d66a17e28b51f1a745a3@nifty.ne.jp> <20220527212813.9bdc5d02d5da3172103bbbce@nifty.ne.jp> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.30; i686-pc-mingw32) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2022 12:37:03 -0000 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