Troubles with the FX2_driver examples

Hi Everyone,

I'm fairly new to Windows driver writing, but I'm trying to write a UMDF driver for XP. The device I use is an USB Remote (USB receiver CM21E), which sends the signals as USB interrupts. I'm trying to work with the FX2_Driver (Step 1 to 5 and Final) from the umdf examples of the WDK.

I used the .inx file from Peter Wieland's blog (Pointless Blathering | Microsoft Learn).
To make this working for my device I altered the "%OsrUsbDeviceName%" to
[Microsoft.NT$ARCH$]
%OsrUsbDeviceName%=OsrUsb_Install, USB\Vid_0bc7&Pid_0005

The compiling of the drivers goes great (thnx to advice from Peter Wieland and Ilias Tsigkogiannis). The Step 1 to 3 work also great (For what their supposed to do). But when I’m trying to use Step 4 as driver, I get the error:
This Device won't start (Code 10).

What can be the problem?

Some basic explanation to the different steps.

Step1 This is the most basic step. The source file contains absolutely minimal amount of code to get the driver loaded in memory and respond to PNP and Power events. You can install, uninstall, disable, enable, suspend and resume the system and everything will work fine.

Step2 Device registers a Pnp device interface so that application can open an handle to the device.
Device object implements IPnpCallbackHardware interface and initializes USB I/O targets in IPnpCallbackHardware::OnPrepareHardware method.

Step3 Creates a sequential queue for handling IOCTL requests.
Adds code to handle the IOCTL to set bar graph display.

Step4 Creates a parallel queue for handling read and write requests.
Retrieves memory from read and write requests, format the requests and sends it to USB target.

Step5 This step demonstrates eventing by adding support for driver and application to receive switch state change notifications. Driver achieves this by continuously having a pending read to the interrupt pipe.

Final This steps adds the following functionality to complete the driver:
Supports additional IOCTLs to get & set the 7-segment display, get bar graph display and to get config descriptor.
Sets power policy for the device.
Adds code to indicate that the device is ready by lighting up the period on seven- segment display.

"Feel free" - 5 GB Mailbox, 50 FreeSMS/Monat ...
Jetzt GMX ProMail testen: www.gmx.net/de/go/mailfooter/promail-out

Have you tried debugging the driver? That's probably the best way to
find out what's going wrong.

Step through your OnDeviceAdd routine and your OnPrepareHardware routine
and make sure everything succeeds.

Otherwise you have to rely on the psychic powers of the list members,
and they're not as good as we'd like.

-p

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Hans Breukhoven
Sent: Sunday, February 25, 2007 2:53 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Troubles with the FX2_driver examples

Hi Everyone,

I'm fairly new to Windows driver writing, but I'm trying to write a UMDF
driver for XP. The device I use is an USB Remote (USB receiver CM21E),
which sends the signals as USB interrupts. I'm trying to work with the
FX2_Driver (Step 1 to 5 and Final) from the umdf examples of the WDK.

I used the .inx file from Peter Wieland's blog
(http://blogs.msdn.com/peterwie/archive/2007/01/10/fixing-the-umdf-usb-s
amples-to-install-both-on-xp-vista.aspx).
To make this working for my device I altered the "%OsrUsbDeviceName%" to
[Microsoft.NT$ARCH$]
%OsrUsbDeviceName%=OsrUsb_Install, USB\Vid_0bc7&Pid_0005

The compiling of the drivers goes great (thnx to advice from Peter
Wieland and Ilias Tsigkogiannis). The Step 1 to 3 work also great (For
what their supposed to do). But when I'm trying to use Step 4 as driver,
I get the error:
This Device won't start (Code 10).

What can be the problem?

Some basic explanation to the different steps.

Step1 This is the most basic step. The source file contains absolutely
minimal amount of code to get the driver loaded in memory and respond to
PNP and Power events. You can install, uninstall, disable, enable,
suspend and resume the system and everything will work fine.

Step2 Device registers a Pnp device interface so that application can
open an handle to the device.
Device object implements IPnpCallbackHardware interface and initializes
USB I/O targets in IPnpCallbackHardware::OnPrepareHardware method.

Step3 Creates a sequential queue for handling IOCTL requests.
Adds code to handle the IOCTL to set bar graph display.

Step4 Creates a parallel queue for handling read and write requests.
Retrieves memory from read and write requests, format the requests and
sends it to USB target.

Step5 This step demonstrates eventing by adding support for driver and
application to receive switch state change notifications. Driver
achieves this by continuously having a pending read to the interrupt
pipe.

Final This steps adds the following functionality to complete the
driver:
Supports additional IOCTLs to get & set the 7-segment display, get bar
graph display and to get config descriptor.
Sets power policy for the device.
Adds code to indicate that the device is ready by lighting up the period
on seven- segment display.

"Feel free" - 5 GB Mailbox, 50 FreeSMS/Monat ...
Jetzt GMX ProMail testen: www.gmx.net/de/go/mailfooter/promail-out


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at