diff --git a/src/nwconn.c b/src/nwconn.c index 61b0553..8883e34 100644 --- a/src/nwconn.c +++ b/src/nwconn.c @@ -1983,15 +1983,39 @@ static int handle_ncp_serv(void) return(-1); /* nwbind must do a little rest */ break; - case 0x1a : /* Log Physical Record */ - case 0x1e : /* Clear Physical Record */ + case 0x1a : /* Log Physical Record */ + case 0x1c : /* Release Physical Record */ + case 0x1e : /* Clear Physical Record */ { + /* + * SDK: NCP 0x2222/26 Log Physical Record records one + * byte range in the caller's logged data block table. + * Lock Flag 0 logs for future locking, 1 locks + * exclusive, and 3 locks shareable/read-only. + * + * SDK: NCP 0x2222/28 Release Physical Record releases + * one locked byte range but leaves it in the logged + * table so a later Lock Physical Record Set can relock + * it. The request carries a reserved byte, a 6-byte + * NetWare file handle, Start Offset, and Record Length; + * it returns no reply data and reports Unlock Error + * through the completion code. + * + * SDK: NCP 0x2222/30 Clear Physical Record releases the + * range if it is locked and removes it from the logged + * table. + * + * MARS-NWE currently routes both release and clear through + * the existing physical-record unlock path; the low-level + * physical-record table is still shared with the existing + * nw_log_physical_record() implementation. + */ struct INPUT { uint8 header[7]; /* Requestheader */ - uint8 lock_flag; /* 0=log, 1=excl */ - /* 3=shared */ - uint8 ext_fhandle[2]; /* all zero */ - uint8 fhandle[4]; /* Filehandle */ + uint8 lock_flag; /* 0=log/reserved, 1=excl */ + /* 3=shared */ + uint8 ext_fhandle[2]; /* all zero / high handle */ + uint8 fhandle[4]; /* Filehandle */ uint8 offset[4]; uint8 size[4]; uint8 timeout[2]; @@ -2000,7 +2024,7 @@ static int handle_ncp_serv(void) uint32 offset= GET_BE32(input->offset); uint32 size = GET_BE32(input->size); uint16 timeout = GET_BE16(input->timeout); - if (function == 0x1a) /* lockfile */ + if (function == 0x1a) /* log or lock */ completition = (uint8)(-nw_log_physical_record( fhandle, offset, @@ -2013,7 +2037,9 @@ static int handle_ncp_serv(void) offset, size, timeout, - -2 /* unlock + unlog */ + (function == 0x1c) + ? -1 /* unlock only */ + : -2 /* unlock + unlog */ )); } break;