WDF EvtIoDeviceControl 缓冲区长度
在 WDF 驱动程序中处理 DeviceIoControl 请求时,获取输入/输出缓冲区大小的正确方法是什么。
它似乎都是作为参数传递的:
VOID
EvtIoDeviceControl(IN WDFQUEUE Queue, IN WDFREQUEST Request,
IN size_t OutputBufferLength,
IN size_t InputBufferLength,
IN ULONG IoControlCode)
但也可以通过 WdfRequestRetrieveInputBuffer
获得,这是访问请求缓冲区所必需的。
因此,我想知道 InputBufferLength
参数与 WdfRequestRetrieveInputBuffer
设置的值(Length
参数)之间是否存在差异。
When handling DeviceIoControl requests in a WDF driver what is the correct way to get the size of the input/output buffer.
It seems to be both passed as a parameter:
VOID
EvtIoDeviceControl(IN WDFQUEUE Queue, IN WDFREQUEST Request,
IN size_t OutputBufferLength,
IN size_t InputBufferLength,
IN ULONG IoControlCode)
But also available through WdfRequestRetrieveInputBuffer
which is required in order to gain access to the request buffer.
I am therefore wondering if there is a difference between the InputBufferLength
parameter and the value set by WdfRequestRetrieveInputBuffer
(the Length
parameter).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这两者之间没有区别。设计界面的人认为在两个地方都有参数会很方便。我自己从来没有发现过这种情况,但如果你发现了,它就在那里。
杰克·奥辛斯
There is no difference between those two. The guy who designed the interface thought it would be convenient to have the parameter in both places. I've never found that to be the case, myself, but it's there in case you do.
Jake Oshins