This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Thread Injection + Cygwin problems


The problem may be due to the fact that the injected thread doesn't have
a cygtls area.  If the thread is injected prior to the completion of
cygwin's initialization or if it somehow bypasses the DLL_THREAD_ATTACH
phase of the initialization (which was one problem that I had to deal
with in the dreaded "cygwin loops forever" problem) then there will be
no cygtls area and using cygwin functions will be problematic.

Thanks for the info ... The sequence of calls I make are GetModuleHandle ('cygwin1.dll') followed by calls to cygwin functions ... doesn't the GetModuleHandle only return after the proper initialization of the the dll and therefore cygwin? if not ... is there anything I can look out for programatically in the injected code?

	As for the cygtls area ... is this something necessary
for proper functioning of cygwin calls? (I looked at the source
... but none the wise I'm afraid :-( ) ...

	Empirically I see getenv working now "all" the time but
the call to cyg_internal seems to fail with regularity. Is this

The fix in the snapshots more-or-less assumes that any injected thread
is not going to try to use cygwin functions so, as of right now, it
may not be possible to do what the OP wanted.

Is there any other way of gaining access to a running cygwin processes environment variables?

thanks again for your time.


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]