惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 三生石上(FineUI控件)
Y
Y Combinator Blog
aimingoo的专栏
aimingoo的专栏
B
Blog
小众软件
小众软件
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
L
LangChain Blog
WordPress大学
WordPress大学
罗磊的独立博客
GbyAI
GbyAI
S
SegmentFault 最新的问题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
月光博客
月光博客
IT之家
IT之家
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
雷峰网
雷峰网
美团技术团队
F
Fortinet All Blogs
Hugging Face - Blog
Hugging Face - Blog
The GitHub Blog
The GitHub Blog

博客园 - bqrm_521(小奎)

.net连接eDirectory,需要安全连接的解决方案 ObDereferenceObjectDeferDelete routine ObDereferenceObject routine ObCloseHandle routine InitializeObjectAttributes 宏 Driver Support Routines(驱动程序开发支持例程) Standard Driver Routines(标准驱动程序) DriverEntry 文件系统过滤驱动的DriverEntry PHP扩展的加载流程 PHP扩展中定义一个类 PHP的HashTable(二) PHP的HashTable(一) PHP扩展中访问全局变量$_POST,$_GET,$_SERVER等 开发PHP扩展(一) 要搬家了,全部书籍10元转让 scribe2.2 ssh 使用技巧 安装scribe
AdapterControl routine
bqrm_521(小奎) · 2013-05-30 · via 博客园 - bqrm_521(小奎)


The AdapterControl routine starts a DMA data-transfer operation.
AdapterControl例程启动一个DMA数据传输操作。

语法:

DRIVER_CONTROL AdapterControl;

IO_ALLOCATION_ACTION AdapterControl(
_In_ struct _DEVICE_OBJECT *DeviceObject,
_Inout_ struct _IRP *Irp,
_In_ PVOID MapRegisterBase,
_In_ PVOID Context
)
{ ... }

参数:
DeviceObject [in]
Caller-supplied pointer to a DEVICE_OBJECT structure. This is the device object for the target device, previously created by the driver's AddDevice routine.
这是由调用者提供的一个指向DEVICE_OBJECT结构体的指针,是由驱动的AddDevice例程创建的目标设备的设备对象。
Irp [in, out]
Caller-supplied pointer to an IRP structure. Irp is equal to the value of the CurrentIrp member of DeviceObject when the AdapterControl routine was registered.
这是由调用者提供的一个指向IRP结构体的指针。当AdapterControl例程注册之后,Irp将等于DeviceObject的CurrentIrp成员。
MapRegisterBase [in]
Caller-supplied opaque value that represents the map registers that the system has assigned for this transfer operation. The driver passes this value to FlushAdapterBuffers, FreeMapRegisters, and MapTransfer.
由调用者提供的VOID指针,是系统分配给传输请求的寄存器。驱动会将此值传递到FlushAdapterBuffers,FreeMapRegisters和MapTransfer例程。
Context [in]
Caller-supplied pointer to driver-defined context information, specified in a previous call to AllocateAdapterChannel.
由调用者提供的驱动定义的上下文系统,详细说明在前一个调用AllocateAdapterChannel中。
返回值

The routine must return one of the values defined by the IO_ALLOCATION_ACTION enumeration.
Drivers of bus-master devices return either DeallocateObject or DeallocateObjectKeepRegisters; drivers that use system DMA return KeepObject.
例程必须返回一个由枚举IO_ALLOCATION_ACTION定义的值。总线主控设备的驱动程序返回 DeallocateObject 或者 DeallocateObjectKeepRegisters,使用系统DMA的驱动,返回KeepObject。

总线主控DMA : http://www.cnblogs.com/iwasmu/archive/2009/08/29/1556364.html
续:http://www.cnblogs.com/iwasmu/archive/2009/09/14/1566580.html

说明:
To register an AdapterControl routine for a specific device object, a driver must call IoGetDmaAdapter to obtain an adapter object,
then call AllocateAdapterChannel to request use of the adapter and to supply the AdapterControl routine's address.
为指定设备注册一个AdapterControl例程,驱动必须调用 IoGetDmaAdapter获取一个adapter对象。

When the adapter is free, the system calls the AdapterControl routine.
系统会在释放适配器对象 后调用 AdapterControl例程。

If AdapterControl has been registered by a StartIo routine,
then the Irp parameter is guaranteed to point to the IRP currently being processed by the StartIo routine.
如果AdapterControl是由StartIo例程注册的,则需要保证Irp参数是指向当前正由StartIo例程处理的IRP。
Otherwise, drivers must set the CurrentIrp member of the device object structure before calling AllocateAdapterChannel.
否则,驱动要在调用AllocateAdapterChannel例程之前,设置设备对象的CurrentIrp成员。
详细信息请见,如何编写AdapterControl例程(http://msdn.microsoft.com/en-us/library/windows/hardware/ff566397(v=vs.85).aspx)。

示例:

DRIVER_CONTROL MyAdapterControl;

IO_ALLOCATION_ACTION
MyAdapterControl(
_In_ struct _DEVICE_OBJECT *DeviceObject,
_Inout_ struct _IRP *Irp,
_In_ PVOID MapRegisterBase,
_In_ PVOID Context
)
{
// Function body
}