Let?s keep this discussion on the mailing list, so others can benefit from the exchange.
On Feb 27, 2015, at 7:52 PM, Nelson Kon (Singapore) > wrote:
I did read the document. But it doesn’t mention how IWDFMemory is related to which DeviceIoControl parameter.
Sure it did. When you call GetInputMemory, you get a copy of the DeviceIoControl input buffer. When you call GetOutputMemory, you get a copy of the DeviceIoControl output buffer.
After I put my value to the USHORT buffer and to IWDFMemory in the driver, I thought I can retrieve it from
lpInBuffer
lpOutBuffer
lpBytesReturned
All 3 don’t contain my data which is put in the USHORT buffer in the driver.
Think about it If you are trying to send data back to the application, then you are sending OUTPUT. So, you need to call GetOutputMemory, and copy the data into it. You also need to call CompleteWithInformation to tell the I/O system how much data you are returning. The data you write will be copied to lpOutBuffer, and the size is returned in lpBytesReturned.
?
Tim Roberts, xxxxx@probo.commailto:xxxxx
Providenza & Boekelheide, Inc.</mailto:xxxxx>