ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2011/03/16/23:45:17

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: "Rod Pemberton" <do_not_have AT notreplytome DOT cmm>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: csdpmi7 not working on virtualbox, how use dosmemget with seg ofs from int21h?
Date: Wed, 16 Mar 2011 23:37:31 -0400
Organization: Aioe.org NNTP Server
Lines: 44
Message-ID: <ilrve5$rtg$1@speranza.aioe.org>
References: <39cdc18e-eccb-4213-b896-db3be020702e AT w9g2000prg DOT googlegroups DOT com> <iknmth$1lb$1 AT speranza DOT aioe DOT org> <3e035797-6b8e-4106-bd29-98e87a9cc121 AT a21g2000prj DOT googlegroups DOT com> <E1Pz5o6-0001qv-4s AT fencepost DOT gnu DOT org> <f1bda3ea-6f2b-4e52-9378-85dd56198198 AT i39g2000prd DOT googlegroups DOT com> <ilqu49$5v6$1 AT speranza DOT aioe DOT org> <194E05B4528348F9953D7638294BB65F AT broadpark DOT no>
NNTP-Posting-Host: sg0uvLzlDfZOqmCSVnJXCA.user.speranza.aioe.org
X-Complaints-To: abuse AT aioe DOT org
X-Notice: Filtered by postfilter v. 0.8.2
X-Newsreader: Microsoft Outlook Express 6.00.2800.2001
X-Priority: 3
X-MSMail-Priority: Normal
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.2001
Bytes: 2558
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Gisle Vanem" <gvanem AT broadpark DOT no> wrote in message
news:194E05B4528348F9953D7638294BB65F AT broadpark DOT no...
> "Rod Pemberton" <do_not_have AT notreplytome DOT cmm> wrote:
>
> > #define OFFS 261
> > #define BUFL 44
>
> Rob, to make it even cleaner, more understandable and safer, I would
> had done:
>
> #define OFFS (PATH_MAX+2)   /* 512+2, ext-buffer after 'mpath' */
>

IIRC, POSIX's maximum path is 512.  DOS' maximum path is 260.  MAXPATH is
defined in dir.h as 260.  That's why OFFS is 260+1.  One could include dir.h
and use MAXPATH instead.  But, for 7303, I'd think one would only need pass
the drive letter, colon, and backslash as a string...  So, 261 is rather
large, IMO, for 0x7303's needs.  It was originally for LFN 0x71A0 which
accepted a path, possibly a large one.

> #define BUFL sizeof(extFAT32FreeSpaceStructure)
...

> int lfn_7303(const char *mpath)
> {
>   assert (OFFS+BUFL < __tb_size);

In this case, I believe that's always true...  OFFS and BUFL are small
relative to tb's size, which the last I checked was 16KB.

>   dosmemput(mpath, 32, __tb);
>
> Otherwise, flawless. It also works here under a Win-XP SP3 4dos
> box.
>

No, it needs the initialization of the second uint16_t item in the struct,
as Jason did directly to tb as if the struct was already copied there.


Rod Pemberton
PS.  Seems everyone is calling me Rob lately...  Third time's the charm?


- Raw text -


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