Date: Thu, 24 May 2001 09:42:44 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Charles Sandmann cc: djgpp-workers AT delorie DOT com Subject: Re: Crashes due to selector depletion In-Reply-To: <10105240351.AA12474@clio.rice.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 23 May 2001, Charles Sandmann wrote: > > (I originally considered to use the PSP selector, since the transfer > > buffer follows the PSP, but that selector seems to have a 100h-byte > > limit, or at least could be like that according to the DPMI spec.) > > You could use the 128 bytes of the command line area, overwriting it > with the message string, since you are getting ready to exit. This > should be guaranteed to be enough for a message, and fit in the limit. > > > Question: is it safe to overwrite the program's environment by using > > the environment block as the transfer buffer? Note that I don't want > > to modify the selector itself -- this is verboten by the DPMI rules -- > > only to write over the environment strings accessing them via the > > selector stuffed by the DPMI host at offset 2Ch in the PSP. > > This would probably work also, since I don't think the environment will > be needed anymore. But what if the environment is very short? Probably > unlikely (especially if you are in an environment which runs out of > selectors), but the possibility of dos memory block corruption. Thanks for all the ideas, everybody. I think I have enough to solve this in some reasonable way.