![]() ![]() Typically the driver fills in some of the elements of the MajorFunction array and leaves the remaining elements set to default values provided by the I/O manager. In this case, the driver must fill in the MajorFunction element of the array with a pointer to the dispatch function. For example, suppose the driver implements a dispatch function to handle IRPs that have the major function code IRP_MJ_WRITE. The constants that identify major function code serve as indices in the MajorFunction array. Typically the driver fills in several members of the MajorFunction array with pointers to functions (implemented by the driver) that handle various kinds of IRPs.Īn IRP can be categorized according to its major function code, which is identified by a constant, such as IRP_MJ_READ, IRP_MJ_WRITE, or IRP_MJ_PNP. ![]() The MajorFunction member of the DRIVER_OBJECT structure is an array of pointers to functions that handle I/O request packets ( IRPs), as shown in the following diagram. For example, the DriverEntry function fills in the Unload member of the DRIVER_OBJECT structure with a pointer to the driver's Unload function, as shown in the following diagram. ![]() The DriverEntry function fills in certain members of a DRIVER_OBJECT structure with pointers to several other functions that the driver implements. Before you read this topic, you should understand the ideas presented in Device nodes and device stacks and I/O request packets.Įvery kernel-mode driver must implement a function named DriverEntry, which gets called shortly after the driver is loaded. Microsoft provides the general driver, and typically an independent hardware vendor provides the specific driver. The drivers that handle device-specific tasks go by a variety of names, including miniport driver, miniclass driver, and minidriver. In a driver pair, one driver handles general tasks that are common to a whole collection of devices, while the other driver handles tasks that are specific to an individual device. Driver pairs like (miniport, port) can make driver development easier. A minidriver or a miniport driver acts as half of a driver pair. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |