delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/03/08/08:41:47

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Thu, 8 Mar 2001 14:41:08 +0100
From: Corinna Vinschen <cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Resolving symlinks for use with Win32 API functions
Message-ID: <20010308144108.C28539@cygbert.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <u67u254igwh DOT fsf AT rachel DOT hq DOT vtech>
Mime-Version: 1.0
User-Agent: Mutt/1.2.5i
In-Reply-To: <u67u254igwh.fsf@rachel.hq.vtech>; from jojo@virtutech.se on Thu, Mar 08, 2001 at 01:28:30PM +0100

On Thu, Mar 08, 2001 at 01:28:30PM +0100, Jesper Eskilson wrote:
> 
> Hi!
> 
> Consider the scenario where you're using Win32 API I/O routines
> (CreateFile(), ReadFile(), etc.) to do file I/O, instead of the Cygwin ones
> (open(), read(), etc.).  How can you resolve Cygwin symlinks (either new or
> old ones) in a Cygwin-program for use with Win32 API routines?
> 
> Old ones are fairly easy to parse; just remove the "!<symlink>" string (and
> then convert the remaining path using the Cygwin API) but what about new
> style symlinks? 
> 
> One problem is that Windows shortcuts aren't transparent; actually they're
> objects in the mind of Windows Explorer and not a Win32 invention at
> all. So, in order to resolve a Windows shortcut, you need to explicitly
> call a long sequence of strange functions. There is sample code in MSDN to
> do this, however, this code wants to link with shell32.lib and include the
> file "shlwapi.h", which is nowever to be found in Cygwin.
> 
> Any ideas?

Download the Cygwin sources and hava a look into `winsup/cygwin/shortcut.c'
which is the source to evaluate windows shortcuts. It doesn't use any
win32 header not available in Cygwin, obviously.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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