This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Truncated Environment Variables? - using Cygwin + GetEnvironmentStrings() WIN32 API
- From: Brian Dessent <brian at dessent dot net>
- To: cygwin at cygwin dot com
- Date: Tue, 02 May 2006 13:21:59 -0700
- 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>
- Reply-to: 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/