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 destructor are called with LoadLibraryA, but not with CreateRemoteThread either Answer to Marco 1. I can't use mingw, it does not provide sys/XXX.h, e,g socket 2. I copied cygwin1.dll to system32, and it works outside cygwin environment Here's a implementation of the DLL injector in C#: https://codingvision.net/miscellaneous/c-inject-a-dll-into-a-process-w-createremotethread On Sat, Feb 8, 2020 at 3:10 AM Joost Kraaijeveld <j.kraaijev...@askesis.nl> wrote: > > 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/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