docs: split old file io endpoint notes

This commit is contained in:
Mario Fetka
2026-06-02 14:00:31 +00:00
parent 8099631559
commit 572869da2f
2 changed files with 120 additions and 73 deletions

View File

@@ -6235,63 +6235,22 @@ static int handle_ncp_serv(void)
}
break;
/*
* Endpoint audit: old direct file-I/O calls, SDK 0x2222/65..77
* / wire 0x41..0x4d. These are the pre-namespace DOS file
* operations that sit immediately after the old commit/search calls.
* They are direct top-level NCP functions, not 22/87 subfunctions.
*
* Coverage in this switch:
*
* 65 / 0x41 Open File (old)
* 66 / 0x42 Close File
* 67 / 0x43 Create File
* 68 / 0x44 Erase File
* 69 / 0x45 Rename File
* 70 / 0x46 Set File Attributes
* 71 / 0x47 Get Current Size of File
* 72 / 0x48 Read From a File
* 73 / 0x49 Write to a File
* 74 / 0x4a Copy from One File to Another
* 75 / 0x4b Set File Time Date Stamp
* 76 / 0x4c Open File
* 77 / 0x4d Create New File
*
* Request/reply shape compared with the NDK/Core-Protocols PDF and
* the current parser:
*
* - Open/Create replies return the old six-byte NetWare FileHandle
* slot followed by Reserved and NW_FILE_INFO. The SDK documents
* FileHandle as byte[6] Hi-Lo and says clients use the most
* significant four bytes. Current MARS-NWE compatibility replies
* write zero extended-handle bytes and store the local four-byte
* handle in the remaining slot; matching close/read/write/copy/time
* handlers ignore the two extended bytes and use GET_32() on the
* local four-byte handle.
* - 65 Open File (old) is implemented by calling nw_creat_open_file()
* with fixed read access. The PDF describes it as the pre-2.0a
* form of 76 Open File and says it is equivalent to Open File with
* DesiredAccessRights 0x13; this is a compatibility difference to
* keep visible if old DOS clients expose it.
* - 67 Create File and 77 Create New File share the same parser and
* reply body. The code selects create mode 1 for 67 and mode 2 for
* 77, matching the documented overwrite-vs-fail-on-exists split.
* - 68, 69, and 70 have no reply payload; nwconn still sends the
* normal NCP response envelope with Completion.
* - 71 returns a four-byte size/position field in Hi-Lo order, as the
* old Get Current Size of File reply requires.
* - 72 and 73 use Hi-Lo file offsets and byte counts. Read preserves
* the documented odd-offset padding quirk by adding one byte before
* the returned data when the offset is odd.
* - 74 returns only the actual four-byte transfer count.
* - 75 updates date/time and has no reply payload.
*
* Missing-endpoint check: the PDF's direct old file-I/O block between
* 65 and 77 is fully represented here. Later file APIs such as
* 0x2222/84, 0x2222/87/* and 0x2222/89/* are separate namespace/open
* families and should be audited in their own blocks.
/* Old direct file-I/O calls, SDK 0x2222/65..77 / wire 0x41..0x4d.
* These pre-namespace DOS file operations are direct top-level NCP
* functions, not 22/87 subfunctions. Keep audit notes next to each
* endpoint below so request/reply checks stay local to the parser.
*/
case 0x41 : { /* open file for reading */
case 0x41 : { /* 65 Open File (old) / wire 0x41.
* Coverage: implemented.
* Request: DirHandle, SearchAttributes, PathLen, Path.
* Reply: six-byte old FileHandle slot, Reserved,
* NW_FILE_INFO. Current code writes zero extended
* handle bytes and a local four-byte handle.
* Difference: the NDK describes this pre-2.0a form as
* equivalent to 76 Open File with DesiredAccessRights
* 0x13, while this compatibility path uses fixed read
* access.
*/
struct INPUT {
uint8 header[7]; /* Requestheader */
uint8 dirhandle; /* Dirhandle */
@@ -6325,7 +6284,13 @@ static int handle_ncp_serv(void)
}
break;
case 0x42 : /* close file */
case 0x42 : /* 66 Close File / wire 0x42.
* Coverage: implemented.
* Request: reserved byte plus old six-byte FileHandle slot.
* Reply: no payload, normal Completion response.
* Difference: the two extended handle bytes are ignored;
* current code closes the local four-byte handle.
*/
{
struct INPUT {
uint8 header[7]; /* Requestheader */
@@ -6346,8 +6311,19 @@ static int handle_ncp_serv(void)
}
break;
case 0x43 : /* creat file, overwrite if exist */
case 0x4D : /* create new file */
case 0x43 : /* 67 Create File / wire 0x43.
* Coverage: implemented by the shared 67/77 parser.
* Request: DirHandle, FileAttributes, PathLen, Path.
* Reply: six-byte old FileHandle slot, Reserved,
* NW_FILE_INFO. Current code writes zero extended handle
* bytes and a local four-byte handle.
* Mode: 67 uses create mode 1, overwrite if the file exists.
*/
case 0x4D : /* 77 Create New File / wire 0x4d.
* Coverage: implemented by the shared 67/77 parser.
* Request/reply: same old create/open layout as 67.
* Mode: 77 uses create mode 2, fail if the file exists.
*/
{
struct INPUT {
uint8 header[7]; /* Requestheader */
@@ -6391,7 +6367,11 @@ static int handle_ncp_serv(void)
}
break;
case 0x44 : /* file(s) delete */
case 0x44 : /* 68 Erase File / wire 0x44.
* Coverage: implemented.
* Request: DirHandle, SearchAttributes, PathLen, Path.
* Reply: no payload, normal Completion response.
*/
{
struct INPUT {
uint8 header[7]; /* Requestheader */
@@ -6409,7 +6389,14 @@ static int handle_ncp_serv(void)
}
break;
case 0x45 : /* rename file */
case 0x45 : /* 69 Rename File / wire 0x45.
* Coverage: implemented.
* Request: DirHandle, SearchAttributes, old PathLen/Path,
* reserved byte, new PathLen/Path.
* Reply: no payload, normal Completion response.
* Limitation: current code renames within the same
* directory handle.
*/
{
struct INPUT {
uint8 header[7]; /* Requestheader */
@@ -6430,7 +6417,12 @@ static int handle_ncp_serv(void)
}
break;
case 0x46 : /* set file attributes */
case 0x46 : /* 70 Set File Attributes / wire 0x46.
* Coverage: implemented.
* Request: FileAttributes, DirHandle, SearchAttributes,
* PathLen, Path.
* Reply: no payload, normal Completion response.
*/
{
struct INPUT {
uint8 header[7]; /* Requestheader */
@@ -6449,8 +6441,13 @@ static int handle_ncp_serv(void)
}
break;
case 0x47 : /* move pointer to end of file ???? */
/* and return filesize ? */
case 0x47 : /* 71 Get Current Size of File / wire 0x47.
* Coverage: implemented.
* Request: reserved byte plus old six-byte FileHandle slot.
* Reply: four-byte size/position in Hi-Lo order.
* Difference: the two extended handle bytes are ignored;
* current code seeks the local four-byte handle to EOF.
*/
{
struct INPUT {
uint8 header[7]; /* Requestheader */
@@ -6471,7 +6468,16 @@ static int handle_ncp_serv(void)
}
break;
case 0x48 : /* read file */
case 0x48 : /* 72 Read From a File / wire 0x48.
* Coverage: implemented.
* Request: reserved byte, old six-byte FileHandle slot,
* Offset Hi-Lo, MaxBytes Hi-Lo.
* Reply: BytesRead Hi-Lo plus data.
* Compatibility: preserves the documented odd-offset
* padding quirk by inserting one byte before returned data
* when the offset is odd.
* Difference: extended handle bytes are ignored.
*/
{
struct INPUT {
uint8 header[7]; /* Requestheader */
@@ -6506,7 +6512,13 @@ static int handle_ncp_serv(void)
}
break;
case 0x49 : { /* write file */
case 0x49 : { /* 73 Write to a File / wire 0x49.
* Coverage: implemented.
* Request: reserved byte, old six-byte FileHandle slot,
* Offset Hi-Lo, BytesToWrite Hi-Lo, data.
* Reply: no payload, normal Completion response.
* Difference: extended handle bytes are ignored.
*/
struct INPUT {
uint8 header[7]; /* Requestheader */
uint8 filler; /* 0 Filler ?? */
@@ -6531,8 +6543,15 @@ static int handle_ncp_serv(void)
break;
case 0x4a : { /* File SERVER COPY */
/* should be OK */
case 0x4a : { /* 74 Copy from One File to Another / wire 0x4a.
* Coverage: implemented.
* Request: reserved byte, old source/destination
* FileHandle slots, source/destination offsets Hi-Lo,
* CopySize Hi-Lo.
* Reply: four-byte actual transfer count.
* Difference: extended handle bytes are ignored for both
* source and destination handles.
*/
struct INPUT {
uint8 header[7]; /* Requestheader */
uint8 reserved; /* Reserved by Novell */
@@ -6564,7 +6583,13 @@ static int handle_ncp_serv(void)
break;
case 0x4b : { /* set date of file, file will be closed later */
case 0x4b : { /* 75 Set File Time Date Stamp / wire 0x4b.
* Coverage: implemented.
* Request: reserved byte, old six-byte FileHandle slot,
* DOS Time, DOS Date.
* Reply: no payload, normal Completion response.
* Difference: extended handle bytes are ignored.
*/
struct INPUT {
uint8 header[7]; /* Requestheader */
uint8 filler;
@@ -6579,7 +6604,14 @@ static int handle_ncp_serv(void)
}
break;
case 0x4c : { /* open file */
case 0x4c : { /* 76 Open File / wire 0x4c.
* Coverage: implemented.
* Request: DirHandle, SearchAttributes,
* DesiredAccessRights, PathLen, Path.
* Reply: six-byte old FileHandle slot, Reserved,
* NW_FILE_INFO. Current code writes zero extended
* handle bytes and a local four-byte handle.
*/
struct INPUT {
uint8 header[7]; /* Requestheader */
uint8 dirhandle; /* Dirhandle */