X-Spam-Check-By: sourceware.org
Message-ID: <4457BF67.220D8F5B@dessent.net>
Date: Tue, 02 May 2006 13:21:59 -0700
From: Brian Dessent <brian@dessent.net>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: Truncated Environment Variables? - using Cygwin +     GetEnvironmentStrings()   WIN32 API
References: <44542B34.9000907@arkasoft.com> <44543FE2.5070208@arkasoft.com> <44544896.10E80D75@dessent.net> <44576A04.3090409@arkasoft.com>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Reply-To: cygwin@cygwin.com
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Kaveh Goudarzi wrote:

>         I downloaded the src for cygwin and compiled my code
> as below (cygwin is where I did the cvs pull).
> 
> gcc -o envs-test.exe env-test.c -I  cygwin/src/winsup/cygwin/include/sys
> 
>         I call cygwin_internal ( CW_SYNC_WINENV )  prior to
> the call to GetEnvironmentStrings ... the strange thing is the
> value that comes back ... looking at the code (cygwin/src/winsup/cygwin/external.cc)
> I expected zero but I get another value (4294967295 ... uninitialized return?)

You need to be careful with the versions here.  You shouldn't try to use
current headers with an old DLL.  In this case CW_SYNC_WINENV was not a
feature in the released vesion 1.5.19, but was added to CVS after its
release.  If you just take a standard Cygwin install and try to compile
a program that calls cygwin_internal (CW_SYNC_WINENV) you should get a
compile error.  This is your signal that you need to use a snapshot --
both headers and DLL.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

