To:
[email protected] (Charles Sandmann)
Copy:
[email protected]
Copy:
[email protected]
Copy:
[email protected]
Date: Thu, 21 Mar 2024 00:15:22 +0100
From: Pali <[email protected]>
Cc: [email protected]
In function __dpmi_set_page_attributes implemented in d0507.S assembly
file is missing propagation of ECX register on error.
DPMI 1.0 spec says that if function 0507H is unsuccessful then it sets
ECX to number of pages that have been set.
It is not clear from the spec whether ECX is _always_ set, regardless
of the error code returned in AX. Some error codes don't sound like
they could happen after successfully setting attributes of several
pages. Do we have any information about what the various DPMI 1.0
hosts actually do in this case? Should we at least check in the
function's code that the value in ECX is non-negative and smaller than
the value of ECX set by the caller?
I also question the wisdom of writing into the input structure
provided by the caller -- the caller might not expect that. What
other DPMI functions do something like that?
But DJGPP's wrapper for DPMI 0507H in __dpmi_set_page_attributes
propagates ECX register value to caller only if DPMI function success.
Value stay unmodified if function fails.
Maybe I'm missing something, but I don't see where the DPMI macro
propagates ECX back to the caller when the DPMI call succeeds. What I
see is that the value of info->count stays unmodified regardless of
whether the call succeeds or fails. What did I miss?
Could you look at this problem?
I have there a simple fix for it. The following change propagates ECX register back to the caller not only on success, but also on failure.
Any real-life situation where you need this enhancement?
(I added Charles to the addressees in the hope that he could find a
moment to look at this and comment.)
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)