Re: DevPathExer & troubles with Type3InputBuffer

The size should be present in
IrpSp->Parameters.DeviceIoControl.InputBufferLength, and yes you need
to probe the buffer inside an exception handler.

Mark Roddy

On Wed, Mar 9, 2011 at 2:58 PM, wrote:
> Hi,
>
> I have to bring a driver thru the DTM tests to get a WHQL certificate.
>
> I am not the developer of that driver and I also do not have a lot of experience with driver development, but I have to do it anyway.
>
> When performing the DevPathExer test a (PAGE_FAULT_IN_NONPAGED_AREA (50)) BSDO comes, when the first byte of the buffer
>
> ? ? ? ?irpStack->Parameters.DeviceIoControl.Type3InputBuffer;
>
> is read.
>
> Here the simplified code:
>
> ? ? ?CHAR *pointer = irpStack->Parameters.DeviceIoControl.Type3InputBuffer;
> ? ? ?CHAR Command = pointer[0];
>
> Usually this code works proper. But during the DevPathExer test the line ? ? ? CHAR Command = pointer[0]; produces the meantioned BSDO.
>
>
> Now I read, in the MSDN that the Type3InputBuffer is used for a so called data exhange mode NEITHER. I also read that the other both methods to exchange data are BUFFERED and DIRECT IO. But my driver seams to use the methode NEITHER.
>
> Is it the right way to use ProbeForRead & ProbeForWrite together with try / except to checke whether the memory / buffer can be used ???
>
>
> I added such code (ProbeForRead & ProbeForWrite together with try / except ) to the driver and now the local DevPathExer test succeeded. But I don’t know whether the driver would work correct in normal mode / usage. Since I don’t ?know a lot about the driver I have to ask tomorrow some colleagues from the testing department, whether the drive still is working correct.
>
> I hope so.
>
> ==========================================
>
>
>
> Here all the points & questions, which I still have:
>
> 1. Is the way that I tried ProbeForRead … ?the right one ???
>
> 2. ProbeForRead needs to know the size of the memory to check. In the most cases of the code I knew the size. But there is also code in which I do not know the correct size. –> So is in the structure ?irpStack->Parameters.DeviceIoControl.Type3InputBuffer
> also some where a member which stores the size of the buffer irpStack->Parameters.DeviceIoControl.Type3InputBuffer ???
>
>
>
>
> Thanks in advance for good and helpful answers.
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>