From: Olivia Nelson <the.warl0ck.1989@gmail.com>
To: cygwin@cygwin.com
Subject: Re: DllMain not called
Date: Fri, 07 Feb 2020 15:07:00 -0000 [thread overview]
Message-ID: <CAJZVxR=gFdeYeZYorqmxOL_BKXcrO22EqsMbteD-h+qT9igngg@mail.gmail.com> (raw)
In-Reply-To: <c9486fc4-b69f-2704-b759-ce8a5ab23965@gmail.com>
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.atzeri@gmail.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
next prev parent reply other threads:[~2020-02-07 15:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-07 8:47 Olivia Nelson
2020-02-07 14:49 ` Marco Atzeri
2020-02-07 15:07 ` Olivia Nelson [this message]
2020-02-07 15:46 ` Marco Atzeri
2020-02-07 18:19 ` Joost Kraaijeveld
2020-02-07 19:10 ` Joost Kraaijeveld
2020-02-08 0:12 ` DllMain not called in CreateRemoteThread Olivia Nelson
2020-02-08 5:40 ` Marco Atzeri
2020-02-09 14:52 ` Olivia Nelson
2020-02-10 18:50 ` Andrey Repin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJZVxR=gFdeYeZYorqmxOL_BKXcrO22EqsMbteD-h+qT9igngg@mail.gmail.com' \
--to=the.warl0ck.1989@gmail.com \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).