RE: METHOD_DIRECT - Please help! (fwd)

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

 

Date: Tue, 14 May 2002 23:00:05 +0000

From: Johnny D

>Reply-To: NT Developers Interest List
>To: NT Developers Interest List
>Subject: [ntdev] RE: METHOD_DIRECT - Please help!
>
>
>
>Peter, Thanks for responding. The main reason I am using this is because in
>Walter Oney’s book, I read that if you are xferring >1 pg worth of data, one
>shouldnt use METHOD_BUFFERED. I believe that is for performance reasons, but
>are there any other reasons as to why this might be a problem?
>
>If one is using METHOD_OUT_DIRECT is Irp->AssociatedIrp.SystemBuffer supposed
>to be pointing to valid data from which I can read stuff into?.
>
>Regards
>
>-Johnny
>
>
>
> >From: “Peter Wieland”
> >Reply-To: “NT Developers Interest List”
> >To: “NT Developers Interest List”
> >Subject: [ntdev] RE: METHOD_DIRECT - Please help!
> >Date: Tue, 14 May 2002 15:16:58 -0700
> >
> >using METHOD_*_DIRECT for your ioctls opens your driver up to all sorts
> >of attacks from user-mode (malicious applications can modify data values
> >in the buffer after you’ve validated them. Poorly written apps could
> >reuse the pages for something else very easily). If it’s not
> >performance critical then it’s probably not worth the work needed to
> >secure it properly.
> >
> >no clue on the second point unless the caller to DeviceIoControl handed
> >in bad parameters. But it sounds like you’re ruling that out.
> >
> >-p
> >
> >-----Original Message-----
> >From: Johnny D [mailto:xxxxx@hotmail.com]
> >Sent: Tuesday, May 14, 2002 2:54 PM
> >To: NT Developers Interest List
> >Subject: [ntdev] METHOD_DIRECT - Please help!
> >
> >
> >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
> >
> >
>
> _____________________________________________________________________________________
>MSN Photos is the easiest way to share and print your photos: Click Here
>—
>You are currently subscribed to ntdev as: xxxxx@inktomi.com
>To unsubscribe send a blank email to %%email.unsub%%
>


Send and receive Hotmail on your mobile device: Click Here