ms-help://MS.WDK.v10.7600.091201/DevInst_d/hh/DevInst_d/setup-cls_701b0efb-d581-4b55-84cc-a46816dddee4.xml.htm
-
Device interface classes are the means by which drivers make devices available to applications and other drivers.
-
(驱动接口类指驱动让应用程序或其他驱动对其可见)
-
-
This section contains the following topics:
-
-
Introduction to Device Interfaces
-
-
Registering a Device Interface Class
-
-
Enabling and Disabling a Device Interface Instance
-
-
Using a Device Interface
-
-
For information about the system-defined device interface classes, see System-Defined Device Interface Classes.
-
Introduction to Device Interfaces
-
Any driver of a physical, logical, or virtual device to which user-mode code can direct I/O requests must supply some sort of name for its user-mode clients. Using the name, a user-mode application (or other system component) identifies the device from which it is requesting I/O.
-
-
In Windows NT 4.0 and earlier versions of the NT-based operating system, drivers named their device objects and then set up symbolic links in the registry between these names and a user-visible Win32 logical name.
-
(在NT4.0以前的版本,驱动命名自己的设备对象并建立符号链接在设备名和用户可见的Win32逻辑名。)
-
-
Starting with Windows 2000, drivers do not name device objects. Instead, they make use of device interface classes. A device interface class is a way of exporting device and driver functionality to other system components, including other drivers, as well as user-mode applications. A driver can register a device interface class, then enable an instance of the class for each device object to which user-mode I/O requests might be sent.
-
(Windows2000以后,驱动不需要命名设备对象。取而代之的是使用设备接口类。)
-
-
Each device interface class is associated with a GUID. The system defines GUIDs for common device interface classes in device-specific header files. Vendors can create additional device interface classes.
-
-
For example, three different types of mouse devices could be members of the same device interface class, even if one connects through a USB port, a second through a serial port, and the third through an infrared port. Each driver registers its device as a member of the interface class GUID_DEVINTERFACE_MOUSE. This GUID is defined in the header file Ntddmou.h.
-
-
Typically, drivers register for only one interface class. However, drivers for devices that have specialized functionality beyond that defined for their standard interface class might also register for an additional class. For example, a driver for a disk that can be mounted should register for both its disk interface class (GUID_DEVINTERFACE_DISK) and the mountable device class (MOUNTDEV_MOUNTED_DEVICE_GUID).
-
-
When a driver registers an instance of a device interface class, the I/O manager associates the device and the device interface class GUID with a symbolic link name. The link name is stored in the registry and persists across system starts. An application that uses the interface can query for instances of the interface and receive a symbolic link name representing a device that supports the interface. The application can then use the symbolic link name as a target for I/O requests.
-
-
Do not confuse device interfaces with the interfaces that drivers can export in response to an IRP_MN_QUERY_INTERFACE request. That IRP is used to pass routine entry points between kernel-mode drivers.
-
(IRP_MN_QUERY_INTERFACE 这个IRP请求是内核模式驱动使用的)
阅读(657) | 评论(0) | 转发(0) |