Page 1 of 1

How to sense the UIRT?

PostPosted: Fri Nov 12, 2004 6:43 am
by Dean Roddey
Jon, I want to auto-sense that a UIRT is present so that I can auto-install my driver for it. I can find out your Vendor/Product ids easily enough, but what GUI id are you using in IoRegisterDeviceInterface so that I can enumerate devices of that interface and see if one of your guys is there?

PostPosted: Fri Nov 12, 2004 6:44 am
by Guest
BTW, I do check also for the presence of the DLL in the system path somewhere. But that doesn't mean that the device is actually present, since it could just be sitting around from ages ago or something. I want to make absolutely sure it's there, by making sure it's a present USB device.

PostPosted: Sat Nov 13, 2004 3:29 am
by jrhees
Dean,

The recommended method is using the API itself and actually calling Open() as normal. One of the possible error codes is that the device cannot be found.

So, you could simply

hHandle = UUIROpen()
if (hHandle == INVALID_HANDLE)
{
check error code
}
else
{
UUIRClose(hHandle);
}

-Jon

PostPosted: Sun Nov 14, 2004 6:14 pm
by Guest
The thing is, I'm going to need to do this for more and more devices over time and I just cannot afford to load up custom DLLs for all of them (and write the code specfiically for each one.) Checking for the presence of a device with particular vendor/product id is something that can be done generically by just using hints read out of the CQC driver manifest files.

PostPosted: Mon Nov 15, 2004 3:42 pm
by jrhees
You can certainly do this, but two words of caution:

1. In my experience, this can be a maintenance nightmare because vendors routinely roll their internal asics and device ID's routinely change (even on the same model hardware).

2. Parsing the Windows' device tree for some types of devices can give confusing results -- Windows will keep some devices populated on the device tree even when they're unplugged, and some devices 'hide' underneath a host-controller's vendor and device ID (such as AC-97 devices, etc.).

-Jon

PostPosted: Wed Nov 17, 2004 4:26 am
by Dean Roddey
Actually, it may turn out to be a moot point, because there appears to be absolutely no way to interate devices and find a non-HID device by way of its vendor/product id, because there is no generic way under Windows to query those ids except for HID devices (maybe there is at the driver level but not at the application level.)

But this is really problematic since it's just not going to be possible to generically look for a device, since there's no practical way to indicate in some data file that you have to load DLL X and call function Y with this and that data, since that data could be anything and I couldn't create it on the fly without knowing it's form it ahead of time.

So for systems like mine, that means really that no auto-sensing can be done in any practical way that isn't hard coded for every USB device. That's pretty sad. USB is supposed to be so auto-magical, but this limitation means I can really do better with serial and ethernet devices, in terms of auto-sensing them generically.

PostPosted: Thu Nov 18, 2004 5:28 am
by jrhees
Dean,

Actually, you *can* iterate using the DeviceManager Win32 calls. I've written code to do just that, although not for the same purpose. If you're interested in my code, let me know...

-Jon