简体   繁体   中英

Using SetupDI API functions, to disable enable COM port device driver requires running as Administrator

I need to Disable/Enable a loaded device driver because the device "at times" when connected fails to load properly.
This device is controlled by the user and is POWERED AND UN-POWERED very frequently. The program which needs to use the driver DETECTS a failure and needs to Disable/Enable which ALWAYS corrects the issue.

But using the SetupAPI methods causes the executable to require ADMIN rights (Windows 7 and Windows 10). I'm not sure if I need to use "other" coding methods or if SIGNING the executable will remove the "requirement" to run as administrator?

Any ideas would be greatly appreciated.

The problem is that is any used can unload a driver, they'd be able to interfere with other users. Drivers are a shared resource.

"Signing" the executable makes a few warnings less scary but doesn't affect security.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM