delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/04/20/19:05:42

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <00d801c0c9ee$5ebc44d0$0200a8c0@lifelesswks>
From: "Robert Collins" <robert DOT collins AT itdomain DOT com DOT au>
To: "Christian Lescher" <christian AT lescher DOT de>,
"Larry Hall \(RFK Partners, Inc\)" <lhall AT rfk DOT com>
Cc: "Lescher Christian" <christian DOT lescher AT icn DOT siemens DOT de>,
"'Andrew Markebo'" <flognat AT flognat DOT myip DOT org>,
"Troy Noble" <troy DOT noble AT channelpoint DOT com>, <cygwin AT cygwin DOT com>
References: <4 DOT 3 DOT 1 DOT 2 DOT 20010420103953 DOT 022a2700 AT pop DOT ma DOT ultranet DOT com> <4 DOT 3 DOT 1 DOT 2 DOT 20010420122559 DOT 0224b5f0 AT pop DOT ma DOT ultranet DOT com> <3AE07C0B DOT 928C7680 AT lescher DOT de>
Subject: Re: AW: DLL function with string result?
Date: Sat, 21 Apr 2001 09:05:16 +1000
MIME-Version: 1.0
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
X-OriginalArrivalTime: 20 Apr 2001 22:57:24.0199 (UTC) FILETIME=[436C7F70:01C0C9ED]

----- Original Message -----
From: "Christian Lescher" <christian AT lescher DOT de>
To: "Larry Hall (RFK Partners, Inc)" <lhall AT rfk DOT com>
Cc: "Lescher Christian" <christian DOT lescher AT icn DOT siemens DOT de>; "'Andrew
Markebo'" <flognat AT flognat DOT myip DOT org>; "Troy Noble"
<troy DOT noble AT channelpoint DOT com>; <cygwin AT cygwin DOT com>
Sent: Saturday, April 21, 2001 4:12 AM
Subject: Re: AW: DLL function with string result?


> I found that in windowsx.h of cygwin/gcc there are the following
functions defined:
>
> #define GlobalAllocPtr(flags,cb)
(GlobalLock(GlobalAlloc((flags),(cb))))
> #define GlobalFreePtr(lp)
(GlobalUnlockPtr(lp),(BOOL)GlobalFree(GlobalPtrHandle(lp)))
>
> May these functions also be used for copying a string? How must they
be used? (Maybe this works also for string > 64 KB?!)
> Is this also a way for interworking of Borland and Visual?

I'd like to point out that /dec/clipboard in cygwin uses standard
malloc, which IIRC strdup does as well. /dev/clipboard handles
multi-megabyte copy and pastes.

There are _no_ issues that I know of with strings > 64Kb in cygwin.

64Kb is the largest size of a single segment in x86 processors running
in real mode. Some of the early win9x series microsoft class libraries &
utilities had a 64Kb limit on various things  because (As I understand
it) they were not fully ported to protected mode when win95 came out. If
you are seeing 64Kb issues I suggest you do the following.

In your compiler environment (ie if your prog is in Visual, your library
in Cygwin then I mean in visual), write a test case. If that works then
it's either a interop issue or a problem with the library compiler.

Rob


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


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

- Raw text -


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