delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/12/22/23:47:18

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=3.0 required=5.0 tests=AWL,BAYES_40,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
From: <Eric DOT Zurcher AT csiro DOT au>
To: <cygwin AT cygwin DOT com>
Date: Wed, 23 Dec 2009 15:47:03 +1100
Subject: Suggested improvement to cygload.cc
Message-ID: <0A5E41F72813C247889F7974C8D764955C2978F45E@exvic-mbx04.nexus.csiro.au>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hi,

I've recently had need to dynamically load a Cygwin DLL into an non-Cygwin =
application. The FAQ entry for doing this and the associated sample applica=
tion (/src/winsup/testsuite/winsup.api/cygload.cc) are both a bit out-of-da=
te, though they still provided me with enough information to get this worki=
ng correctly.

A useful modification to cygload.cc and cygload.h might be to replace the f=
ixed size (currently 32768) used for "padding" with a dynamically determine=
d value. The number of bytes needed can be obtained by making the call:

int padSize =3D cygwin_internal(CW_CYGTLS_PADSIZE);

Making use of this value might require a bit more inline assembler (that's =
the approach I'm using), rather than simply declaring a variable to chew up=
 the stack space, but this might keep things from breaking if the padding s=
ize changes in future releases of cygwin1.dll.

I'm not sure who maintains this stuff, so I'm just posting this suggestion =
to the list, in the hope that someone can and will act upon it.

Thanks!

Eric Zurcher
CSIRO Plant Industry
Canberra, Australia
Eric DOT Zurcher AT csiro DOT au

--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019