Hi,
I get a TransferBuffer in a USB IRP (from a higher driver). I then copy the address of the TransferBuffer into an IOCTL from a user mode program. In the user mode program copying data into the buffer generates an access violation.
My question is, how do I map the buffer to user space before passing the pointer.
Thanks,
Kevin.
xxxxx@gmail.com wrote:
I get a TransferBuffer in a USB IRP (from a higher driver). I then copy the address of the TransferBuffer into an IOCTL from a user mode program. In the user mode program copying data into the buffer generates an access violation.
My question is, how do I map the buffer to user space before passing the pointer.
You don’t. You copy the DATA into the buffer that the user app
provided, not the pointer. Otherwise, the address lifetime management
will make your head explode. How would you ensure that the address
remains valid until the user-mode app is through with it?
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.
I want to eliminate the copy. I just want to copy the pointer to the data buffer of the user mode program, and have it write directly into the buffer.
I can do it with MDLs using MmMapLockedPagesSpecifyCache.
> I get a TransferBuffer in a USB IRP (from a higher driver).
So, you want to pass kernel mode pointers to the user apps?
Forget this, there are no ways of doing this reliably.
–
Maxim S. Shatskih
Windows DDK MVP
xxxxx@storagecraft.com
http://www.storagecraft.com