2018-02-23 18:58:03 +00:00
|
|
|
|
---
|
|
|
|
|
created_at: '2015-06-26T10:31:56.000Z'
|
|
|
|
|
title: Why doesn't Windows recognize a USB device plugged into another port? (2004)
|
|
|
|
|
url: http://blogs.msdn.com/b/oldnewthing/archive/2004/11/10/255047.aspx
|
|
|
|
|
author: johnchristopher
|
|
|
|
|
points: 131
|
|
|
|
|
story_text:
|
|
|
|
|
comment_text:
|
|
|
|
|
num_comments: 152
|
|
|
|
|
story_id:
|
|
|
|
|
story_title:
|
|
|
|
|
story_url:
|
|
|
|
|
parent_id:
|
|
|
|
|
created_at_i: 1435314716
|
|
|
|
|
_tags:
|
|
|
|
|
- story
|
|
|
|
|
- author_johnchristopher
|
|
|
|
|
- story_9783382
|
|
|
|
|
objectID: '9783382'
|
2018-06-08 12:05:27 +00:00
|
|
|
|
year: 2004
|
2018-02-23 18:58:03 +00:00
|
|
|
|
|
|
|
|
|
---
|
2018-03-03 09:35:28 +00:00
|
|
|
|
You may have noticed that if you take a USB device and plug it into your
|
|
|
|
|
computer, Windows recognizes it and configures it. Then if you unplug it
|
|
|
|
|
and replug it into a different USB port, Windows gets a bout of amnesia
|
|
|
|
|
and thinks that it's a completely different device instead of using the
|
|
|
|
|
settings that applied when you plugged it in last time. Why is that?
|
2018-02-23 18:19:40 +00:00
|
|
|
|
|
2018-03-03 09:35:28 +00:00
|
|
|
|
The USB device people explained that this happens when the device lacks
|
|
|
|
|
a USB serial number.
|
2018-02-23 18:19:40 +00:00
|
|
|
|
|
2018-03-03 09:35:28 +00:00
|
|
|
|
Serial numbers are optional on USB devices. If the device has one, then
|
|
|
|
|
Windows recognizes the device no matter which USB port you plug it into.
|
|
|
|
|
But if it doesn't have a serial number, then Windows treats each
|
|
|
|
|
appearance on a different USB port as if it were a new device.
|
2018-02-23 18:19:40 +00:00
|
|
|
|
|
2018-03-03 09:35:28 +00:00
|
|
|
|
(I remember that one major manufacturer of USB devices didn't quite
|
|
|
|
|
understand how serial numbers worked. They gave all of their devices
|
|
|
|
|
serial numbers, that's great, but they all got the **same** serial
|
|
|
|
|
number. Exciting things happened if you plugged two of their devices
|
|
|
|
|
into a computer at the same time.)
|
|
|
|
|
|
|
|
|
|
But why does Windows treat it as a different device if it lacks a serial
|
|
|
|
|
number and shows up on a different port? Why can't it just say, "Oh,
|
|
|
|
|
there you are, over there on another port."
|
|
|
|
|
|
|
|
|
|
Because that creates random behavior once you plug in **two** such
|
|
|
|
|
devices. Depending on the order in which the devices get enumerated by
|
|
|
|
|
Plug and Play, the two sets of settings would get assigned seemingly
|
|
|
|
|
randomly at each boot. Today the settings match up one way, but tomorrow
|
|
|
|
|
when the devices are enumerated in the other order, the settings are
|
|
|
|
|
swapped. (You get similarly baffling behavior if you plug in the devices
|
|
|
|
|
in different order.)
|
|
|
|
|
|
|
|
|
|
In other words: Things suck because (1) things were already in bad
|
|
|
|
|
shape—this would not have been a problem if the device had a proper
|
|
|
|
|
serial number—and (2) once you're in this bad state, the alternative
|
|
|
|
|
sucks more. The USB stack is just trying to make the best of a bad
|
|
|
|
|
situation without making it any worse.
|