Export (0) Print
Expand All

IRP_MJ_CREATE

Windows Server 2003

This only applies when an existing stream of a file is being opened.

Current OpLock

Broken on IRP_MJ_CREATE when:

Level 1 (exclusive)

  • If the stream is opened with a desired access other than:

    • FILE_READ_ATTRIBUTES
    • FILE_WRITE_ATTRIBUTES
    • SYNCHRONIZE
  • The FileObject we are doing the open on is different than the FileObject which owns the oplock.
  • If we decide to break:

    • We break to NONE if:

      • The FILE_RESERVE_OPFILTER flag is set
      • Any of the following create disposition values were specified:

        • FILE_SUPERSEDE
        • FILE_OVERWRITE
        • FILE_OVERWRITE_IF
    • Else we Break to LEVEL 2
  • An ACK must be received before the operation continues

Level 2 (shared)

  • If the stream is opened with a desired access other than:

    • FILE_READ_ATTRIBUTES
    • FILE_WRITE_ATTRIBUTES
    • SYNCHRONIZE
  • If we decide to break:

    • We break to NONE if any of the following disposition values were specified:

      • FILE_SUPERSEDE
      • FILE_OVERWRITE
      • FILE_OVERWRITE_IF
    • Else we Break to LEVEL 2
  • If break to NONE is chosen then all outstanding level 2 oplocks are broken. The system does not wait for an ACK, and the operation proceeds.
  • If break to LEVEL 2 is chosen then no oplocks are broken, no ACK is required, and the operation proceeds.

Batch (exclusive)

  • If the stream is opened with a desired access other than:

    • FILE_READ_ATTRIBUTES
    • FILE_WRITE_ATTRIBUTES
    • SYNCHRONIZE
  • The FileObject we are doing the open on is different than the FileObject which owns the oplock.
  • If we decide to break:

    • We break to NONE if:

      • The FILE_RESERVE_OPFILTER flag is set
      • Any of the following create disposition values were specified:

        • FILE_SUPERSEDE
        • FILE_OVERWRITE
        • FILE_OVERWRITE_IF
    • Else we break to LEVEL 2
  • An ACK must be received before the operation continues

Filter (exclusive)

  • If the stream is opened with a desired access other than:

    • FILE_READ_ATTRIBUTES
    • FILE_WRITE_ATTRIBUTES
    • SYNCHRONIZE
  • A “writable” desired access was requested or the stream is not opened for FILE_SHARE_READ access. “Writeable” access is defined as any attribute other than:

    • FILE_READ_ATTRIBUTES
    • FILE_WRITE_ATTRIBUTES
    • FILE_READ_DATA
    • FILE_READ_EA
    • FILE_EXECUTE
    • SYNCHRONIZE
    • READ_CONTROL
  • The FileObject we are doing the open on is different than the FileObject which owns the oplock.
  • If we decide to break we always break to NONE
  • An ACK must be received before the operation continues

There are additional checks made for BATCH and FILTER oplocks when processing an IRP_MJ_CREATE operation. This is the case where operations on one data stream can impact the oplocks on other data streams of the same file. If a decision to break is made it follows the same rules as listed above:

  • Break if this is a transacted network query open

    • Otherwise do not break on network query open
  • If doing a SUPERSEDE, OVERWRITE or OVERWRITE_IF operation on an alternate data stream and FILE_SHARE_DELETE is not specified and there is a BATCH or FILTER oplock on the primary data stream. Break the BATCH or FILTER oplock on the primary data stream using the above rules.
  • If doing a SUPERSEDE, OVERWRITE or OVERWRITE_IF operation on the primary data stream and DELETE access has been requested and there are BATCH or FILTER oplocks on any alternate data stream. Break the BATCH or FILTER oplocks on all alternate data streams that have them.

The check to break BATCH and FILTER oplocks occurs before the share access checks are made. This means the BATCH or FILTER oplock will be broken even if the open request fails due to a sharing violation.

Show:
© 2014 Microsoft