3.2.4.17 Application Requests the Release of a Byte-Range Lock on a File
The application provides:
The Client.Open representing the file to be unlocked.
An array of byte ranges to be unlocked. For each range, the application provides:
A starting offset, in bytes.
A length, in bytes.
The number of byte ranges to be unlocked.
The type of lock requested.
The new oplock level, if this is a request from the server in response to a change.
The length of time (in milliseconds) for the server to wait for the locks to become available.
Any of the following commands can be used to explicitly unlock a contiguous range of bytes in a regular file:
SMB_COM_UNLOCK_BYTE_RANGE (section 2.2.4.14) (deprecated)
This command is used to explicitly unlock a contiguous range of bytes in an open regular file. The byte range specified MUST be exactly the same as that specified in a previous successful lock request from the same CIFS client and process; the FID, PID, and UID MUST be the same as those used in the lock request. The client MUST construct the SMB_COM_UNLOCK_BYTE_RANGE Request (section 2.2.4.14.1), as defined in section 2.2.4.14.1.
SMB_COM_WRITE_AND_UNLOCK (section 2.2.4.21) (deprecated)
This command is used to write to a locked byte range in the file, and then unlock the range. The application MAY provide an indication of the number of additional bytes immediately following the bytes written and unlocked that it designates to write. The client MUST construct the SMB_COM_WRITE_AND_UNLOCK Request (section 2.2.4.21.1) as defined in section 2.2.4.21.1.
Multiple non-overlapping byte ranges can be unlocked with this command. The client MUST construct the SMB_COM_LOCKING_ANDX Request (section 2.2.4.32.1). The client request is atomic. Failure to unlock or lock a byte range specified results in all ranges in the request being left in their previous state. This command is capable of using 64-bit file offsets. If CAP_LARGE_FILES is set in Client.Connection.ServerCapabilities, 64-bit offsets SHOULD be used.
Closing the file releases all locks associated with the FID. The SMB_COM_PROCESS_EXIT (section 2.2.4.18) command closes all file handles (FIDs) that were opened by the specified PID, and therefore releases all locks held on those FIDs.
The request MUST be sent to the server as described in section 3.2.4.1.