delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/02/28/19:04:11

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <20020301000334.69284.qmail@web20006.mail.yahoo.com>
Date: Thu, 28 Feb 2002 16:03:34 -0800 (PST)
From: Joshua Daniel Franklin <joshuadfranklin AT yahoo DOT com>
Subject: mkshortcut debugging problem
To: cygwin AT cygwin DOT com
MIME-Version: 1.0

I updated to cygutils 0.9.9 yesterday which included the utility
'mkshortcut', which I wrote. I was horrified to find that it dumps
the stack when attempting to set the name for a shortcut (the -n 
option). I *did* make sure it worked before sending Chuck the code, 
after all. My first thought was that I accidentally sent an old 
version, so I got the source and found that it did indeed crash 
when built as I had been doing it. I freely acknowledge that the
code, especially string-handling, is a mess, and after making what 
seem to be arbitary changes it again works...but only from the current
directory. When I copy the new version to /bin (or /usr/bin) this is
what happens:

/usr/src/cygutils-0.9.9/src-gpl$ /usr/src/cygutils-0.9.9/src-gpl/mkshortcut.exe
-DA /usr/local/bin/
[This works, producing bin.lnk in the All Users\Desktop\ dir]
/usr/src/cygutils-0.9.9/src-gpl$ rm /c/Documents\ and\ Settings/All\
Users/Desktop/bin.lnk 
/usr/src/cygutils-0.9.9/src-gpl$ cp
/usr/src/cygutils-0.9.9/src-gpl/mkshortcut.exe /usr/bin/
/usr/src/cygutils-0.9.9/src-gpl$ mkshortcut.exe -DA /usr/local/bin/
mkshortcut.exe: Save to persistant storage failed (Does the directory you are
writing to exist?)

The code that produces this error is:

      MultiByteToWideChar (CP_ACP, 0, lname, -1, widepath, MAX_PATH);
      hres = pf->lpVtbl->Save (pf, widepath, TRUE);
      if (!SUCCEEDED(hres)) 
      {
        fprintf(stderr, "%s: Save to persistant storage failed (Does the
directo
ry you are writing to exist?)\n", prog_name);
        exit(3);
      }

I'm afraid I have no idea how to debug this, and I've begun to make what
seem like arbitrary changes. Why would it work from one directory and not
another? (BTW, I tried printf'ing the lname string and it is identical in
both cases.) Anyone have any suggestions?

Thanks.
Joshua Daniel Franklin

__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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