Sample USB Driver in Different Ports

Dear All,

I am analyzing the user mode sample USB driver given in the WDK samples. After building the driver, I copied necessary files as mentioned in the Readme file to some location in the test system.

I just modified the following two parameters in the INF file:

  1. Vendor ID
  2. Product ID

I replaced the original values with the values of my test device. After installing the driver using Hardware Configuration wizard, I observed some strange behaviour.

My test system has six USB ports. 2 infront and 4 at the backside of the system.

When I attach the device in any of the two front side USB ports, Windows is recognizing the device and is showing in the Device Manager.

But if I attach the device in any of the four back side USB ports, Windows does not recognize the device and Hardware Configuration wizard is again launching.

Can anyone provide the pointer about the correct way of handling the USB user mode driver.

Regards.

xxxxx@gmail.com wrote:

I am analyzing the user mode sample USB driver given in the WDK samples. After building the driver, I copied necessary files as mentioned in the Readme file to some location in the test system.

I just modified the following two parameters in the INF file:

  1. Vendor ID
  2. Product ID

I replaced the original values with the values of my test device. After installing the driver using Hardware Configuration wizard, I observed some strange behaviour.

My test system has six USB ports. 2 infront and 4 at the backside of the system.

When I attach the device in any of the two front side USB ports, Windows is recognizing the device and is showing in the Device Manager.

But if I attach the device in any of the four back side USB ports, Windows does not recognize the device and Hardware Configuration wizard is again launching.

Can anyone provide the pointer about the correct way of handling the USB user mode driver.

This is the correct way. If your driver is unsigned, then every time it
is plugged into a port for the first time, the Add Hardware Wizard will
come up. After you’ve plugged it into every port once, you should stop
seeing this.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Dear Tim and All,

Thanks for the reply.

But for generic drivers like USB Keyboard, Mouse, Mass Storage and all other USB based product drivers, once the driver is installed, Windows is recognizing the device on any of the USB ports.

Regards.

Note, the responses said “if your driver is unsigned”, the drivers you
refer to are “signed” which eliminates almost all the popups.


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply

wrote in message news:xxxxx@ntdev…
> Dear Tim and All,
>
> Thanks for the reply.
>
> But for generic drivers like USB Keyboard, Mouse, Mass Storage and all
> other USB based product drivers, once the driver is installed, Windows is
> recognizing the device on any of the USB ports.
>
> Regards.
>

Uday Bhaskar wrote:

But for generic drivers like USB Keyboard, Mouse, Mass Storage
and all other USB based product drivers, once the driver is
installed, Windows is recognizing the device on any of the USB
ports.

Also note that if these devices have serial numbers, they will only install once, signed drivers or not.

Dear Burn, Chris, All

My driver is not a signed one. But I noticed that my test device does not contain any serial number and this point is clearly mentioned in page no 105 of USB complete second edition of Jan Axelson.

I will verify the same with the test device implementing serial number and update the status.

Thanks for all those suggestions.

Regards.

If the device has a unique ID in its config descriptor - then the OS will
not reinstall the drivers for it if it is attached to another USB port.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> Dear Tim and All,
>
> Thanks for the reply.
>
> But for generic drivers like USB Keyboard, Mouse, Mass Storage and all other
USB based product drivers, once the driver is installed, Windows is recognizing
the device on any of the USB ports.
>
> Regards.
>

Dear All,

After testing with the device implementing Serial Number, I found Windows not prompting for the driver for the same device on different ports.

But the sample USB driver is not getting displayed under USB Controllers section of the Device Manager. The driver is getting displayed at the same level as that of USB Controllers.

In order to debug the driver, I modified the Registry Key under HKLM-Software-Microsoft-Windows NT-CurrentVersion-WUDF-Services-{193…} key and set the value to 0x64.

The host process is waiting for the debugger to be attached and I am finding WUDFHost.exe in Attach process dialog of Visual Studio.

Once I select the WUDFHost.exe process, the control is going is going to some assembly language prgram of the process instead of getting at the break point.

The break point is at IDriverEntry() function of the Driver.cpp

Anyone who debugged sucessfully using Visual Studio 6.0, kindly suggest the required steps to follow inorder to debug UMDF.

Regards.