Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
X-Injected-Via-Gmane: http://gmane.org/
To: cygwin@cygwin.com
Path: not-for-mail
From: Shankar Unni <shankar@cotagesoft.com>
Subject: Re: javac on cygwin
Date: Mon, 13 Jan 2003 11:26:28 -0800
Lines: 24
Message-ID: <3E2312E4.2000006@cotagesoft.com>
References: <20030104115231.62364.qmail@web10401.mail.yahoo.com> <5.2.0.9.2.20030104080555.01e83058@pop3.cris.com> <5.2.0.9.2.20030104161638.01fbee88@pop3.cris.com> <20030105013147.GC11814@redhat.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Complaints-To: usenet@main.gmane.org
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01
X-Accept-Language: en-us, en

Christopher Faylor wrote:

> I remember speculating at one point about creating wrappers to the win32
> functions like CreateFile, MoveFile, etc.  which would understand cygwin
> paths.  You could theoretically modify an .exe to load cygwin1.dll and
> use the wrapper functions.  Or you could use some of Windows hook
> facilities to do that.

Hmm. Would that even work?

I remember trying, way back when, to provide a checking malloc library 
on Windows, and then discovering that there was *no* way of intercepting 
malloc() calls *inside LIBC itself*.  In the Windows PE world (unlike 
the ELF world), a call to a routine that lives inside the same DLL is 
automatically bound to the local copy without any way to hijack the call.

Thus there's no way to play games with LD_LIBRARY_PATH (or PATH, rather) 
to load a malloc that'll hijack all calls successfully. And there's 
definitely nothing like the LD_PRELOAD mechanism to wrap existing 
pre-linked programs to inject support libraries into the lib list.

So any CreateFile calls inside the windows libraries would always go to 
the built-in CreateFile.



--
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/

