how to modify serial number of usb device by usb filter driver?

Discussion in 'Windows Vista Drivers' started by curliph, Jun 13, 2006.

  1. curliph

    curliph Guest

    hi, I want to modify the serial number or PID/VID of my usb mass stroage disk.
    I try it by an usb class filter driver to capture the
    URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE,then modify the data...
    But,It seems useless!
    how should I do? many thanks!
     
    curliph, Jun 13, 2006
    #1
    1. Advertisements

  2. what side affect do you want your change to have? that the usb core not use
    it for a unique ID or that usbstor uses your changed value ?

    d
     
    Doron Holan [MS], Jun 14, 2006
    #2
    1. Advertisements

  3. curliph

    curliph Guest

    Thanks for your answer!
    Infect, I have two usb device with the same pid/vid and serial number.
    them can not co-exist in windows...
    for certain reason,I have to fix the bug by modify somthing inside os..
    I think I should change the string of iSerialNumber before os load
    usbstor.sys.
    so,the changed value should be used by usb core or even lower drivers.
    right?
    but I don't know how to do that!
     
    curliph, Jun 14, 2006
    #3
  4. Add the filter which will just ignore the serial number by patching the
    DEVICE_CAPABILITIES and resetting UniqueId bit.

    --
    Maxim Shatskih, Windows DDK MVP
    StorageCraft Corporation

    http://www.storagecraft.com
     
    Maxim S. Shatskih, Jun 14, 2006
    #4
  5. that is too late. you need to filter the parent hub's query device
    relations. you need to filter the entire usb bus since you don't know which
    port you will be attached to. this is a very difficult task, you can't
    really work around your broken hw this way

    --
    Please do not send e-mail directly to this alias. this alias is for
    newsgroup purposes only.
    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Doron Holan [MS], Jun 15, 2006
    #5
  6. curliph

    curliph Guest

    You are right...I had just follow the advice by Maxim S. Shatskih.
    it still can't work :(

    I will try to filter the entire bus...any advice?
    or, Is there other way to make the two device work together?
     
    curliph, Jun 15, 2006
    #6
  7. curliph

    curliph Guest

    By the way, the two devices (with identical pid/vid and serial number) work
    well in Win XP, but not in Win 2k.
    what's the difference?
     
    curliph, Jun 15, 2006
    #7
  8. the XP usb core tracks serial numbers and does not use the serial number as
    a unique identifier on the bus

    d

    --
    Please do not send e-mail directly to this alias. this alias is for
    newsgroup purposes only.
    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Doron Holan [MS], Jun 15, 2006
    #8
  9. you are proposing to write a bus filter driver. quite difficult to do and
    completely undocumented and unsupported by microsoft.

    d

    --
    Please do not send e-mail directly to this alias. this alias is for
    newsgroup purposes only.
    This posting is provided "AS IS" with no warranties, and confers no rights.
     
    Doron Holan [MS], Jun 15, 2006
    #9
  10. curliph

    Pavel A. Guest

    Pavel A., Jun 15, 2006
    #10
  11. curliph

    Ray Trent Guest

    To be completely fair, it's a bug in the devices that have non-unique
    serial numbers. That's a violation of the USB spec. USB devices are very
    clearly required to either have unique serial numbers or no serial
    numbers at all.
     
    Ray Trent, Jun 15, 2006
    #11
  12. curliph

    Pavel A. Guest


    Yep. But, as saying goes - In specifications, Murphy's Law supersedes Ohm's,
    in this case it supersedes the USB spec :)

    --PA
     
    Pavel A., Jun 15, 2006
    #12
  13. curliph

    curliph Guest

    :) ...My device has a bug! it violate the spec.
    But how to give each device a unique ID?
    the id is stored inside eprom,so each device has a same initial id before
    assign an unique one by configuraton tool...the question is how to
    configure multiple devices at a time?

    a working method is,while enumerate devices,reset iSerialNumber field of
    device descriptor by firmware...so the UniqueId field return zero while
    query device capabilites.
    but,it's also violate the spec...right? :)
     
    curliph, Jun 16, 2006
    #13
  14. curliph

    curliph Guest

    thanks a lot...the utility is important to me!! :)
     
    curliph, Jun 16, 2006
    #14
  15. curliph

    Ray Trent Guest

    There are 2 typical techniques:

    1) Program the serial numbers uniquely in the first place when you burn
    the firmware into the EEPROM.

    2) Program the device with a null serial number descriptor (i.e. the
    device says it doesn't have a serial number, which is legal according to
    the spec) and then program the unique serial number over that later.
    This requires a certain amount of cleverness because it involves leaving
    enough space to overwrite the descriptor from that point onward, but it
    is a solution for people that can't manufacture them right in the first
    place.

    3) Actually, there's a third technique that people use, but that's
    already been mentioned: program them with non-unique serial numbers and
    then turn off serial number checking on your functional test machine and
    reprogram them. That way, the bug only exists inside your factory, and I
    doubt the USB-IF would object to that :).
     
    Ray Trent, Jun 16, 2006
    #15
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.