Date: Tue, 24 Apr 2001 09:37:43 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Charles Sandmann cc: theowl AT freemail DOT c3 DOT hu, djgpp-workers AT delorie DOT com Subject: Re: win2000/ntvdm/djgpp (fwd) In-Reply-To: <10104232231.AA19751@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 Mon, 23 Apr 2001, Charles Sandmann wrote: > > I have an idea. Is it true that _running_ when _CurrentPSPSelector is > > zero is okay, and that only _exiting_ when it is zero causes NTVDM to > > crash? If so, we could set the PSP in the exit code. This would > > solve both the normal spawn and the case of abnormal termination via > > Ctrl-C, because the parent will restore its PSP just before it exits. > > Reading through the thread, this was my thought on the way to fix it also. > I would also possibly set the PSP on the return from exec to help protect > from the case where we sometimes call _exit and don't go through the > exit handler. I'm not sure I'm following. I was thinking about setting the PSP inside dpmiexcp.c:_exit, or even inside crt0.S:__exit. What are the cases where we bypass those, and what did you mean by the ``exit handler'' in the last sentence above? Setting PSP on return from spawn does seem to be an extra safety precaution, for those rare cases where we spawn a DPMI program that is not a DJGPP program, or if it was compiled with an older library. So perhaps setting the PSP both in the exit code and after returning from spawn is best. > To get W2K to see it, do we need to do a dpmi_int with the real mode PSP, > or a protected mode Int 21 with the PM selector for the PSP? A good question. I don't know; anyone?