|
From: Tim R. <ti...@pr...> - 2018-05-31 16:57:08
|
Paul Qureshi wrote: > Thank you David, having DeviceInterfaceGUIDs in the registry seems to > have fixed the issue and WinUSB can now access the WinUSB part of the > composite device. It's rather frustrating that this is necessary as it > requires using the old SetupDI API and consumes around 180 bytes of > flash memory on the device, but at least it works. You can specify the WinUSB DeviceInterfaceGUID for your interface in the Microsoft OS-specific string descriptors. You should not need to modify the registry with the SetupDi APIs at all. That's what the OSDs are supposed to do. > Windows is a real mess. There is the older SetupDI API, but it seems > that it's not recommended now because it's not fully supported for > Universal Apps or something. It is not fair for you to label an operating system "a real mess" just because you are not familiar with it. The Windows device/driver philosophy is simply quite different from the Linux device/driver philosophy, and libusb is steeped in the Linux philosophy. There's an impedance mismatch with Windows. Windows is designed to abstract as much as possible, Linux exposes as much as possible. You can't argue that one is "better" than the other. The Linux philosophy works better with experimenters, hobbyists, and competent users. The Windows philosophy works better in a corporate world where most of your users are secretaries and other non-technical people who don't want to understand their computers. The SetupDi APIs are not older, as you might conclude. The whole UWP thing has a strange evolution. The original configuration manager API set, CfgMgr32 (the CM_xxx APis), was introduced in Windows/386 (1988!!). The SetupDi APIs did not arrive until Windows 2000, when PnP was introduced. They are built on top of CfgMgr32, and the CfgMgr32 APIs were deprecated. The SetupDi APIs are quite wordy, but they do a lot of things. Everything Device Manager can do is in a SetupDi API. But for UWP, which is intended to support phones and IoT devices, their goal is to strip everything down to the bare minimum. Since SetupDi is simply a wrapper around CfgMgr32, they decided not to include SetupDi. Everything old is new again. -- Tim Roberts, ti...@pr... Providenza & Boekelheide, Inc. |