X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=wvk2/IG/Fkb0R/iiNCkWCsNweZX981DxB7VqBMmgX5P3y5YuhJ3GZ Wcll900BmeX7070WKyVBuy5k9bPgo6/nMs0QvkZ70adiz1IENZLC7iqZ41cdBGJI Yhla0BryDLs2wMdP16s2zz6S1i8YaFWDRz1XAc2OrRk2kdASoyuEd4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:references :mime-version:content-type:content-transfer-encoding; s=default; bh=DG3rUyrOtfMnPniavNmNlpy4+co=; b=JgJrKiNL8qNBDQFoskWs23eul36d RkWJmAIq5jLiepQv9o3fkd5vxsp/ZYl0haOVajr5B1mzks0Anl6Bo6zYd8KCzH4/ v/6BGIFiXjXoAK6gNn2BXDlSq8BRvV7XqnNr3SKrpYejj32h+8kgqBNiwEFjthgV tjLpUdy7kCtg5Kk= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: plane.gmane.org To: cygwin AT cygwin DOT com From: Mark Geisert Subject: Re: mkshortcut (cygutils-1.4.14) free error Date: Wed, 28 Oct 2015 04:49:27 +0000 (UTC) Lines: 58 Message-ID: References: <1445135414 DOT 3384650 DOT 413058409 DOT 46BC94AD AT webmail DOT messagingengine DOT com> <1445823930 DOT 241438 DOT 419951441 DOT 109BA262 AT webmail DOT messagingengine DOT com> <562E30AF DOT 5020502 AT cornell DOT edu> <1445904708 DOT 1171081 DOT 420968713 DOT 3D94007E AT webmail DOT messagingengine DOT com> <1445992232 DOT 1521329 DOT 422055817 DOT 4924D989 AT webmail DOT messagingengine DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-IsSubscribed: yes Anthony Heading writes: > > The second issue with the non-absolute path is more problematic. > > Without your second patch, I do see the issue but only on the 2nd or > > later invocation. In other words, if the xyzzy.lnk file does not > > initially exist, the command 'src/mkshortcut/.libs/mkshortcut xyzzy' > > works and does create the link file. Another invocation then shows the > > error. Is it simply mis-reporting that there's an existing link file? > > Yes. The hint in the error message is unhelpful I think, since a missing > directory is only one of a myriad of possible errors. As you note, an > existing link prompts the same message. Re the unhelpful hint, I was considering removing the guess it's making or substituting something more generic. I'm not sure it would help. If there were some way to get the underlying Windows error code we might be able to map it to an errno but that seems like it might not be robust. If we only have OLE/COM error codes like the "E_FAIL" for an existing link file, it seems hopeless. I'll probably leave the error message text as-is for now. > On the build I made on Windows 10, however, I hit the problem on the > very first invocation. I imagine you therefore are building on Windows 7 > or earlier, which seems to produce binaries that work OK. Yes, I'm building on Windows 7, 64- and 32-bit as well as Windows XP. No plans at present to upgrade but I might need to consider VMs to test later Windows versions. > As I said, I > suspect this is because IPersistFile::Save has changed semantics, e.g. > per this link: > https://msdn.microsoft.com/en-us/library/ windows/desktop/hh848036%28v=vs.85%29.aspx > > I haven't verified this; I don't know how why or whether gcc is > volunteering the executable to run in Windows 8 mode, or if there's a > manifest in some dll library stub, or whether the COM ID of the > IPersistFile interface is redirected by newer headers, or any similar > variant of Windows black magic, but it seems to me like a good guess. I'll happily defer to your understanding of Those Black Arts :). > If you're going to stay building on Windows 7 then, I don't think this > latter patch is needed, although it's hopefully harmless. But I guess > without it the code will silently break when Windows 8 or newer comes > into the picture. I think we should take advantage of the detective work you've done and patch as you've suggested. I'll add a comment to the effect that it's for a specific Windows behavior change seen after Windows 7. I'll add a link to that MSDN page if our coding/doc conventions allow for that. Thanks again for your patient and detailed help on this! ..mark -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple