From: cgf AT cygnus DOT com (Christopher Faylor) Subject: Re: finding out if main app is cygwin 17 Nov 1998 05:48:02 -0800 Message-ID: <19981117082246.A18240.cygnus.cygwin32.developers@cygnus.com> References: <9811170601 DOT AA25995 AT modi DOT xraylith DOT wisc DOT edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: Mumit Khan , cygwin32-developers AT cygnus DOT com On Tue, Nov 17, 1998 at 12:01:32AM -0600, Mumit Khan wrote: >I remember Chris Faylor working on something similar, so perhaps Chris >already has something? I did steal some code from Emacs/NT that did just >that (maps the file into memory and looks at dependencies looking for >some DLL), but there has to be faster way. Wow, you've got a good memory. I believe that you gave me some code to scan a binary for DLL information. I was going to use that as a method for bypassing a lot of the argument and environment handling in spawn when you know that you're starting a cygwin process. I never did much with it because it seemed that it was probably too slow. Offhand, I can't think of any way to find out if an executable is a cygwin executable. One thing that springs to mind is that we could always export one symbol from the executable and then use GetProcAddress to attempt to load that symbol from the main module. If it fails, it's not a cygwin executable. I don't know how expensive this would be though. -- cgf AT cygnus DOT com http://www.cygnus.com/