RxFinalizeConnection deletes a connection to a share. Any files open on the connection are closed depending on the level of force specified. The network mini-redirector might choose to keep the transport connection open for performance reasons, unless some option is specified to force a close of connection.
NTSTATUS RxFinalizeConnection( _Inout_ PNET_ROOT NetRoot, _Inout_opt_ PV_NET_ROOT VNetRoot, _In_ LOGICAL Level );
- NetRoot [in, out]
A pointer to the NET_ROOT structure being finalized.
- VNetRoot [in, out, optional]
A pointer to the V_NET_ROOT structure being finalized.
- Level [in]
The flag that controls the behavior of the RxFinalizeConnection routine. The flag can be one of the following values:
RxFinalizeConnection succeeds no matter what even if orphan files and IRP_MN_NOTIFY_CHANGE_DIRECTORY requests are open. The option forces these orphan files closed.
RxFinalizeConnection fails if files or change notifications are open.
RxFinalizeConnection removes the extra reference on the V_NET_ROOT structure due to the add connection request, but otherwise act like FALSE. RxFinalizeConnection fails if files or change notifications are open.
RxFinalizeConnection returns STATUS_SUCCESS on success or one of the following error codes on failure:
The Flags member of the RX_CONTEXT structure indicates the IRP was canceled.
The connection is still in use.
The file was open, so the remote connection should not be deleted.
An exclusive lock on the associated
RxFinalizeConnection is normally called by a network mini-redirector driver in response to receiving a custom IOCTL request from user mode. For example, a user might execute from the command line a "NET USE x: /d" to delete a share. This request would be mapped through the network provider DLL provided by the network mini-redirector to a custom IOCTL request sent to the network mini-redirector kernel driver which would call the RxFinalizeConnection routine to delete the connection.
RxFinalizeConnection cancels all the outstanding requests for a given V_NET_ROOT structure. These V_NET_ROOT structures are created and deleted independent of the files that are opened and manipulated on them. Therefore it is imperative that when a delete operation is attempted, all the outstanding requests are canceled.
- The NET_ROOT Structure
- The V_NET_ROOT Structure