delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/02/07/10:08:25

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:references:in-reply-to:from:date
:message-id:subject:to:content-type; q=dns; s=default; b=hdK0UKE
fIuJHZ95krzPKSVzsFeUTr8T4PnXek+iy0zqzS5O4+65n5lpGYABUB4r6biQuMhK
DRUSHkVqKaidqJmbH1O2bJzuf0M/IXifANouT3sn9N1bXgvXKiLot/WunQBYaiOR
Umcr1Tc3cHQZGzR7rcaFdcuaOPEFI6o7Idps=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:references:in-reply-to:from:date
:message-id:subject:to:content-type; s=default; bh=duvdJCgfsiOX6
6/WE/6odKF6SHw=; b=nd+YefoKQqDKSP1ppauG+vw7rQORdSQbsWicLblB5xwaB
q65bBlVmvyW3/Tm/Qa3I0jHqPQvY/glUvjnCH9M8QXdd2nMfzJkGRDuR/TPmqFb+
gW3Jpfau+Hzzecdmn2Ip2NEV7BYUzX+dJRLRApeo1LDqkD/y6MndmAuW26xhu8=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: No, score=0.3 required=5.0 tests=AWL,BAYES_50,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=atzeri, Atzeri, UD:problems.html, unsubscribe-simple
X-HELO: mail-ua1-f42.google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=il+7VQUcLkeN5mmP5cnekxqlDNBippgKAvA/zdhNCC8=; b=UT0e5aiJP3PjiDvstCKuODQQEhE1RQCG0hiRYm79/hdIWGG4RbEN4jO1bzCPQhdD20 gEQVrMsOqfs7JaYTU4Kjxt0eRJHVwDs+AYU1JUwvnAML8RZFSpEQIT+Hm0gF41Z57wDe fi/n8T8CVlDQo/2FBbfmyQojqZYfKOLfeblBLHXES2XE9zyqA1XzWcTy49Tk/wVyqQ8p C/Lst3T+REDsb4wGW2VJcoGRPiZdHk5rswVqxrbZVrA0v11YPg4fpWcQPstpkZpu3t45 3E5fYS3a0q4vOhTpSGIqDKcpjHc3Qq62D2E6FU1hi0P4s2vBAwfZHzwVoRIH/Zq4ZJ5d /VmQ==
MIME-Version: 1.0
References: <CAJZVxRkk3K6jOtiXUsW6iOFzDAGm4yf393zcYTYphfCKY-qSQg AT mail DOT gmail DOT com> <c9486fc4-b69f-2704-b759-ce8a5ab23965 AT gmail DOT com>
In-Reply-To: <c9486fc4-b69f-2704-b759-ce8a5ab23965@gmail.com>
From: Olivia Nelson <the DOT warl0ck DOT 1989 AT gmail DOT com>
Date: Fri, 7 Feb 2020 23:07:18 +0800
Message-ID: <CAJZVxR=gFdeYeZYorqmxOL_BKXcrO22EqsMbteD-h+qT9igngg@mail.gmail.com>
Subject: Re: DllMain not called
To: cygwin AT cygwin DOT com
X-IsSubscribed: yes

I compile it like this:
gcc dll.c -shared -fPIC -o dll.dll

I tried to run it with LoadLibraryA

But DllMain is not called.


On Fri, Feb 7, 2020 at 10:49 PM Marco Atzeri <marco DOT atzeri AT gmail DOT com> wrote:
>
> Am 07.02.2020 um 09:46 schrieb Olivia Nelson:
> > I have a simple C program that output something to DbgView on startup:
> >
> > #include <windows.h>
> > BOOL APIENTRY DllMain( HMODULE hModule,
> >                         DWORD  ul_reason_for_call,
> >                         LPVOID lpReserved
> >                       )
> > {
> >      switch (ul_reason_for_call)
> >      {
> >      case DLL_PROCESS_ATTACH:
> >          OutputDebugStringA("DLL_PROCESS_ATTACH called");
> >      case DLL_THREAD_ATTACH:
> >      case DLL_THREAD_DETACH:
> >      case DLL_PROCESS_DETACH:
> >          break;
> >      }
> >      return TRUE;
> > }
> >
> > I didn't observe anything when the DLL is loaded, what was wrong?
> >
>
> This seems a pure Windows program, not a Unix like.
>
> How you compiled it and how are you tring to run it ?
>
> Regards
> Marco
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>

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

- Raw text -


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