Eror message on a client computer that is running Windows Vista or Windows Server 2008: “ERROR_NOT_LOCKED (158)”
Consider the following scenario in a network environment:
- You set up a file share on a server that is running Windows Vista or Windows Server 2008.
- You have a client computer (client 1) that is running Windows Vista or Windows Server 2008.
- You also have another client computer (client 2) that is running a Windows operating system that is earlier than Windows Vista. For example, you have a client computer that is running Windows XP or Windows Server 2003.
- You run two applications on client 1. At the same time, you run one application on client 2. All the three applications perform file I/O operations to the file share. For example, these applications may lock part of a file on the file share, edit and then unlock the file.
In this scenario, one of the applications on client 1 fails, and all the other applications stop working.
To monitor the file I/O activity of the three applications, you can use Process Monitor. When you experience this issue, you will find that an error that resembles the following is logged for the affected application:
Process Monitor also indicates that the error occurs in the UnlockFile function.
For more information on this issue, including potential causes, workarounds, and resolutions, see: Microsoft KB Article KB979521.