220.127.116.11.7 Granting OpLocks
If the message received is an open or create and includes a request for an OpLock, the following additional steps MUST be taken:
If the Server.Connection.OpLockSupport state variable is FALSE, then an OpLock MUST NOT be granted.
If the open or create is on a directory file, then an Oplock MUST NOT be granted.
If the file is not open by any other process and Server.Connection.OpLockSupport is TRUE, then the requested OpLock type MUST be granted.
If the file is open for read-only access by one or more other processes, and:
The open or create command specifies read-only access to the file;
The open or create command supports Level II OpLocks;
Server.Connection.OpLockSupport is true;
Then a Level II OpLock MUST be granted.
Otherwise, an OpLock MUST NOT be granted.
The server MUST also request that the underlying file system notify the server when the granted OpLock is broken. See [FSBO] section 2.3, Breaking OpLocks. For more information, see [MS-FSA], Server Acknowledges an OpLock Break.