阅读:1671回复:9
会WDM的请帮我我想请问irp包的那个参数是指向输入缓冲和输出缓冲的 就是DeviceIoControl的 (LPVOID) lpInBuffer, // input buffer (LPVOID) lpOutBuffer, // output buffer 分别对应irq中的那些指针,我在驱动中如何访问他们?? |
|
|
沙发#
发布于:2001-06-28 19:06
irp->AssociatedIrp.SystemBuffer是一个公用的缓冲区
|
|
板凳#
发布于:2001-06-29 10:32
那Irp->MdlAddress是做什么的呢? |
|
|
地板#
发布于:2001-07-02 16:49
该站上的电子书《Progamming Window Driver Model》就说的非常的清楚。
|
|
地下室#
发布于:2001-07-02 18:18
Irp->MdlAddress好象是DMA驱动程序用的。
|
|
|
5楼#
发布于:2001-07-02 20:12
vcmfc说的对,就去DOWN本PROGRAMMING WDM(本站有),看看,什么都搞定了。不是什么问题都要问出来才好。你在自己找到答案的同时,会学到不少东西,至少又样成了你自己动手,不畏困难的精神,对一个开发人员,只有好处。
当然,实在搞不定,拿上来大家解决解决也很明智。 |
|
|
6楼#
发布于:2001-07-02 23:29
兄弟,还是看看书吧,一两句话也将不清!
|
|
7楼#
发布于:2001-12-19 22:19
Let me try to show u what i knew:
when u are using DeviceIoControl(), there are two buffers in user mode: lpInBuffer and lpOutBuffer; inside driver, there are three ways to access these buffers: METHOD_BUFFER, METHOD_DIRECT, METHOD_NEITHER when use METHOD_BUFFER access, the system will create another buffer inside the system, then copy the data from lpInBuffer to this system buffer, then pass this system buffer to driver, driver access this system buffer through irp->AssociatedIrp.SystemBuffer;( you need to copy the input data locally if you need to use them later;) if there is output data to pass back to user mode, driver use the same system buffer to store the ouput data, when DeviceIoControl() returns, the system will copy all the data insie the system buffer to user mode lpOutBuffer. from here you can see, system create antother buffer for both user mode and driver to share data. (two copy operations happen for one DeviceIoControl() ) when use METHOD_DIRECT, the system will lock user mode buffer lpOutBuffer and pack it as a MDL and pass it to driver, driver can use this MDL to access the user mode memory directly. (no copy operations required) when use METHOD_NEITHER, the system just simply pass the lpOutBuffer pointer to driver, and driver have to take care all the address convertions. hope this help :) |
|
8楼#
发布于:2001-12-24 08:08
是AssociatedIrp.SystermBuffer还是MdlAddress存放数据,完全是你自己决定的,你的fdo的flag field将决定这个。你可以参考一下msdn里面的DEVICE OBJECT的flag域的解释,相信你会明白的。 楼上的朋友说的很好 :) [编辑 - 12/24/01 作者: KungFu] |
|
|
9楼#
发布于:2001-12-24 09:17
非常感谢各位大虾的解释,让我茅塞顿开。
尤其是hong,以前我没有仔细的考虑过这些,只是用而已。 |
|