From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113141 invoked by alias); 7 Feb 2020 15:07:33 -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 113125 invoked by uid 89); 7 Feb 2020 15:07:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=0.3 required=5.0 tests=AWL,BAYES_50,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=atzeri, Atzeri, UD:problems.html, unsubscribe-simple X-HELO: mail-ua1-f42.google.com Received: from mail-ua1-f42.google.com (HELO mail-ua1-f42.google.com) (209.85.222.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Feb 2020 15:07:31 +0000 Received: by mail-ua1-f42.google.com with SMTP id y23so1003133ual.2 for ; Fri, 07 Feb 2020 07:07:31 -0800 (PST) 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=il+7VQUcLkeN5mmP5cnekxqlDNBippgKAvA/zdhNCC8=; b=UT0e5aiJP3PjiDvstCKuODQQEhE1RQCG0hiRYm79/hdIWGG4RbEN4jO1bzCPQhdD20 gEQVrMsOqfs7JaYTU4Kjxt0eRJHVwDs+AYU1JUwvnAML8RZFSpEQIT+Hm0gF41Z57wDe fi/n8T8CVlDQo/2FBbfmyQojqZYfKOLfeblBLHXES2XE9zyqA1XzWcTy49Tk/wVyqQ8p C/Lst3T+REDsb4wGW2VJcoGRPiZdHk5rswVqxrbZVrA0v11YPg4fpWcQPstpkZpu3t45 3E5fYS3a0q4vOhTpSGIqDKcpjHc3Qq62D2E6FU1hi0P4s2vBAwfZHzwVoRIH/Zq4ZJ5d /VmQ== MIME-Version: 1.0 References: In-Reply-To: From: Olivia Nelson Date: Fri, 07 Feb 2020 15:07:00 -0000 Message-ID: Subject: Re: DllMain not called To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00050.txt.bz2 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 to DbgView on startup: > > > > #include > > BOOL APIENTRY DllMain( HMODULE hModule, > > DWORD ul_reason_for_call, > > LPVOID lpReserved > > ) > > { > > switch (ul_reason_for_call) > > { > > case DLL_PROCESS_ATTACH: > > OutputDebugStringA("DLL_PROCESS_ATTACH called"); > > case DLL_THREAD_ATTACH: > > case DLL_THREAD_DETACH: > > case DLL_PROCESS_DETACH: > > break; > > } > > return TRUE; > > } > > > > I didn't observe anything when the DLL is loaded, what was wrong? > > > > This seems a pure Windows program, not a Unix like. > > How you compiled it and how are you tring to run it ? > > Regards > Marco > > -- > 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