delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/10/03/10:59:30

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
References: <48E5FB68 DOT 1090104 AT liddicott DOT com> <48E5FE38 DOT 7040400 AT gmail DOT com> <48E60C19 DOT 8070409 AT liddicott DOT com> <028e01c92554$709fef20$9601a8c0 AT CAM DOT ARTIMI DOT COM> <48E6185C DOT 7050200 AT liddicott DOT com>
Subject: RE: non-persistent DllMain
Date: Fri, 3 Oct 2008 15:58:49 +0100
Message-ID: <029c01c92568$8b26c490$9601a8c0@CAM.ARTIMI.COM>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <48E6185C.7050200@liddicott.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Sam Liddicott wrote on 03 October 2008 14:04:

> * 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.

 [also in light of your subsequent post:]

  Are you /completely/ sure DllMain is being called, and that you're actually
invoking the particular build of the DLL that you think you are, rather than
maybe one in your PATH or elsewhere that's somehow getting first in the DLL
search order?


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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

- Raw text -


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