Driver's uninstall button is disabled
Asked Answered
M

2

2

I've written my fairly simple first driver for a virtual device. It also has a .inf and I install the driver using devcon.exe.

It install fine and functions properly but my problem is when I try to uninstall it: devcon.exe can't uninstall it and in Device Manager, the Uninstall, Roll Back and Disable buttons for the driver are disabled. My main concern for now is the Uninstall button.

My driver implements the DriverObject->DriverUnload. I've look in the msdn docs, and for now I can't find any DDUninstall INF section for drivers.

When I look in the %WinDir%\inf\setupapi.app.log I see the following error for when I try to remove it with devcon.exe:

>>>  [DIF_REMOVE - ROOT\HIDCLASS\0000]
>>>  Section start 2012/04/01 20:52:22.237
      cmd: devcon.exe  remove HID\MyDriver
!!!  dvi: Default installer: failed!
!!!  dvi: Error 0xe0000231: The device cannot be disabled.
<<<  Section end 2012/04/01 20:52:22.252
<<<  [Exit status: FAILURE(0xe0000231)]

Is there anything I'm missing in the code or in the .inf file so that my driver can be uninstalled ?

Macdermot answered 1/4, 2012 at 14:14 Comment(0)
L
2

Im not sure that this is a inf-related problem. Error 0xe0000231 means ERROR_NOT_DISABLEABLE.

You cannot desinstall while it is being used. So the problem should be the disable.

Do you have defined any close/cleanup callbacks?

Lelandleler answered 3/4, 2012 at 17:13 Comment(1)
Question opened for thee days, I receive this answer when I also found the answer :)). Yes, I was again not seeing the forest because of the trees: the driver's report descriptor was, among others, for a multi-touch device and windows was holding my driver "under custody". I removed that, and now I can disable and uninstall. Thank you anyway :)Macdermot
C
0

Windows won't allow you disable the device while it has child devices on the fly. The simplest way to uninstall the root device is using DiUninstallDevice.

Reference: https://learn.microsoft.com/en-us/windows-hardware/drivers/install/using-setupapi-to-uninstall-devices-and-driver-packages

Critchfield answered 11/8, 2019 at 19:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.