I am using DiUninstallDriver for uninstalling a driver.
The syntax is:
BOOL DiUninstallDriverW(
HWND hwndParent,
LPCWSTR InfPath,
DWORD Flags,
PBOOL NeedReboot
);
The NeedRebbot
parameter is explained:
A pointer to a value of type BOOL that DiUninstallDriver sets to indicate whether a system restart is required to complete the uninstallation.
But in my case, the returned value is False (=Reboot is not needed), but in setupapi.dev.log I see that reboot IS required!!
! dvi: Query-removal during install of 'PCI\VEN_8086&DEV_XXXX&SUBSYS_YYYYYYYY&REV_11\1&11111111&1&B0' was vetoed by 'PCI\VEN_8086&DEV_XXXX&SUBSYS_YYYYYYYY&REV_11\1&11111111&1&B0???' (veto type 5: PNP_VetoOutstandingOpen).
! dvi: Device required reboot: Query remove failed (install) 0x17: CR_REMOVE_VETOED.
I am OK with the reboot that is required (maybe a handle to this driver is opened), by why the API returns false and i have no indication that reboot is required??