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:
-
Is the way that I tried ProbeForRead … the right one ???
-
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.
First why in the world is your driver using METHOD_NEITHER this is a bad
idea and there is a lot of code that needs to be done to check all the
corner cases. Take a good look at your driver and see why it is doing
this, and if you can eliminate METHOD_NEITHER from your driver. If not
assume you are going to have a maintenance headache that will cost your
firm lots of money.
Second ProbeForXXX is not the correct way to handle this, you should
create a MDL and lock down the buffers. In all cases the IRP should
have the length of the buffer so you know what to do.
Don Burn (MVP, Windows DKD)
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
“xxxxx@siemens.com” wrote in
message news:xxxxx@ntdev:
> 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.