Date: Thu, 21 Mar 2024 00:15:22 +0100
From: Pali <pali@pali.im>
Cc: djgpp@delorie.com
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.
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.
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.
Date: Thu, 4 Apr 2024 20:48:44 +0200
From: Pali <pali@pali.im>
Cc: Charles Sandmann <cwsdpmi@earthlink.net>, dj@delorie.com,
sezeroz@gmail.com, djgpp@delorie.com
On Thursday 21 March 2024 09:22:17 Eli Zaretskii wrote:
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?
That is a good idea. Here is an alternative change which does this check:
Date: Sat, 13 Apr 2024 02:37:17 +0200
From: Pali <pali@pali.im>
Cc: cwsdpmi@earthlink.net, dj@delorie.com, sezeroz@gmail.com,
djgpp@delorie.com
On Friday 12 April 2024 16:32:40 Eli Zaretskii wrote:
Date: Thu, 4 Apr 2024 20:48:44 +0200
From: Pali <pali@pali.im>
Cc: Charles Sandmann <cwsdpmi@earthlink.net>, dj@delorie.com,
sezeroz@gmail.com, djgpp@delorie.com
On Thursday 21 March 2024 09:22:17 Eli Zaretskii wrote:
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?
That is a good idea. Here is an alternative change which does this check:
Thanks, installed.
I would propose to extend documentation for DPMI 0507h function to
include information about modifying the size member.
--- src/libc/dpmi/api/d0507.txh
+++ src/libc/dpmi/api/d0507.txh
@@ -27,2 +27,10 @@ attribute word.
+On error this function changes @code{@var{info}->size} to the number
+of modified pages as reported by DPMI function AX = 0x0507. If DPMI +function reports that all input pages were modified or even more
+number of pages than the input number of pages were modified then it
+is treated as invalid value reported by DPMI function and so this
+functions changes @code{@var{info}->size} to 0 as probably no page
+was modified.
+
The DJGPP startup code calls this function to uncommit the so-called
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 485 |
Nodes: | 16 (2 / 14) |
Uptime: | 112:55:02 |
Calls: | 9,650 |
Calls today: | 8 |
Files: | 13,704 |
Messages: | 6,165,032 |
Posted today: | 2 |