From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91269 invoked by alias); 8 Feb 2020 05:40:10 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 91261 invoked by uid 89); 8 Feb 2020 05:40:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=joost, Joost, H*f:sk:5a745b3, injector X-HELO: mail-wr1-f44.google.com Received: from mail-wr1-f44.google.com (HELO mail-wr1-f44.google.com) (209.85.221.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 08 Feb 2020 05:40:08 +0000 Received: by mail-wr1-f44.google.com with SMTP id w12so1333037wrt.2 for ; Fri, 07 Feb 2020 21:40:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=nfNwkwPz4uoYTA59n8Picnli9rnR+QeIaJ+JNEx3A6w=; b=qCRXoLrBR19gLOO/Ykd+ip855JOxwflD+wVLCPkRXMR1IUdUW4VXzPbaLiqyYSpcNY FsGGVroBzsGWjeRDglBak40hxvszUL2fyccR0nk0BsiArMMzbNbqyW2dTXC2UK1UIca6 kp7gusO/5VywKrKywEu4RU3eM0IXuo0CPAM/fLxISSn5Vt+QEZ1SzMtxAYp2Wha5ZEti kpoGg3wZF8zI+L1O/YUVQLdcobI/g3V+9k02OXHopxFE8VYDlFPeyXOzmQoB8mF77dpH CTPcNko1C4b9lqx729ZnWTyj2I/JHa5QUhIZSS8YLFoNoOwp9HSGkJaaSgJtsQwfoE9o g0OQ== Return-Path: Received: from ?IPv6:2003:ee:6727:2e01:254c:d9e8:62f9:24a9? (p200300EE67272E01254CD9E862F924A9.dip0.t-ipconnect.de. [2003:ee:6727:2e01:254c:d9e8:62f9:24a9]) by smtp.gmail.com with ESMTPSA id d23sm6457525wra.30.2020.02.07.21.40.04 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Feb 2020 21:40:04 -0800 (PST) Subject: Re: DllMain not called in CreateRemoteThread To: cygwin@cygwin.com References: <5a745b381650978f29cb650757ffa3c4acc62f49.camel@Askesis.nl> From: Marco Atzeri Message-ID: Date: Sat, 08 Feb 2020 05:40:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00060.txt.bz2 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