docs: document remaining ncp22 legacy directory layouts

This commit is contained in:
Mario Fetka
2026-06-01 20:44:35 +00:00
parent cb4d9c8a9e
commit 969eb5f4e7
2 changed files with 142 additions and 11 deletions

View File

@@ -4542,6 +4542,21 @@ static int handle_ncp_serv(void)
break;
case 0x2a : { /* Get Eff. Rights of DIR's and Files */
/*
* NCP 0x2222/22/42 Get Effective Rights for Directory Entry.
*
* SDK request payload after the group header:
* byte DirHandle
* byte PathLen
* byte Path[PathLen]
*
* Reply:
* word AccessRights (Lo-Hi)
*
* Parser comparison: current code reads the documented
* payload offsets and returns the documented Lo-Hi rights
* word.
*/
struct XDATA {
uint8 eff_rights[2]; /* LO-HI */
} *xdata = (struct XDATA*) responsedata;
@@ -4574,6 +4589,22 @@ static int handle_ncp_serv(void)
break;
case 0x2b : { /* remove ext trustees */
/*
* NCP 0x2222/22/43 Remove Extended Trustee from Dir or File.
*
* SDK request payload after the group header:
* byte DirHandle
* long ObjectID (Hi-Lo)
* byte Unused
* byte PathLen
* byte Path[PathLen]
*
* No reply data.
*
* Parser comparison: current code reads DirHandle,
* ObjectID, the reserved byte, PathLen, and Path at the
* documented offsets.
*/
struct INPUT {
uint8 header[7]; /* Requestheader */
uint8 div[3]; /* 0x0, dlen, ufunc */
@@ -4610,6 +4641,29 @@ static int handle_ncp_serv(void)
break;
case 0x2c : { /* Get Volume and Purge Information */
/*
* NCP 0x2222/22/44 Get Volume and Purge Information.
*
* SDK request payload after the group header:
* byte VolumeNumber
*
* Reply:
* long TotalBlocks (Hi-Lo in the PDF)
* long FreeBlocks (Lo-Hi)
* long PurgeableBlocks (Lo-Hi)
* long NotYetPurgeableBlocks (Lo-Hi)
* long TotalDirEntries (Lo-Hi)
* long AvailableDirEntries (Lo-Hi)
* byte Reserved[4]
* byte SectorsPerBlock
* byte VolumeNameLen
* byte VolumeName[VolumeNameLen]
*
* Parser comparison: request offset matches. The current
* reply maps Unix filesystem totals to the legacy shape and
* uses U32_TO_32() for all 32-bit counters; the PDF marks
* only TotalBlocks as Hi-Lo while the rest are Lo-Hi.
*/
/* new Call since V3.11 */
/* ncpfs need this call */
int volume = (int) *(p+1);
@@ -4645,6 +4699,25 @@ static int handle_ncp_serv(void)
break;
case 0x2d : { /* Get Direktory Information */
/*
* NCP 0x2222/22/45 Get Directory Information.
*
* SDK request payload after the group header:
* byte DirHandle
*
* Reply:
* long TotalBlocks (Lo-Hi)
* long AvailableBlocks (Lo-Hi)
* long TotalDirEntries (Lo-Hi)
* long AvailableDirEntries (Lo-Hi)
* byte Reserved[4]
* byte SectorsPerBlock
* byte VolumeNameLen
* byte VolumeName[VolumeNameLen]
*
* Parser comparison: request offset and reply byte order
* match the documented legacy directory-information shape.
*/
int dir_handle = (int) *(p+1);
struct XDATA {
uint8 total_blocks[4];
@@ -4679,19 +4752,23 @@ static int handle_ncp_serv(void)
case 0x2e : { /* Rename or Move (old) */
/*
* NCP 22 / subfunction 46 (0x2e): Rename Or Move (old)
* NCP 0x2222/22/46 Rename Or Move (old).
*
* Request:
* byte source directory handle
* byte search attributes
* byte source path component count
* source path components: byte len + bytes, repeated
* byte destination directory handle
* byte destination path component count
* destination path components: byte len + bytes, repeated
* SDK request payload after the group header:
* byte SourceDirHandle
* byte SearchAttribute
* byte SourcePathComponentCount
* byte SourcePath[SourcePathLen]
* byte DestDirHandle
* byte DestPathComponentCount
* byte DestPath[DestPathLen]
*
* No reply data. This old call uses component-counted
* paths, unlike the plain length-prefixed NCP 69 rename.
*
* Parser comparison: current code decodes both component
* path lists in the documented order and supports different
* source/destination handles.
*/
uint8 srcpath[256];
uint8 dstpath[256];
@@ -4755,6 +4832,22 @@ static int handle_ncp_serv(void)
#if WITH_NAME_SPACE_CALLS
case 0x2f : { /* Fill namespace buffer */
/*
* NCP 0x2222/22/47 Get Name Space Information.
*
* SDK request payload after the group header:
* byte VolumeNumber
*
* Reply is a variable-length namespace/datastream inventory:
* DefinedNameSpaces, namespace names, DefinedDataStreams,
* stream-to-namespace mappings, loaded namespaces, volume
* namespaces, and volume data streams.
*
* Parser comparison: request offset matches. Reply is built
* by fill_namespace_buffer(); it reports MARS-NWE's known
* DOS/MAC/NFS/FTAM/OS2 namespace table and loaded/volume
* namespace lists in the documented variable layout.
*/
/* ncopy use this call */
int volume = (int) *(p+1);
/* (p+2) == 0xe4 or 0xe2 sometimes ???? */
@@ -4767,6 +4860,21 @@ static int handle_ncp_serv(void)
break;
case 0x30 : { /* Get Name Space Directory Entry */
/*
* NCP 0x2222/22/48 Get Name Space Directory Entry.
*
* SDK request payload after the group header:
* byte VolumeNumber
* long DOSSequence
* byte NameSpace
*
* Reply is the namespace-specific directory-entry record.
*
* Parser comparison: request offset matches. The PDF does
* not label DOSSequence byte order; current code reads it
* with GET_32() and get_namespace_dir_entry() returns the
* DOS NW_SCAN_DIR_INFO-shaped entry for the resolved base.
*/
int volume = (int) *(p+1);
uint32 basehandle = GET_32(p+2);
int namespace = (int) *(p+6);