Driver's uninstall button is disabled

2019-02-19 18:49发布

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 ?

1条回答
ゆ 、 Hurt°
2楼-- · 2019-02-19 19:12

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?

查看更多
登录 后发表回答