Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm 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 From: "Rich LeGrand" To: Subject: Cygwin dll initialization from win32 application Date: Tue, 11 Mar 2003 12:48:15 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Hi all, This has been discussed before, but I have been unable to find any solutions to this problem. Basically I'm trying to call cygwin functions in the cygwin1.dll from a Windows (msvc) application by calling LoadLibrary() and GetProcAddress(). I can see that the cygwin authors have made provision for this (or what looks like a provision) with dll_dllcrt0 (a non-cygwin initialization function.) But when I call it, it crashes. Here is my code: per_process p; ZeroMemory((void *)&p, sizeof(per_process)); m_dllHandle = LoadLibrary("cygwin1.dll"); p.calloc = calloc; p.magic_biscuit = sizeof(per_process); p.malloc = malloc; p.realloc = realloc; p.free = free; p.hmodule = m_dllHandle; dll_dllcrt0 = (int (*)(HMODULE, per_process *))GetProcAddress(m_dllHandle, "dll_dllcrt0"); dll_dllcrt0(m_dllHandle, NULL); // crash here I'm shooting in the dark mostly -- has anyone had any success with this? Any help or any code in whatever form would be very much appreciated! Best regards, Rich LeGrand -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/