Mail Archives: djgpp/2011/03/16/23:45:17
"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 -