Kernel-Mode Driver Framework (KMDF) provides object-based interfaces for drivers. Framework-defined object interfaces consist of:
-
Object methods
-
Methods are functions that a driver can call to perform an operation on the object or to get or set an object property. Methods are named
WdfObjectAction, where Object describes the object and Action indicates what the function does. For example, WdfDeviceCreate creates a device object.
Object event callback functions
-
Event callback functions are functions that a driver provides. Each event callback function is associated with a specific event that can occur on an object. The framework calls the event callback function when the associated event occurs. By convention, the placeholders for event callback functions are called EvtObjectEvent, although you can name these callbacks anything you choose in your driver. For example, a driver registers the
EvtDeviceD0Entryevent callback to be notified when its device enters the working state.
Object properties
-
Properties are values that are stored within an object and that a driver can
get (that is, obtain) and set (that is, change). In many cases, properties map directly to the fields in the corresponding WDM objects. Properties that cannot fail are named WdfObjectGetValue and WdfObjectSetValue, and properties that can fail are namedWdfObjectRetrieveValue and WdfObjectAssignValue. Object describes the object, and Value identifies the data that the function sets or returns. For example, WdfDeviceGetDriver returns a handle to the driver object that is associated with the device object.
Object handles
-
A framework-based driver never directly accesses framework objects. Instead, the driver receives object handles, which it can pass to an object's methods.
The framework defines several object types that framework-based drivers use:
-
A
framework driver object represents each driver. -
A
framework device object represents each device that a driver supports. -
Framework queue objects
represent I/O queues that receive a device's I/O requests. -
Framework request objects
represent I/O requests that each I/O queue receives.