Comments (2)
It appears that if a device doesn't have a normal driver associated with it, it gets marked as having a driver install error (28) and then on IOCTL_INTERNAL_USB_CYCLE_PORT the device disappears and is not returned.
The only way of preventing this I found is to mark the device as RawDeviceOK.
To do this, a filter has to be attached to such devices that sets the RawDeviceOK flag in IRP_MN_QUERY_CAPABILITIES.
Ideally such a filter isn't attached to devices that have a normal driver.
It doesn't seem possible to determine if a device has a normal driver or not using conventional means (i.e. IoGetDeviceProperty() or IoOpenDeviceRegistryKey() to see if there is a Driver or Service value), because the PDO is not valid within IRP_MN_QUERY_DEVICE_RELATIONS.
The only workaround to this appears to be to locate the Registry Enum/USB entries for VID/PID devices, and read the Driver or Service value that way.
Devices that are marked Raw and have a corresponding Enum won't switch to using a normal driver if it is installed after the device is first plugged in. A workaround for this is to set the CONFIGFLAG_REINSTALL flag in the devices ConfigFlags value within its Registry Enum on the device being unplugged.
I've added code to do all this in the UsbDk branch here https://github.com/gwgill/UsbDk
from usbdk.
After further testing, it seemed that there was no reliable solution to the problem of using UsbDk to drive devices without a conventional driver. While the workaround of adding a filter driver and marking the device RawDeviceOK works for many devices, the hub port CYCLE used by UsbDk was not reliable for some combinations of devices and hubs. Such combinations results in a failure to read the correct VID/PID from the device, returning VID_0000&PID_0002 instead.
After considerable trial and error efforts, it seems that these difficult devices can indeed be made to work if they are configured and their hub port reset before doing a hub port CYCLE. The code to do this and finesse several other aspects of using UsbDk to drive a device without a conventional function driver is present in my fork of UsbDk .
from usbdk.
Related Issues (20)
- Blue Screen of Death After Installing on WINDOWS 10 HOT 9
- Problem with AbortPipe HOT 6
- Failed to compile on new setup HOT 6
- UsbDk can't work after plugging out the compound devices being directed.
- On device restart from UsbDeviceTreeView Hidden USB mass storage device are fully accessible HOT 1
- WDF_VIOLATION due to multiple power policy owners HOT 8
- UsbDK Installation failing- There is a problem with this Windows Installer package etc HOT 7
- usbdk can't work with some USB serial device(eg 076b:23c3) twice HOT 4
- USB not working after install/uninstall HOT 2
- had to uninstall this one to install the one that comes with Chimera Pro. HOT 1
- Failed to open device symlink \\.UsbDk (Access is denied. Error code =5) HOT 1
- UsbDk automatic disable usb-device HOT 5
- Can't re-open device after closing it with outstanding OVERLAPPED event HOT 2
- usb 3 host controller HOT 2
- UsbDk cause win10 system in vhdx fail to startup HOT 10
- When launching MSI Installer, installer fails HOT 2
- Install grinds entire system to a halt HOT 5
- UsbDk not working in tiny11 HOT 1
- Opening the AX201 Bluetooth device causes a blue screen HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from usbdk.