MRxLowIOSubmit[LOWIO_OP_SHAREDLOCK] routine

The MRxLowIOSubmit[LOWIO_OP_SHAREDLOCK] routine is called by RDBSS to request that a network redirector open a shared lock on a file object.

Syntax

PMRX_CALLDOWN MRxLowIOSubmit[LOWIO_OP_SHAREDLOCK];

NTSTATUS MRxLowIOSubmit[LOWIO_OP_SHAREDLOCK](
  _Inout_ PRX_CONTEXT RxContext
)
{ ... }

Parameters

RxContext [in, out]
A pointer to the RX_CONTEXT structure. This parameter contains the IRP that is requesting the operation.

Return value

MRxLowIOSubmit[LOWIO_OP_SHAREDLOCK] returns STATUS_SUCCESS on success or an appropriate NTSTATUS value, such as one of the following:

Return code Description
STATUS_CONNECTION_DISCONNECTED

The connection was disconnected.

STATUS_INSUFFICIENT_RESOURCES

There were insufficient resources to complete the request.

STATUS_INVALID_BUFFER_SIZE

The requested buffer size was too large.

STATUS_INVALID_NETWORK_RESPONSE

An invalid response was received from the remote server.

STATUS_INVALID_PARAMETER

An invalid parameter was specified in RxContext.

STATUS_LINK_FAILED

The attempt to reconnect to a remote server to complete the request failed.

STATUS_NOT_IMPLEMENTED

This routine is not implemented.

STATUS_SHARING_VIOLATION

A sharing violation occurred.

STATUS_UNSUCCESSFUL

The call was unsuccessful.

Remarks

RDBSS calls MRxLowIOSubmit[LOWIO_OP_SHAREDLOCK] in response to receiving an IRP_MJ_LOCK_CONTROL request with a minor code of IRP_MN_LOCK if IrpSp->Flags does not have the SL_EXCLUSIVE_LOCK bit set.

Before calling MRxLowIOSubmit[LOWIO_OP_SHAREDLOCK], RDBSS modifies the following members in the RX_CONTEXT structure pointed to by the RxContext parameter:

The LowIoContext.Operation member is set to LOWIO_OP_SHAREDLOCK.

The LowIoContext.ResourceThreadId member is set to the thread of the process that initiated the operation in RDBSS.

The LowIoContext.ParamsFor.Locks.ByteOffset member is set to the value of IrpSp->Parameters.LockControl.ByteOffset.QuadPart.

The LowIoContext.ParamsFor.Locks.Key member is set to the value of IrpSp->Parameters.LockControl.Key.

The LowIoContext.ParamsFor.Locks.Flags member is set to the value of IrpSp->Flags.

The LowIoContext.ParamsFor.Locks.Length member is set to the value of IrpSp->Parameters.LockControl.Length.QuadPart.

The LowIoContext.Operation member of the RX_CONTEXT structure specifies the low I/O operation to perform. It is possible for several of the low I/O routines to point to the same routine in a network mini-redirector because the LowIoContext.Operation member can be used to differentiate the low I/O operation that is requested. For example, all the I/O calls related to file locks could call the same low I/O routine in the network mini-redirector and this routine could use the LowIoContext.Operation member to differentiate between the lock and unlock operation that is requested.

If the MRxLowIOSubmit[LOWIO_OP_SHAREDLOCK] routine can take a long time to complete, the network mini-redirector driver should release the FCB structure before initiating the network communication. The FCB structure can be released by calling RxReleaseFcbResourceForThreadInMRx. While the MRxLowIOSubmit[LOWIO_OP_SHAREDLOCK] routine is processing, the LowIoContext.ResourceThreadId member of RX_CONTEXT is guaranteed to indicate the thread of the process that initiated the operation in RDBSS.

The LowIoContext.ResourceThreadId member of the RX_CONTEXT structure can be used to release the FCB structure on behalf of another thread. When an asynchronous routine completes, the FCB structure that was acquired from the initial thread can be released.

Requirements

Target platform

Desktop

Header

Mrx.h (include Mrx.h)

See also

MRxLowIOSubmit[LOWIO_OP_EXCLUSIVELOCK]

MRxLowIOSubmit[LOWIO_OP_FSCTL]

MRxLowIOSubmit[LOWIO_OP_IOCTL]

MRxLowIOSubmit[LOWIO_OP_NOTIFY_CHANGE_DIRECTORY]

MRxLowIOSubmit[LOWIO_OP_READ]

MRxLowIOSubmit[LOWIO_OP_UNLOCK]

MRxLowIOSubmit[LOWIO_OP_UNLOCK_MULTIPLE]

MRxLowIOSubmit[LOWIO_OP_WRITE]

RxReleaseFcbResourceForThreadInMRx