delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/09/06/21:08:37

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Mon, 6 Sep 2004 21:07:38 -0400
Message-Id: <200409070107.i8717c0u020207@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
CC: bartoldeman AT ihug DOT co DOT nz
In-reply-to: <chip62$4sb$1@lust.ihug.co.nz> (message from Bart Oldeman on Tue,
07 Sep 2004 10:43:08 +1200)
Subject: Re: DJGPP's NULL pointer protection seems to violate DPMI spec
References: <chip62$4sb$1 AT lust DOT ihug DOT co DOT nz>
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

DJGPP does not violate the DPMI spec because DJGPP does not
*implement* the DPMI spec.  When it calls DPMI 0507 to uncommit the
zero page, the DPMI server is permitted to do one of two things:

1. Uncommit the page.
2. Report an error 8023H (invalid handle).

DJGPP programs will accept either of these results.  If your DPMI server
does anything else, your DPMI server is broken.

The reason we do it this way is because 0504 is a DPMI 1.0 function so
we can't rely on it being available to allocate the memory.  However,
if 0507 *happens* to work (which it does for CWDPMI), we get NULL
protection.

As for tokbot, if it doesn't run under CWSDPMI (i.e. real dos, not
dosemu) but does under Windows, then it is probably dereferencing a
NULL pointer, and is broken.  No DJGPP program ever has a valid reason
for dereferencing a NULL pointer.  This is FAQ 9.1
(http://www.delorie.com/djgpp/v2faq/faq9_1.html).

And no, I didn't write the DPMI spec.

- Raw text -


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