The Kernel Network Mini-Redirector Driver

A kernel network mini-redirector driver implements a number of callback routines that are used by the Redirected Drive Buffering Subsystem (RDBSS) to communicate with the driver. In the remainder of this document, a kernel network mini-redirector driver will be referred to as a network mini-redirector driver.

When a network mini-redirector driver first starts (in its DriverEntry routine), the driver calls the RDBSS RxRegisterMinirdr routine to register the network mini-redirector driver with RDBSS. The network mini-redirector driver passes in a MINIRDR_DISPATCH structure, which includes configuration data along with pointers to the routines that the network mini-redirector driver implements (a dispatch table).

A network mini-redirector can choose to implement only some of these routines. Any routine that is not implemented by the network mini-redirector should be set to a NULL pointer in the MINIRDR_DISPATCH structure passed to RxRegisterMinirdr. RDBSS will only call routines implemented by the network mini-redirector.

One special category of routines implemented by a network mini-redirector are the low I/O operations that represent the traditional file I/O calls for read, write, and other file operations. All of the low I/O routines can be called asynchronously by RDBSS. A kernel driver for a network mini-redirector must make certain that any low I/O routines that are implemented can be safely called asynchronously. The low I/O routines are passed in as an array of routine pointers as part of the MINIRDR_DISPATCH structure from the DriverEntry routine. The value of the array entry is the low I/O operation to perform. All of the low I/O routines expect a pointer to an RX_CONTEXT structure to be passed in as a parameter. The RX_CONTEXT data structure has a LowIoContext.Operation member that also 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 driver since this LowIoContext.Operation member can be used to specify the low I/O operation requested. For example, all of the low 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 specify the lock or unlock operation requested.

RDBSS also assumes asynchronous operation for a few other routines implemented by a network mini-redirector. These routines are used for establishing a connection with a remote resource. Since connection operations can take a considerable amount of time to complete, RDBSS assumes these routines are implemented as asynchronous operations.

RDBSS assumes that all routines implemented by a network mini-redirector other than the low I/O and connection-related routines are based on synchronous calls. However, this is subject to change in future releases of the Windows operating system.

All of the routines implemented by a network mini-redirector return an NTSTATUS value on completion. Most routines return STATUS_SUCCESS on success or an appropriate NTSTATUS value. In addition to return values specific to a particular routine, there are two generic categories of errors that can be returned for most routines :

  • Network errors

  • Authentication errors

Possible network errors include the following:

STATUS_IO_TIMEOUT
The I/O request to the remote server has timed out.

STATUS_BAD_NETWORK_PATH
The I/O request was to a network path that does not exist. This error can occur if a directory was renamed or deleted.

STATUS_NETWORK_UNREACHABLE
The network is unreachable from the client.

STATUS_REMOTE_NOT_LISTENING
The remote server is not listening for connections.

STATUS_USER_SESSION_DELETED
The user session on the server has been deleted. The session may have timed out, the server may have been restarted causing all existing user sessions to be deleted, or an administrator on the server may have forced a delete of the user session .

STATUS_CONNECTION_DISCONNECTED
The connection to the remote server was disconnected.

STATUS_NETWORK_NAME_DELETED
The I/O request is for a network name that has been deleted.

Possible authentication errors include the following:

STATUS_LOGON_FAILURE
The login request to the remote server failed.

STATUS_NETWORK_CREDENTIAL_CONFLICT
There was a conflict with the network credentials that were presented.

STATUS_DOWNGRADE_DETECTED
A change of the network protocol used by the client to communicate with the server was detected by the server and the change was to an older version of the protocol.

STATUS_LOGIN_WKSTA_RESTRICTION
There is a restriction on workstation logins to the server.

The following sections discuss in detail the routines that can be implemented by a network mini-redirector:

Routines Implemented by the Kernel Network Mini-Redirector

Routines Not Used by RDBSS

The routines implemented by a network mini-redirector can be organized into the following categories based on their function:

Connection and Name Resolution

Driver Start, Stop, and Device Control

File System Object Creation and Deletion

File System Object I/O Routines

File System Object Query and Set Routines

Miscellaneous Network Mini-Redirector Routines