this requires even more tiptoeing around than METHOD_DIRECT to ensure
you don’t create a security hole. with method direct you know you’ve
got a data buffer to use. With METHOD_NEITHER you only get a pointer to
a data buffer. That pointer could be a kernel-mode address, a user-mode
address, NULL, an invalid address, etc…
-p
-----Original Message-----
From: Peter Scott [mailto:xxxxx@KernelDrivers.com]
Sent: Wednesday, May 15, 2002 12:40 PM
To: NT Developers Interest List
Subject: [ntdev] Re: METHOD_DIRECT - Please help!
If you are processing these buffers in the kernel in the same context
that you receive them in, then use METHOD_NEITHER. Using this, you get
the addresses directly. You can then lock them and pass them to a worker
thread, if needed.
Pete
Peter Scott
xxxxx@KernelDrivers.com
http://www.KernelDrivers.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Johnny D
Sent: Wednesday, May 15, 2002 1:15 PM
To: NT Developers Interest List
Subject: [ntdev] Re: METHOD_DIRECT - Please help!
Gary, thanks for the information. I am seeing this problem even with
METHOD_BUFFERED … And this is after making sure that some junk input
is *not* being passed into DeviceIoControl. I am re-posting my recent
mail for quick reference
Maybe I should qualify my question some more. What I noticed is that
Irp->AssociatedIrp.SystemBuffer was NULL when i tried to pass in > 1pg
worth of data into the kernel even with METHOD_BUFFERED. Not sure as to
why that is the case, so if someone has some idea on that, please let me
know. It does not fail every time. I make the IOCTL call every second,
with the same input parameter, and it usually fails in the 2nd call. 1st
one goes thru fine.
Specifically, if I am going to passing in AND out more than 1 page worth
of data between the app and the driver, what method should I be using?.
Do let me know of the caveats, if any, as well, like Peter did.
Thanks
-Johnny
From: “Gary G. Little”
Reply-To: “NT Developers Interest List”
To: “NT Developers Interest List”
Subject: [ntdev] Re: METHOD_DIRECT - Please help!
Date: Wed, 15 May 2002 09:31:23 -0700
Jamey Hanrahan in a seminar I took describes it best —
METHOD_*_DIRECT redefines the use of the input/output buffers. Input
becomes a pointer to a control buffer, where as output becomes the data
buffer. On entry to your drivers Dispatch control method IRP->Associated
buffer points to the “control” buffer where as IRP->MdlAddress points
the MDL that has been created for the data buffer.
As to why “control” might be NULL, I would hazard a guess that the
Input pointer was null and or the size was 0.
–
Gary G. Little
xxxxx@broadstor.com
xxxxx@inland.net
“Johnny D” wrote in message news:xxxxx@ntdev…
In an IOCTL if I am copying more than 1 page worth of data from
user->kernel space and also the other way around… am I safe with using
METHOD_OUT_DIRECT?
I once saw that the Irp->AssociatedIrp.SystemBuffer was NULL when
inside my IOCTL handler… this is with > 1 page worth of data being
transferred in… Would someone know why that I am getting that?
Thanks
-Johnny
Join the world’s largest e-mail service with MSN Hotmail. Click Here
You are currently subscribed to ntdev as: xxxxx@hotmail.com
To unsubscribe send a blank email to %%email.unsub%%
MSN Photos is the easiest way to share and print your photos: Click Here
You are currently subscribed to ntdev as: xxxxx@KernelDrivers.com
To unsubscribe send a blank email to %%email.unsub%%
You are currently subscribed to ntdev as: xxxxx@microsoft.com
To unsubscribe send a blank email to %%email.unsub%%