Re: DllMain not called in CreateRemoteThread

2020-02-10 Thread Andrey Repin
Greetings, Olivia Nelson! > I need to use unix socket() interface, mingw does not seem to provide > the following headers: There's no UNIX interfaces in native applications. Choose one or another, not both. > #include > #include > #include > #include Also, please no top posting in this lis

Re: DllMain not called in CreateRemoteThread

2020-02-09 Thread Olivia Nelson
I need to use unix socket() interface, mingw does not seem to provide the following headers: #include #include #include #include On Sat, Feb 8, 2020 at 1:40 PM Marco Atzeri wrote: > > please bottom post on this mailing list > > Am 08.02.2020 um 01:12 schrieb Olivia Nelson: > > Sorry, I made

Re: DllMain not called in CreateRemoteThread

2020-02-07 Thread Marco Atzeri
please bottom post on this mailing list Am 08.02.2020 um 01:12 schrieb Olivia Nelson: Sorry, I made a mistake. I've updated the title .. To summarize: 1. I can load the DLL compiled with cygwin with LoadLibraryA, but not remotely with CreateRemoteThread. 2. The same DLL compiled with msv

Re: DllMain not called in CreateRemoteThread

2020-02-07 Thread Olivia Nelson
Sorry, I made a mistake. I've updated the title .. To summarize: 1. I can load the DLL compiled with cygwin with LoadLibraryA, but not remotely with CreateRemoteThread. 2. The same DLL compiled with msvc works with both LoadLibraryA and CreateRemoteThread Answer to Joost: constructor and de

Re: DllMain not called

2020-02-07 Thread Joost Kraaijeveld
Does static void __attribute__((constructor)) static void __attribute__((destructor)) work? See e.g. https://stackoverflow.com/questions/2053029/how-exactly-does-attribute-constructor-work -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/

Re: DllMain not called

2020-02-07 Thread Joost Kraaijeveld
Does static void __attribute__((constructor)) static void __attribute__((destructor)) work? See also: https://stackoverflow.com/questions/2053029/how-exactly-does-attribute-constructor-work -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/

Re: DllMain not called

2020-02-07 Thread Marco Atzeri
Am 07.02.2020 um 16:07 schrieb Olivia Nelson: 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. you are building a Cygwin dll, that requires the Cygwin1.dll but probably do you not intend it and need a standalone one

Re: DllMain not called

2020-02-07 Thread Olivia Nelson
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 wrote: > > Am 07.02.2020 um 09:46 schrieb Olivia Nelson: > > I have a simple C program that output something t

Re: DllMain not called

2020-02-07 Thread Marco Atzeri
Am 07.02.2020 um 09:46 schrieb Olivia Nelson: I have a simple C program that output something to DbgView on startup: #include BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved

DllMain not called

2020-02-07 Thread Olivia Nelson
I have a simple C program that output something to DbgView on startup: #include BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case

DllMain

2014-06-25 Thread Soren Hein
Hello, Is DllMain() supposed to work with Cygwin and gcc? If so, could someone share a simple, working example? I have a relatively simple example that works with mingw, but does not work with gcc. I could post the example if that is easier. % uname -a CYGWIN_NT-6.1-WOW64 CDD-NB01 1.7.30

Re: Calling sem_wait() in DllMain( DLL_THREAD_DETACH) crashes

2011-03-16 Thread Corinna Vinschen
n libcrypto from > > OpenSSL (which tries to be portable to more than just POSIX, and has a > > DllMain() which is built for both cygwin and Win32), and a patch like that > > at > > [1] (or perhaps one which avoids DllMain on cygwin entirely) should be > > applied. >

Re: Calling sem_wait() in DllMain( DLL_THREAD_DETACH) crashes

2011-03-16 Thread Corinna Vinschen
y documented. > > >> However, it does seem that python (or one of its extensions) is doing > >> something it shouldn't. > > Given the above clarification about cygwin, this is a bug in libcrypto from > OpenSSL (which tries to be portable to more than just POSIX, and has a

Re: Calling sem_wait() in DllMain( DLL_THREAD_DETACH) crashes

2011-03-15 Thread Jon TURNEY
the xDLL automatically by pyDist::Builder [or whatever], > defining a custom DllMain()...") that's doing something windows-ish, > when it ought to be doing it unix-ish on cygwin. > > E.g. I wonder if this is bigger than just Twisted, or just > openssl+python/Lib/thread [

Re: Calling sem_wait() in DllMain( DLL_THREAD_DETACH) crashes

2011-03-15 Thread Jon TURNEY
ed to be able to call anything you like here >>> and it isn't clear why a POSIX/UNIX/Linux program would be relying on >>> DllMain. Thanks for the clarification. >> There are cases where cygwin-ish code does win32-ish things, like >> login.exe, or the PyWin32

Re: Calling sem_wait() in DllMain( DLL_THREAD_DETACH) crashes

2011-03-15 Thread Charles Wilson
ses PyWin32? > > The python Twisted stuff works on UNIX systems so there should be no > reason to use Windows-isms in Cygwin code - especially when the > Windows-ism *calls* UNIX code. The ability to get into trouble when you > mix Windows stuff like DllMain with Cygwin stuff is ver

Re: Calling sem_wait() in DllMain( DLL_THREAD_DETACH) crashes

2011-03-15 Thread Christopher Faylor
;>> where >>> some tests just cause python to segfault. It seems to be the same issue >>> with >>> libcrypto as reported in [2],[3] > >>Actually you aren't supposed to be able to call anything you like here >>and it isn't clear why a POSIX/UN

Re: Calling sem_wait() in DllMain( DLL_THREAD_DETACH) crashes

2011-03-15 Thread Charles Wilson
issue with >> libcrypto as reported in [2],[3] > Actually you aren't supposed to be able to call anything you like here and > it isn't clear why a POSIX/UNIX/Linux program would be relying on DllMain. There are cases where cygwin-ish code does win32-ish things, like login.exe, or

Re: Calling sem_wait() in DllMain( DLL_THREAD_DETACH) crashes

2011-03-15 Thread Christopher Faylor
e is attached to [2] as cygwin_crash.zip, referred to in >msg76086, which shows that manipulating a semaphore in >DllMain(DLL_THREAD_DETACH) causes a crash. > >There is a patch for openssl attached to [1] which makes sense to me. Surely >the cleanup ERR_remove_state() does should be

Calling sem_wait() in DllMain( DLL_THREAD_DETACH) crashes

2011-03-15 Thread Jon TURNEY
that manipulating a semaphore in DllMain(DLL_THREAD_DETACH) causes a crash. There is a patch for openssl attached to [1] which makes sense to me. Surely the cleanup ERR_remove_state() does should be requested using pthread_cleanup_push() rather using DllMain(DLL_THREAD_DETACH)? But that doesn't

Re: non-persistent DllMain

2008-10-03 Thread Sam Liddicott
* Dave Korn wrote, On 03/10/08 15:58: > 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

RE: non-persistent DllMain

2008-10-03 Thread Dave Korn
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 sec

Re: non-persistent DllMain

2008-10-03 Thread Sam Liddicott
* Dave Korn wrote, On 03/10/08 14:38: > Sam Liddicott wrote on 03 October 2008 14:00: > > It crashes when I do the first sendmessage after hooking. >>> ... with presumably a null pointer dereference? >>> >>> >> it's hard to tell, it's explorer.exe that is crashing.

RE: non-persistent DllMain

2008-10-03 Thread Dave Korn
Sam Liddicott wrote on 03 October 2008 14:00: >> >>> It crashes when I do the first sendmessage after hooking. >>> >> >> ... with presumably a null pointer dereference? >> > it's hard to tell, it's explorer.exe that is crashing. ... and? Explorer is just a program like any other. Instal

Re: non-persistent DllMain

2008-10-03 Thread Sam Liddicott
* 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 is

Re: non-persistent DllMain

2008-10-03 Thread Sam Liddicott
, you are quite right. I just changed this to GetModuleHandle("GuiTest.dll"); and it no longer crashes - the hookproc still isn't called though :-( > ... and I have a memory that this issue cropped up recently in the context of > the cygwin dll's DllMain call. > &

RE: non-persistent DllMain

2008-10-03 Thread Dave Korn
a handle to the file used to create the calling process (.exe file)." ... and I have a memory that this issue cropped up recently in the context of the cygwin dll's DllMain call. >> I think that DllMain is called when DLL is not yet completely loaded, >> so it is imposs

Re: non-persistent DllMain

2008-10-03 Thread Sam Liddicott
; thanks! > > > I think that DllMain is called when DLL is not yet completely loaded, > so it is impossible to set values of global variables. Isn't it? > Makes sense, but most examples state to store hModule at this point... however your suggestion was good, and I can now

non-persistent DllMain

2008-10-03 Thread Sam Liddicott
I'm trying to use the Win32::GuiTest perl module on WinXP SP3. I installed it under cygwin with something like: perl -MCPAN -e 'install Win32::GuiTest' However certain use is failing on the SetWindowHookEx because it is passing a NULL hModule, which is surprising because dll