X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type; q=dns; s=default; b=UYZRXcD qvLMuIwmFo/3diXcPT26zuY70gZgvpMk1xlTexnUzif42dW+3nH25HK0xin2qF3v 2XS6XcPBkx9fTjai/9mkEynHD7MZ4Wuu+PUIv48w+QBI0A25C/oY4zjhH3Xp/nCa HbzKzvO2zS+obkeNLfpZ1NyAK77I4cEmSXcg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type; s=default; bh=cpjOw5Tf5tN3w dpRWJmdJlc0mi8=; b=YaEwrCS339491LaY5uYLCJbzyNzALr/Gh8u8b9F4HOzFc 6kzt4fBCM8B8n6bMedl3zDo6UQqrocoPpRmxToH7XVXx5X40894tC9tv36NrfiaR RoMprHmA24VIUC4neAdyhDXbVzMS2a9Hyw7UTv41Dj5hl2Np7/NqHGTv3HaIcs= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=H*r:209.85.217, HX-Received:6102, HX-HELO:sk:mail-vs, sock X-HELO: mail-vs1-f44.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=9WCaKN0lvG/gLjt2o7DxglrvfbYn4JKX4wzRRnPaCGw=; b=oCcXhEelL7u5p+KlHGyn/UkzI8EkHqAuKrLHPt3Le+OcH+ZUbsZqaBuE26h3LtOr5Q q5RnZZACSBiclP+r0n8nIvrHSmd4cwrshKRNB36IzpVktkgj15hEfPogJdp2zuclfk5Q oiPrJo2/Dx+NdHllazaKs3tRpBdm7JmdIONltg410W4zpI+BhcPUumbARlhKXLlLzJQS zKG0+494cwktsaEPKyDMePla0SAO1Cnhrgd/ngizLHuIz96ecz/PSQ1LZT/U2qbS+osZ pTIJ2WheIvHJF5Vk5RXinUQZl6o+tsU7EsFKddUnupPu8RKDHE1UQ8ZbJyCbAMUi2vYY Jr/Q== MIME-Version: 1.0 References: <5a745b381650978f29cb650757ffa3c4acc62f49 DOT camel AT Askesis DOT nl> In-Reply-To: From: Olivia Nelson Date: Sun, 9 Feb 2020 22:51:47 +0800 Message-ID: Subject: Re: DllMain not called in CreateRemoteThread To: cygwin AT cygwin DOT com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes 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 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 > > > > Which of the sys/XXX.h are you looking for ? > > $ cygcheck -l mingw64-x86_64-headers | grep "/sys/" > /usr/x86_64-w64-mingw32/sys-root/mingw/include/sec_api/sys/timeb_s.h > /usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/cdefs.h > /usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/fcntl.h > /usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/file.h > /usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/locking.h > /usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/param.h > /usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/stat.h > /usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/time.h > /usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/timeb.h > /usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/types.h > /usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/unistd.h > /usr/x86_64-w64-mingw32/sys-root/mingw/include/sys/utime.h > > for what I know the Windows program use winsock2.h and winsock.h > for their own socket interface > > $ cygcheck -l mingw64-x86_64-headers | grep "sock" > /usr/x86_64-w64-mingw32/sys-root/mingw/include/hvsocket.h > /usr/x86_64-w64-mingw32/sys-root/mingw/include/mswsock.h > /usr/x86_64-w64-mingw32/sys-root/mingw/include/psdk_inc/_socket_types.h > /usr/x86_64-w64-mingw32/sys-root/mingw/include/winsock.h > /usr/x86_64-w64-mingw32/sys-root/mingw/include/winsock2.h > > > -- > 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