缓冲,DeviceIOControl问题?不够加分!!!!

ycjia2002 2003-05-25 02:34:45
要从端口读图像数据,能有256k左右。
想在sys中用
READ_PORT_BUFFER_ULONG( (PULONG)wPortEPP,
(PULONG)pBuffer,
ulongSize );
那么缓冲区怎么实现好呢?
在app中开辟缓冲,用deviceiocontrol传递给驱动程序,这样行么?
还是在驱动里开辟再传回给应用程序?共享内存是怎么回事?





...全文
21 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
qinxiaogang 2003-06-13
  • 打赏
  • 举报
回复
当然在app里开缓冲区,传递驱动里,由驱动填充它.
火焰射手 2003-06-13
  • 打赏
  • 举报
回复
app开辟传给驱动,驱动使用direct io,因为你的数据已经占了很多页面
jinghuiren 2003-06-13
  • 打赏
  • 举报
回复
其实就是三楼那位老兄回复里的direct io方式,因为你的数据比较多,如果用buffer io方式的话会比较慢的。
michaelwan 2003-06-10
  • 打赏
  • 举报
回复
Yes
woodhead99 2003-05-26
  • 打赏
  • 举报
回复
You have to care about the ioctl code passed to DeviceIoControl. If the buffer method is direct io, your app provides the buffer pointer for output buffer, and the driver will use the buffer you passed to accumulate data from your port.
It the buffer method is buffered io, the driver will deposit the data in one internal buffer( io manager allocated ), and then copy the content to the buffer you specified in output buffer.
check the key words buffered io and direct io for detail info in msdn or Walter Oney's wdm book

DellXu 2003-05-26
  • 打赏
  • 举报
回复
学习,帮你顶!

21,597

社区成员

发帖
与我相关
我的任务
社区描述
硬件/嵌入开发 驱动开发/核心开发
社区管理员
  • 驱动开发/核心开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧