chapter 5.3: KMDF对象模型实现
2013-03-04 20:39
513 查看
KMDF相对于UMDF定义了更多object
KMDF object还支持如下类型:
KMDF不支持命名的属性,而使用registry key object
driver给object method传递handle作为参数
KMDF给event callback传递handle作为参数
KMDF对象类型
*Framework object只受framework管理,而不是Windows object manager和ObXxx方法
*Framework object之手创建它的driver管理,不能在不同的framework driver中共享
KMDF命名规则
method:WDF[Ojbect][Operation]
[Object]: method操作的KMDF object
[Operation]: method做什么
例子:WdfDeviceCreate
Property: Wdf[Object]{Set|Get}[Data] Wdf[Object]{Set|Get}[Data]
[Object]:函数操作的KMDF object
[Data]:field
例子:VOID WdfInterruptGetInfo
KMDF event callback function: Evt[Object][Description]
[Object]: 函数操作的object
[Description]: 什么触发了callback
大多数sample driver会把Evt替换为driver名称,比如Osrusbfx2 driver的callback函数前缀为OsrFxEvt
例子:若device能被eject,则注册一个EvtDeviceEject callback,在PnP向设备发送IRP_MN_EJECT请求时会调用。
*KMDF event与windows提供的kernel-dispatcher event(同步机制)无关
*driver无法创建,操控或等待一个KMDF event,因为KMDF event只是一个函数。可以使用timer object
KMDF object还支持如下类型:
Collection | String |
DPC | Timer |
Interrupt | WMI |
Lookaside list | Work item |
Registry key | |
Several objects for DMA: DMA enabler, DMA transaction, and common buffer | Several objects for hardware resources: resource range list, resource list, and resource requirements list |
driver给object method传递handle作为参数
KMDF给event callback传递handle作为参数
KMDF对象类型
Object | Type | Description |
---|---|---|
Child list | WDFCHILDLIST | Represents a list of the child devices that the bus driver enumerates for a parent device. |
Collection | WDFCOLLECTION | Describes a list of similar objects, such as resources or the devices for which a filter driver filters requests. |
Device | WDFDEVICE | Represents an instance of a device. A driver typically has one WDFDEVICE object for each device that it controls. |
DMA common buffer | WDFCOMMONBUFFER | Represents a buffer that can be accessed by both the device and the driver to perform DMA. |
DMA enabler | WDFDMAENABLER | Enables DMA use by a device. A driver that handles device I/O operations has one WDFDMAENABLER object for each DMA channel within the device. |
DMA transaction | WDFDMATRANSACTION | Represents a single DMA transaction. |
DPC | WDFDPC | Represents a DPC. |
Driver | WDFDRIVER | Represents the driver itself and maintains information about the driver, such as its entry points. Every driver has one WDFDRIVER object. |
File | WDFFILEOBJECT | Represents a file object through which external drivers or applications can access the device. |
Generic object | WDFOBJECT | Represents a generic object for the driver to use as required. |
I/O queue | WDFQUEUE | Represents an I/O queue. A driver can have any number of WDFQUEUE objects. |
I/O request | WDFREQUEST | Represents a request for device I/O. |
I/O target | WDFIOTARGET | Represents a device stack to which the driver is forwarding an I/O request. A driver can have any number of WDFIOTARGET objects. |
Interrupt | WDFINTERRUPT | Represents a device's interrupt object. Any driver that handles device interrupts has one WDFINTERRUPT object for each IRQ or message-signaled interrupt (MSI) that the device can trigger. |
Lookaside list | WDFLOOKASIDE | Represents a dynamically sized list of identical buffers that are allocated from either paged or nonpaged pool. |
Memory | WDFMEMORY | Represents memory that the driver uses, typically an input or output buffer that is associated with an I/O request. |
Registry key | WDFKEY | Represents a registry key. |
Resource list | WDFCMRESLIST | Represents the list of resources that have actually been assigned to the device. |
Resource range list | WDFIORESLIST | Represents a possible configuration for a device. |
Resource requirements list | WDFIORESREQLIST | Represents a set of I/O resource lists, which comprises all possible configurations for the device. Each element of the list is a WDFIORESLIST object. |
String | WDFSTRING | Represents a counted Unicode string. |
Synchronization: spin lock | WDFSPINLOCK | Represents a spin lock, which synchronizes access to data DISPATCH_LEVEL. |
Synchronization: wait lock | WDFWAITLOCK | Represents a wait lock, which synchronizes access to data at PASSIVE_LEVEL. |
Timer | WDFTIMER | Represents a timer that fires either once or periodically and causes a callback routine to run. |
USB device | WDFUSBDEVICE | Represents a USB device. |
USB interface | WDFUSBINTERFACE | Represents an interface on a USB device. |
USB pipe | WDFUSBPIPE | Represents a configured pipe in a USB interface's setting. |
WMI instance | WDFWMIINSTANCE | Represents an individual WMI data block that is associated with a particular provider. |
WMI provider | WDFWMIPROVIDER | Represents the schema for WMI data blocks that the driver provides. |
Work item | WDFWORKITEM | Represents a work item, which runs in a system thread at PASSIVE_LEVEL. |
*Framework object之手创建它的driver管理,不能在不同的framework driver中共享
KMDF命名规则
method:WDF[Ojbect][Operation]
[Object]: method操作的KMDF object
[Operation]: method做什么
例子:WdfDeviceCreate
Property: Wdf[Object]{Set|Get}[Data] Wdf[Object]{Set|Get}[Data]
[Object]:函数操作的KMDF object
[Data]:field
例子:VOID WdfInterruptGetInfo
KMDF event callback function: Evt[Object][Description]
[Object]: 函数操作的object
[Description]: 什么触发了callback
大多数sample driver会把Evt替换为driver名称,比如Osrusbfx2 driver的callback函数前缀为OsrFxEvt
例子:若device能被eject,则注册一个EvtDeviceEject callback,在PnP向设备发送IRP_MN_EJECT请求时会调用。
*KMDF event与windows提供的kernel-dispatcher event(同步机制)无关
*driver无法创建,操控或等待一个KMDF event,因为KMDF event只是一个函数。可以使用timer object
相关文章推荐
- chapter 5.2: UMDF对象模型的实现
- 深入理解C++对象模型-成员函数的本质以及虚函数的实现(非虚继承)
- 组件对象模型与ATL实现
- C++对象模型之RTTI的实现原理
- 浅谈权限管理的对象模型和实现(转载)
- Sharepoint学习笔记—ECMAScript对象模型系列-- 2、实现编写代码时的智能提示功能
- 两个c++编译器对c++对象模型和虚函数调用方式的实现
- 甘露模型,用prototype更好地去实现对象继承
- 浅谈权限管理的对象模型和实现
- 浅谈权限管理的对象模型和实现
- ios中 继承对象模型的归档实现
- unity 5.3 工业模型的细节展开功能实现
- 采用Lambda表达式快速实现实体模型对象转换到DTO
- chapter 3.3: WDF对象模型
- java中对于复杂对象排序的模型及其实现 [转]
- 面向对象整体GIS数据模型的设计与实现
- XZ_iOS之Runtime使用运行时实现字典转模型和关联对象
- C++ - 对象模型之 模板、异常、RTTI的实现
- Sharepoint学习笔记—ECMAScript对象模型--实现编写代码时的智能提示功能
- chapter 6.7: KMDF设备对象的创建和初始化