Restart an IRP

I have a device that does not have a serial number. As a result, whenever I connect the device to a new USB port, Windows identifies it as a new device and assigns it a generic friendly name such as ‘My Device’, ‘My Device #2’, ‘My Device #3’, and so on. This occurs before the IRP_MN_START_DEVICE event, and a registry subkey is created during this process.

To address this issue, I have written a dispatch routine for IRP_MN_START_DEVICE. In this routine, I delete the registry key when the device is connected to a different port from the previous one. To ensure that the correct registry subkey is created and that Windows can accurately detect the device, I need to restart the IRP process.

Can I do that or do you have a better idea?

…or do you have a better idea?

Yes. Give your devices a serial number, like you are supposed to. It’s not hard.

@Tim_Roberts said:
Yes. Give your devices a serial number, like you are supposed to. It’s not hard.

Thanks dear Tim_Roberts.

Could you please give a hint how and which data structure need to work with.

It’s in your device’s firmware. What USB chip are you using?

@Tim_Roberts said:
It’s in your device’s firmware. What USB chip are you using?

I have recently developed just an upper minifilter to manage all connected devices to the operating system, including the third-party device I mentioned earlier. I do not intend to modify the device.

The information extracted includes the PID and VID of the device, which identifies it as an “Ethernet (RNDIS and CDC ethernet)”.

If it’s not your device, then why do you care at all that the friendly name changes? It’s the vendor’s problem, not yours.

@Tim_Roberts said:
If it’s not your device, then why do you care at all that the friendly name changes? It’s the vendor’s problem, not yours.

I bind the device to an external virtual switch in hyper-v (which is based on friendly name). I don’t want to change the config on every usb connection.

How can you definitively detect that it is the same device in a different port without the serial number?