Is there a way to restore user config when driver uninstall from device manager

Emmett 66 Reputation points
2021-09-13T12:12:36.927+00:00

Hi,

We develop kernel mode driver with win32 service for our product on windows 10.
We save some original user config (e.g. screen rotation, power settings config) when our product installed.
And we want to restore the original user config before our product removed.

If user use our uninstaller program to uninstall our product, everything is fine.
But if user uninstall from device manager or some other way, we do not known how to detect and then let we can do restore user config.

Because we also register some class filter like Keyboard and/or DiskDrive.
If user uninstall our driver from device manager, system will not delete our driver name from class upper/lower filter.
Will cause serious problem, keyboard not work or boot OS fail after reboot.

Thanks,
Emmett

Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,579 questions
{count} votes

Accepted answer
  1. Doron Holan 1,801 Reputation points
    2021-09-29T17:39:14.373+00:00

    Drivers are not exposed to the uninstall state change. Driver state should be stored in the devnode and the devnode is cleaned up when the driver is uninstalled. All external state that the driver mutates is not owned by the driver and the issues you are encountering are why it should not be done. I suggest you install a different driver for the class filter role since the pnp installer is not aware of the dependency or the additional state and you are creating a ticking time bomb for the machine to be put into a bad state

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful