X-Spam-Check-By: sourceware.org Message-ID: <4457BF67.220D8F5B@dessent.net> Date: Tue, 02 May 2006 13:21:59 -0700 From: Brian Dessent X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Truncated Environment Variables? - using Cygwin + GetEnvironmentStrings() WIN32 API References: <44542B34 DOT 9000907 AT arkasoft DOT com> <44543FE2 DOT 5070208 AT arkasoft DOT com> <44544896 DOT 10E80D75 AT dessent DOT net> <44576A04 DOT 3090409 AT arkasoft DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Reply-To: cygwin AT cygwin DOT com 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 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/