diff --git a/TODO.md b/TODO.md index cb075c5..92ca9ba 100644 --- a/TODO.md +++ b/TODO.md @@ -65,8 +65,6 @@ Follow-up: - Implement or deliberately reject the following endpoints after client evidence or direct protocol tests: - - `NCP 0x04 Lock File Set`: lock the current task's logged file set; related - release/clear set calls already use `share_handle_lock_sets()`. - `NCP 0x16/0x18 Restore Directory Handle`: verify the exact SDK request/reply layout, then implement the documented function 22 / subfunction 24 directory-handle semantics. diff --git a/src/nwconn.c b/src/nwconn.c index a54ce2f..61b0553 100644 --- a/src/nwconn.c +++ b/src/nwconn.c @@ -439,23 +439,34 @@ static int handle_ncp_serv(void) } break; -#if 0 - case 0x4 : { /* Lock File Set */ + case 0x4 : /* Lock File Set (old) */ + case 0x6a : { /* Lock File Set */ /* - * TODO(ncp-compat): Implement NCP 0x04 Lock File Set. + * NCP 0x2222/04 Lock File Set (old) and NCP 0x2222/106 Lock + * File Set lock all files logged by the calling client's current + * task. * - * SDK context: locks every file previously entered in this task's - * file log table by Log File (0x03). This is the set-oriented - * companion of Release File Set (0x06) and Clear File Set (0x08), - * which are already wired through share_handle_lock_sets(). + * SDK request: 2-byte Lock Timeout, in units of 1/18 second; + * 0 means No Wait. + * SDK reply: no reply data. + * SDK completion: 0x00 success, 0xfe timeout, 0xff lock error. * - * Compatibility note: preserve NetWare's logged-set semantics; this - * is not the same as locking one pathname supplied by the request. + * The newer 0x6a call replaces the old 0x04 call but has the same + * request layout for the file set lock itself. MARS-NWE records + * file-set members through Log File (0x03), then uses the shared + * set handler for Lock/Release/Clear File Set operations. */ - + struct INPUT { + uint8 header[7]; /* Requestheader */ + uint8 timeout[2]; /* HI LO */ + } *input = (struct INPUT *) (ncprequest); + int result = share_handle_lock_sets( + 1, /* File Set */ + 0, /* Lock logged entries */ + GET_BE16(input->timeout)); + if (result) completition = (uint8) -result; } break; -#endif case 0x5 : /* Release File */ case 0x7 : { /* Clear File, removes file from logset */