Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTDEV

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


Restart an IRP

user1234user1234 Member Posts: 4

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?

Comments

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,563

    ...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, [email protected]
    Providenza & Boekelheide, Inc.

  • user1234user1234 Member Posts: 4

    @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.

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,563

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

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • user1234user1234 Member Posts: 4

    @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)".

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,563

    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, [email protected]
    Providenza & Boekelheide, Inc.

  • user1234user1234 Member Posts: 4

    @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.

  • Doron_HolanDoron_Holan Member - All Emails Posts: 10,756
    edited May 18
    How can you definitively detect that it is the same device in a different port without the serial number?
    d
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Internals & Software Drivers 19-23 June 2023 Live, Online
Writing WDF Drivers 10-14 July 2023 Live, Online
Kernel Debugging 16-20 October 2023 Live, Online
Developing Minifilters 13-17 November 2023 Live, Online