| Previous | Next |
| STATUS_BAD_INHERITANCE_ACL | STATUS_DISK_FULL |
STATUS_RANGE_NOT_LOCKED
The requested byte range has no matching lock to release
Windows byte-range locks are defined by starting offset, length, handle, and lock mode. Unlocking requires a range compatible with the lock previously acquired through that handle. A lock owned through another handle in the same process is not automatically interchangeable.
This result usually exposes bookkeeping drift in asynchronous or error paths. It should not be “fixed” by ignoring all unlock failures, because an unintended lock may remain held elsewhere.
What to inspect
- Log the 64-bit offset and length used for both LockFileEx and UnlockFileEx.
- Track locks per file handle, not only per path or process.
- Check cancellation and partial-failure paths for duplicate or mismatched unlock calls.
References
Looking for a different code? Search another status or error code.