DllMain not called

Olivia Nelson the.warl0ck.1989@gmail.com
Fri Feb 7 15:07:00 GMT 2020


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



More information about the Cygwin mailing list