X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
Date: Fri, 03 Oct 2008 14:04:28 +0100
Subject: Re: non-persistent DllMain
Envelope-To: cygwin@cygwin.com
References: <48E5FB68.1090104@liddicott.com> <48E5FE38.7040400@gmail.com> <48E60C19.8070409@liddicott.com> <028e01c92554$709fef20$9601a8c0@CAM.ARTIMI.COM>
Message-ID: <48E6185C.7050200@liddicott.com>
From: "Sam Liddicott" <sam@liddicott.com>
User-Agent: Thunderbird 2.0.0.17 (X11/20080925)
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

* Dave Korn wrote, On 03/10/08 13:34:
>   DllMain is special.  There's a lot you cannot do in there, in particular
> file i/o, printf etc, because you're running inside a lock and it's a sort of
> critical section-y sort of situation, and indeed the MSVC CRT probably isn't
> inited yet, so you definitely won't have stdio.
>
>   If I were you, I'd put loads of OutputDebugMessage calls in your DllMain,
> and watch what's happening and look at the value of hModule, and the addressof
> g_hDLL (etc) using Sysinternals DebugView.
>   
OutputDebugString doesn't work in DllMain either, but it works in the
other functions.

Sam

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

