API Change: DOS Packets for ACTION_EXAMINE_OBJECT/FH and fib_FileName/fib_Comment
commit210597e9c2734b0ed6b82567d78aa987e6264919
authorjmcmullan <jmcmullan@fb15a70f-31f2-0310-bbcc-cdcc74a49acc>
Wed, 13 Jul 2011 11:06:47 +0000 (13 11:06 +0000)
committerjmcmullan <jmcmullan@fb15a70f-31f2-0310-bbcc-cdcc74a49acc>
Wed, 13 Jul 2011 11:06:47 +0000 (13 11:06 +0000)
tree1b2cca6da9618b823d8f59548fd105f946caf210
parent0194285a3d344da4de24efc087999378f28d0cc3
API Change: DOS Packets for ACTION_EXAMINE_OBJECT/FH and fib_FileName/fib_Comment

The DOS Packet ACTION_EXAMINE_OBJECT fills in a FileInfoBlock
structure, and two fields are.. well.. special.

Both fib_Comment and fib_FileName are documented as ASCIIZ in the
Commodore headers, BUT on m68k they are expected to be BCPL strings
*when the handler fills them in*, and yet by the time Dos/Examine()
returns, they have been transformed into ASCIIZ strings.

So, the question is, what should be do for AROS?

Previously, all handlers had to use the AROS_BSTR* macros
on those fields, and on AROS_FAST_BPTR architectures, no BSTR ->
ASCIIZ translation needsedto be done.

However, porting 3rd party handlers has made more difficult, since they
expect these fields be BCPL strings, and do things like:

 fib->fib_Comment[0] = strlen(comment);
 CopyMem(comment, &fib->fib_Comment[1], fib->fib_Comment[0])

After discussion on the AROS mailling list, it was decided that
to easy portability,  the Dos/Examine???() routines now always
expect BCPL style strings in fib_Comment and fib_FileName  in
the reply from the ACTION_EXAMINE_OBJECT/FH commands, and
reformat the fields as ASCIIZ before returning to caller of Dos/Examine??()

Signed-off-by: Jason S. McMullan <jason.mcmullan@gmail.com>
git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@40072 fb15a70f-31f2-0310-bbcc-cdcc74a49acc
15 files changed:
arch/all-hosted/devs/filesys/emul_handler/emul_handler.c
arch/all-mingw32/devs/filesys/emul_handler/emul_host.c
arch/all-unix/devs/filesys/emul_handler/emul_host.c
compiler/include/dos/dos.h
rom/devs/filesys/AmberRAM/filesystem.c
rom/devs/filesys/CDVDFS/src/device.c
rom/devs/filesys/SFS/FS/filesystemmain.c
rom/devs/filesys/afs/filehandles3.c
rom/devs/filesys/pfs3/fs/directory.c
rom/dos/bstr_helper.c [new file with mode: 0644]
rom/dos/dos_intern.h
rom/dos/mmakefile.src
workbench/fs/pipe/pipedir.c
workbench/fs/pipe/pipename.c
workbench/fs/pipe/pipename.h