Registering a Device Interface Class

There are three ways to register a device interface class:

A WDM driver does not name its device objects. Instead, when the driver calls IoCreateDevice to create a device object, it should specify a null string for the device name. For more information, see Creating a Device Object.

After creating the device object and attaching it to the device stack, one driver calls IoRegisterDeviceInterface to register a device interface class and to create an instance of the interface. Typically, the function driver makes this call from its AddDevice routine, but sometimes the filter driver registers the interface.

The routine returns a symbolic link name. A driver passes the link name when it enables or disables the device interface instance. Other system components cannot use a device interface instance until the driver has enabled it. See Enabling and Disabling a Device Interface Instance for details.

The driver also uses the symbolic link name to access the registry key, in which it can store information that is specific to the device interface. (See IoOpenDeviceInterfaceRegistryKey for more information.) Applications use the link name to open the device.

A driver can call IoRegisterDeviceInterface as many times as necessary to register instances of additional device interface classes.