Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Message-ID: <3AE05CFF.9D92E32F@lescher.de>
Date: Fri, 20 Apr 2001 18:00:00 +0200
From: Christian Lescher <christian@lescher.de>
X-Mailer: Mozilla 4.7 [de] (Win95; I)
X-Accept-Language: de
MIME-Version: 1.0
To: "Larry Hall (RFK Partners, Inc)" <lhall@rfk.com>
CC: Lescher Christian <christian.lescher@icn.siemens.de>,
        "'Andrew Markebo'" <flognat@flognat.myip.org>,
        Troy Noble <troy.noble@channelpoint.com>, cygwin@cygwin.com
Subject: Re: AW: DLL function with string result?
References: <4.3.1.2.20010420103953.022a2700@pop.ma.ultranet.com>
Content-Type: text/plain; charset=iso-8859-2
Content-Transfer-Encoding: 7bit

> Yes, there is a general problem when you want to allocate in one DLL made
> by one compiler and de-allocate in another built be another compiler.  In
> this case, the heaps are different.  This is not a Cygwin-specific issue.

I see. Would it be possible then to define a second function within the DLL, let's say freeStr(const char* resStr) which releases the memory
again?

And should Troy Noble's code then work for strings > 64 KB, too? (Currently, I get an access violation, even when not freeing the allocated
memory outside the DLL.)

char*
mallocAndStrCpy (const char* srcStr) {
   if (srcStr == NULL)
      return NULL;
   return strdup(srcStr);
}



--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

