KMDF driver behaves differently on Win7 vs. WinXP

Hello to everyone,

I am new to driver development and new to the forum, therefore please allow me a maybe stupid question.

I wrote a rather simple USB driver based on the WDF for Windows7 (V1.9) and on one of the sample driver files. I develop and test under WinXP and my driver behaves as expected.
If I now use the build environment for Windows7, build and install my driver, I encounter a different behavior with respect to the timing on the USB interface.

I know that it may be hard to judge without seeing the code but I was wondering if I make something wrong with respect to developing a driver for different OS versions. I do not have signed my driver for Windows7, if that might be the problem.

From what I understood I thought using the right build environment would do the job.

Any hint or help is much appreachiated.

Thanks and regards

Andreas

You need to be more specific. The w7 usb stack is quite different than the XP stack

d

debt from my phone


From: xxxxx@gmx.net
Sent: 9/14/2012 9:55 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] KMDF driver behaves differently on Win7 vs. WinXP

Hello to everyone,

I am new to driver development and new to the forum, therefore please allow me a maybe stupid question.

I wrote a rather simple USB driver based on the WDF for Windows7 (V1.9) and on one of the sample driver files. I develop and test under WinXP and my driver behaves as expected.
If I now use the build environment for Windows7, build and install my driver, I encounter a different behavior with respect to the timing on the USB interface.

I know that it may be hard to judge without seeing the code but I was wondering if I make something wrong with respect to developing a driver for different OS versions. I do not have signed my driver for Windows7, if that might be the problem.

From what I understood I thought using the right build environment would do the job.

Any hint or help is much appreachiated.

Thanks and regards

Andreas


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

OK, I will try to briefly describe what the driver is intended to do.

Actually it is a camera device driver, which is from the USB point of
view a simple device with one configuration and interface. It provides a
couple of endpoints to control the camera and to retrieve the camera
frame data. All endpoints operate in bulk mode.

The user operates the driver via deviceIOcontrol calls and provides a
buffer of the size of a complete frame. The driver itself receives the
frame request and chops it in chunks of 64k byte sub-requests which are
created with the initial request as the parent. All requests will be
send to the device in conjunction with a command to trigger the frame
reading. All request are send asynchronously, use the same user frame
buffer with an appropriate offset and register a callback routine.
Once all request have been completed and the whole camera frame is
captured, the initial user request is completed.

On WinXP the works quite well, once in a while the captured frame data
seems corrupted which might be caused by some latency.
On Win7 the same driver roughly always returns corrupt frame data. It
seems that the timing or behavior on USB is different.

Because timing seems to be critical the idea was to provide the device
with all frame chunk requests immediately, so that the device is able to
copy the frame data without any delay. Is there maybe another way to
achieve that?

Or as you said the USB stack is different. What do I have to consider,
when I write the driver for Win7?

Thanks a lot for your advice,

best regards

Andreas

Am 14.09.2012 19:27, schrieb Doron Holan:

You need to be more specific. The w7 usb stack is quite different than
the XP stack

d

debt from my phone

Just send the entire buffer, no need to chunk it up into 64 K pieces

d

debt from my phone


From: Andreas Kohn
Sent: 9/15/2012 9:32 AM
To: Windows System Software Devs Interest List
Cc: Doron Holan
Subject: Re: [ntdev] KMDF driver behaves differently on Win7 vs. WinXP

OK, I will try to briefly describe what the driver is intended to do.

Actually it is a camera device driver, which is from the USB point of
view a simple device with one configuration and interface. It provides a
couple of endpoints to control the camera and to retrieve the camera
frame data. All endpoints operate in bulk mode.

The user operates the driver via deviceIOcontrol calls and provides a
buffer of the size of a complete frame. The driver itself receives the
frame request and chops it in chunks of 64k byte sub-requests which are
created with the initial request as the parent. All requests will be
send to the device in conjunction with a command to trigger the frame
reading. All request are send asynchronously, use the same user frame
buffer with an appropriate offset and register a callback routine.
Once all request have been completed and the whole camera frame is
captured, the initial user request is completed.

On WinXP the works quite well, once in a while the captured frame data
seems corrupted which might be caused by some latency.
On Win7 the same driver roughly always returns corrupt frame data. It
seems that the timing or behavior on USB is different.

Because timing seems to be critical the idea was to provide the device
with all frame chunk requests immediately, so that the device is able to
copy the frame data without any delay. Is there maybe another way to
achieve that?

Or as you said the USB stack is different. What do I have to consider,
when I write the driver for Win7?

Thanks a lot for your advice,

best regards

Andreas

Am 14.09.2012 19:27, schrieb Doron Holan:

You need to be more specific. The w7 usb stack is quite different than
the XP stack

d

debt from my phone

Doron,

thanks for the hint. This and an optimization of the firmware fixed it.

regards, Andreas

Am 15.09.2012 19:11, schrieb Doron Holan:

Just send the entire buffer, no need to chunk it up into 64 K pieces

d

debt from my phone