Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The less time planning, the more time programming.


devel / comp.os.msdos.djgpp / Re: Error handling of ECX in __dpmi_set_page_attributes()

SubjectAuthor
* Re: Error handling of ECX in __dpmi_set_page_attributes()Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com]
`- Re: Error handling of ECX in __dpmi_set_page_attributes()Rugxulo (rugxulo@gmail.com) [via djgpp@delorie.com]

1
Re: Error handling of ECX in __dpmi_set_page_attributes()

<86o7b82gnq.fsf@gnu.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=483&group=comp.os.msdos.djgpp#483

 copy link   Newsgroups: comp.os.msdos.djgpp
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Thu, 21 Mar 2024 07:22:31 +0000
X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp@delorie.com
X-Recipient: dj@delorie.com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
mime-version; bh=i9xc/LhcGRJXpdK4ftXE+f4IWa8ymdtHu0slczRKb/Y=; b=Kfa6xlY9mwhn
OvRPz8t/7YLnH4OH5y0edNbNQQc9kqvMSba634U3wyg7Nsw0jFiPd7mBpaEgptRQmcGrXs7v227GZ
Beq8FTH4oBM2adKghd6rJ7ZHQoN6Xo60eWTvd+ll5rph2pLM6jKnYMBJPzkDCvtFmUFVVJrrzGERn
e5HKqh/CC1lI0z9jqKfhNZW7YOe8saVpYs9IeK1B9Cu/ihiM09S/Psd/dsoFbOyVZyzfbbw3YvW/u
CBno8JOTkeZyuFFi31IO55nCbwHGl3H/tOar7i5+PnO807CR0r+XTtcBN2Zb/az4TNZiSNaPJey84
rF5zeoX5KtKQl8eh806pXQ==;
Date: Thu, 21 Mar 2024 09:22:17 +0200
Message-Id: <86o7b82gnq.fsf@gnu.org>
From: djg...@delorie.com (Eli Zaretskii (eliz@gnu.org) [via djgpp@delorie.com])
To: Pali <pali@pali.im>, Charles Sandmann <cwsdpmi@earthlink.net>
Cc: dj@delorie.com, sezeroz@gmail.com, djgpp@delorie.com
In-Reply-To: <20240320231522.fowijjlk2h6ilw6x@pali> (message from Pali on Thu,
21 Mar 2024 00:15:22 +0100)
Subject: Re: Error handling of ECX in __dpmi_set_page_attributes()
References: <20240320231522.fowijjlk2h6ilw6x@pali>
Reply-To: djgpp@delorie.com
Errors-To: nobody@delorie.com
X-Mailing-List: djgpp@delorie.com
X-Unsubscribes-To: listserv@delorie.com
Precedence: bulk
Newsgroups: comp.os.msdos.djgpp
Organization: None provided
DJ-Gateway: from mailing list djgpp@delorie.com
Lines: 40
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-uTXBr4TJrGFWOfJgX70Vwa5KtFTXNlEJ5Ikr5cInzH7Hf6ymmSeMbRQaqR1K0DBeWCt0Lxtr9pfFaA0!uc8qBapWOPKujrigypcmU6sJHeuDlmFVkROPpPCiCt+8
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Received-Bytes: 3944
 by: Eli Zaretskii (eliz@ - Thu, 21 Mar 2024 07:22 UTC

> 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.

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.)

Re: Error handling of ECX in __dpmi_set_page_attributes()

<CAA-ihx_+CvPpsJzTiuf3BzOvZ_JCq7nUNwsOAfF5o4LMMHTEEA@mail.gmail.com>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=484&group=comp.os.msdos.djgpp#484

 copy link   Newsgroups: comp.os.msdos.djgpp
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!Xl.tags.giganews.com!local-1.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sat, 23 Mar 2024 00:30:58 +0000
X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
X-Recipient: djgpp@delorie.com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1711153841; x=1711758641; darn=delorie.com;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:from:to:cc:subject:date
:message-id:reply-to;
bh=kjlu7uT+MlS0B6tQxvfXbzCZ51EpWl99Ays1Lz5M4kM=;
b=F+qNK6J04QVH/j0rxRy5cMmBkQg6aI9zm79HcQdozA/lmgnrtm7KjhzaytAUtxjgx3
sFd+GD8eTFf5IZejVhEThf3cm16QRoXNOVHW+CGgRGfcTVaDSksyi1DdXwEnWpiTPtMV
x3I2bQw9xbW0avqEraz/iTKhEqd80yjEfBHEcnhk2t3ENXaXZMPfmSFT6VAC3Md68X9I
fKS5p2bZir5NbyApQ106VeLaqfC7O4p68gMhBGTkwBRHCNpX1bsADEBrUBUin+BGC+ZN
HY4jiBmfQ5Ach1kZ095+BQkaIfThYKPpLlD74EgQ7zaiH0DM7irCeuzuS88VuLojhSBr
oFGQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1711153841; x=1711758641;
h=content-transfer-encoding:cc:to:subject:message-id:date:from
:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to;
bh=kjlu7uT+MlS0B6tQxvfXbzCZ51EpWl99Ays1Lz5M4kM=;
b=PKmZfTwsOfLzeto7iMyGeHhA5Mc/FgQwUfOwoGQu3f/ocG6cIvtl1Hgrpc/P6jTvVz
cK98ymLVcmaX53i3SwQaXPel9ebEQzcWfpwpSsBuEzKxP71VBW9OD3vET2KjBUYJ39G4
bgXgAnc1A0F/X0OQu5AeDyHLDDffyR9ycdXezNFw9saPjoZEwMIVinnhktc25TIhbpgH
DlTIkEA+jBnytjEm3Lck/3X3UJg40jNC8Un+wyVdyRyHeFjRbQ8/gfeia0QwJut+gFUJ
ncCv+U2m2pa/pbveSnQ0LsA1mGVYq1CuI1wVwgvQBQy1lwI/ipXA+8C8UDS1zD4QKOJo
9uZg==
X-Gm-Message-State: AOJu0YyPOt40Va6cYY94jihpoxHRAedCfj8ZblUGaL2by8oY/bvmLYvy
VYNRAK+aQGcjSAkww9G7xXukuFkHgh0CjbFTFmZh8Zky+istpZlzEcMWfy+8eyswD2UDsbLq80V
L3dgY9+4xKr6K1tWI3Fsetvf5wqRHj47xTaE=
X-Google-Smtp-Source: AGHT+IGLJW5PWDnMh+v/6Y15ds++MHQZTroZ7nRRmK4jhLFsUVmV8xtQ3GdcYk/vGfwKYgfO1qpbRDABmr3MQTVlWW4=
X-Received: by 2002:a25:dbca:0:b0:dcc:383b:e48d with SMTP id
g193-20020a25dbca000000b00dcc383be48dmr954482ybf.26.1711153841175; Fri, 22
Mar 2024 17:30:41 -0700 (PDT)
MIME-Version: 1.0
References: <20240320231522.fowijjlk2h6ilw6x@pali> <86o7b82gnq.fsf@gnu.org>
In-Reply-To: <86o7b82gnq.fsf@gnu.org>
From: djg...@delorie.com (Rugxulo (rugxulo@gmail.com) [via djgpp@delorie.com])
Date: Fri, 22 Mar 2024 19:30:28 -0500
Message-ID: <CAA-ihx_+CvPpsJzTiuf3BzOvZ_JCq7nUNwsOAfF5o4LMMHTEEA@mail.gmail.com>
Subject: Re: Error handling of ECX in __dpmi_set_page_attributes()
To: djgpp@delorie.com
Cc: Pali <pali@pali.im>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id 42N0Ugj72027052
Reply-To: djgpp@delorie.com
Errors-To: nobody@delorie.com
X-Mailing-List: djgpp@delorie.com
X-Unsubscribes-To: listserv@delorie.com
Precedence: bulk
Newsgroups: comp.os.msdos.djgpp
Organization: None provided
DJ-Gateway: from mailing list djgpp@delorie.com
Lines: 23
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-mbqrEdLx40pJByNjN/0QsaH8lyxtvLhT5fDj233IYD61XWPawfUkaI4hcH3q4r3NHBCApIWt/+jd/Xz!pbY3YuH2tq3TAV4tVUxwaxTbPHVPoJgCu5AromJUoc8ggG8KCvL7rsbZvolFWgYr6ya1/FvZuw0l!OCYKWeXEBHAA60BbNqyijpNCHpE=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Received-Bytes: 4731
 by: Rugxulo (rugxulo@gma - Sat, 23 Mar 2024 00:30 UTC

Hi,

On Thu, Mar 21, 2024 at 2:23 AM Eli Zaretskii (eliz@gnu.org) [via
djgpp@delorie.com] <djgpp@delorie.com> wrote:
>
> > 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?

Sudley Place's DPMIONE is GPL'd these days, IIRC, and supports DPMI 1.0.
Otherwise, I'd mainly suggest testing CWSDPMI (obviously) and
(Japheth's HX) HDPMI32.

* https://github.com/sudleyplace/DPMIONE
* https://github.com/Baron-von-Riedesel/HX

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor