B.9.1 Registering the Components of a Subsystem-Parallel Stack

Every STREAMS driver and module in the subsystem-parallel stack must identify itself as belonging to that stack. This is done by specifying the same nonNULL third argument to StrmRegisterDriver and StrmRegisterModule.

Example: DriverEntry Routine for a Subsystem-Parallel tcpip.sys

#include <ntddk.h>
#include <stream.h>
 
#define    SUBSYSTEM_NAME        "tcpip_up"
 
extern int arpinit(void);
extern int tcpinit(void);
 
NTSTATUS
DriverEntry(
    IN PDRIVER_OBJECT driver,
    IN PUNICODE_STRING device
    )
{
    NTSTATUS status;
 
    status = StrmRegisterModule(driver, &arpinfo, SUBSYSTEM_NAME);
 
    if (status != STATUS_SUCCESS) {
        return(status);
    }
 
    status = StrmRegisterDriver(
                  driver, 
                  &tcpinfo, 
                  SUBSYSTEM_NAME, 
                  NULL
                  );
 
    if (status != STATUS_SUCCESS) {
        return(status);
    }
 
    arpinit();
    tcpinit();
 
    return(STATUS_SUCCESS);
}