Driver Start, Stop, and Device Control

Driver registration is handled in the DriverEntry routine of a network mini-redirector driver. When a network mini-redirector first starts (in its DriverEntry routine), the driver must call the RDBSS RxRegisterMinirdr routine to register the network mini-redirector with RDBSS. The network mini-redirector passes in a MINIRDR_DISPATCH structure which includes configuration data and a table of routine pointers (a dispatch table) to the routines that the network mini-redirector driver implements.

The MRxStart and MRxStop routines must be implemented by the network mini-redirector driver to allow the driver to be started and stopped.

The sequence to start or stop the network mini-redirector is complex. This sequence is normally initiated by a user-mode application or service supplied with network mini-redirector driver to control the driver for administration and management purposes. The network mini-redirector can use a service that is configured to start automatically when the operating system starts. This service can request that the network mini-redirector be started whenever the operating system starts.

MRxStart is called by RDBSS when the RxStartMinirdr routine is called. The RxStartMinirdr routine is usually called as a result of an FSCTL or IOCTL request from a user-mode application or service to start the network mini-redirector. The call to RxStartMinirdr cannot be made from the DriverEntry routine of the network mini-redirector after a successful call to RxRegisterMinirdrbecause some of the start processing requires that the driver initialization be completed. Once the RxStartMinirdr call is received, RDBSS completes the start process by calling the MRxStart routine of the network mini-redirector. If the call to MRxStart returns success, RDBSS sets the internal state of the mini-redirector in RDBSS to RDBSS_STARTED.

MRxStop is called by RDBSS when the RxStopMinirdr routine is called. The RDBSS RxStopMinirdr routine is usually called as a result of an FSCTL or IOCTL request from a user-mode application or service to stop the network mini-redirector. This call can also be made from the network mini-redirector or, as part of shutdown process, by the operating system. Once the RxStopMinirdr call is received, RDBSS completes the process by calling the MRxStop routine of the network mini-redirector.

The MRxDevFcbXXXControlFile routine is used to receive requests from a user-mode application or service to control the network mini-redirector by making IOCTL or FSCTL calls on a device FCB.

In addition, there are two low I/O routines that handle IOCTL and FSCTL operations on the driver object: MRxLowIOSubmit[LOWIO_OP_FSCTL] and MRxLowIOSubmit[LOWIO_OP_IOCTL].

A network mini-redirector can also use these low I/O routines to provide control and management of the network mini-redirector from a user-mode application or service.

The following table lists the routines that can be implemented by a network mini-redirector for start, stop, and device control operations.

Routine Description
MRxDevFcbXXXControlFile

RDBSS calls this routine to pass a device FCB control request to the network mini-redirector. RDBSS issues this call in response to receiving an IRP_MJ_DEVICE_CONTROL, IRP_MJ_FILE_SYSTEM_CONTROL, or IRP_MJ_INTERNAL_DEVICE_CONTROL on a device FCB.

MRxStart

RDBSS calls this routine to start the network mini-redirector.

MRxStop

RDBSS calls this routine to stop the network mini-redirector.