delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/02/14/11:23:00

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-transfer-encoding
:mime-version; q=dns; s=default; b=h0RKH8b9jwgIV/Z/NY17FXbKOQqT7
FJLEZE+Yiwr58uBhtenDAgLEJyCno3me5rd7ktMft9P9F15zJT1uRYe2hUPPzKyq
sSJQ6xzaLcx30AzaFGHKBTwAilX1q/WlHiYJZ2mzoQx4doJVY9D55eV7M1EHWj/4
g6R6H0+j1A0vmk=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-transfer-encoding
:mime-version; s=default; bh=VwP6indF2990jPC8jvSAXt8IQ9g=; b=YXu
UAuPogu7UKbBRwhAZaVCHVbTfz+ZURBMr3v7/bWezhQ56vHET7sQoDz1nHqsKlXx
9vvrRMD1bYbZtvpx2YYVqa6yGgWTsbiQM1/gZelyAeRTPucg2ioq3K0PZvCHNypB
QJuyMz1aaRjazUXWKp0piFy0Ahbp2dr8Kq1Alj8o=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=0.3 required=5.0 tests=AWL,BAYES_99,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2
X-HELO: na01-bn1-obe.outbound.protection.outlook.com
From: Stephan Mueller <Stephan DOT Mueller AT microsoft DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: RE: Interesting footnote about environment variables block
Date: Fri, 14 Feb 2014 16:22:04 +0000
Deferred-Delivery: Fri, 14 Feb 2014 16:21:00 +0000
Message-ID: <28dada277ca348b5b5833b45d18e030a@BL2PR03MB145.namprd03.prod.outlook.com>
References: <1052349406 DOT 20140214115021 AT mtu-net DOT ru> <52FDE698 DOT 3010707 AT lysator DOT liu DOT se>
In-Reply-To: <52FDE698.3010707@lysator.liu.se>
x-forefront-prvs: 01221E3973
x-forefront-antispam-report: SFV:NSPM;SFS:(10009001)(6009001)(189002)(24454002)(199002)(51704005)(85306002)(80022001)(66066001)(53806001)(65816001)(54316002)(77982001)(56776001)(93516002)(80976001)(54356001)(19580395003)(59766001)(51856001)(63696002)(46102001)(76482001)(94316002)(47446002)(86362001)(74662001)(83322001)(86612001)(95416001)(56816005)(33646001)(74502001)(31966008)(94946001)(15975445006)(81686001)(50986001)(47736001)(81816001)(77096001)(93136001)(49866001)(85852003)(15202345003)(4396001)(90146001)(69226001)(74316001)(74876001)(2656002)(87266001)(87936001)(74366001)(81342001)(81542001)(74706001)(76796001)(76576001)(76786001)(83072002)(92566001)(79102001)(95666001)(24736002);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2PR03MB147;H:BL2PR03MB145.namprd03.prod.outlook.com;CLIP:50.46.147.3;FPR:;MLV:sfv;InfoNoRecordsMX:1;A:1;LANG:en;
MIME-Version: 1.0
X-OriginatorOrg: microsoft.com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id s1EGMqSO002086

Andrey Repin wrote:

> http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx?pf=true
> 
>> The maximum total environment variable size for all variables, which
>> includes variable names and the equal sign, is 65,536KB.

The actual limit, on old OSes (such as Windows XP) is 64KB or 65536 bytes.  This text appears to contain a typo; likely someone decided to change from one representation to the other, and forgot to change the units when they changed the number.  Newer OSes have lifted the 64KB limitation; I forget exactly when. 

> http://msdn.microsoft.com/en-us/library/windows/desktop/ms682653(v=vs.85).aspx
> (And consequently,
> http://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx
> )

These docs are the documentation for the CreateProcess API.  I'm guessing the relevant text here is:

	The ANSI version of this function, CreateProcessA fails if the total size of the environment block for the process exceeds 32,767 characters.

The limit described here is independent of the one in the XP documentation.  The typical behaviour of a large number of Windows FooA APIs is to widen their argument strings from ANSI to UTF-16, and then call the FooW API to do the actual work.  The 32K limit here is likely related to the size of the buffer used for the temporary wide copy of the argument.

> I don't know, how it is applicable to Cygwin.

Likewise. 

stephan();


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


- Raw text -


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