When upgrading XENBUS in a situation where XENVBD has made it uninstallable
(without reboot), DriverRemoveFunctionDeviceObject() in the old instance of
XENBUS will cause XENFILT to be removed as PCI and IDE upper filter. Then,
when the new instance of XENBUS starts, it will find an incompatible
version of XEN prior to adding the registery filter entries back in. Thus,
after the requested reboot XENFILT will non-functional and another reboot
will be required to re-instate it.
This patch removes the call to FiltersUninstall() from
DriverRemoveFunctionDeviceObject() and, instead, calls it from
DriverEntry() AFTER the compatibility check. This means that XENFILT will
remain installed across an upgrade and will only be removed if XENBUS
started but has no bound devices (i.e. it has actually been un-installed).
NOTE: This also fixes an unitialized pointer in FiltersUninstallClass().
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
RemoveEntryList(&Dx->ListEntry);
ASSERT3U(Driver.References, !=, 0);
References = --Driver.References;
-
- if (References == 1)
- FiltersUninstall();
}
//
goto done;
}
+ // Remove the filters from the registry. They will be re-instated by
+ // the first successful AddDevice.
+ FiltersUninstall();
+
DriverObject->DriverExtension->AddDevice = DriverAddDevice;
for (Index = 0; Index <= IRP_MJ_MAXIMUM_FUNCTION; Index++) {
HANDLE Key;
ULONG Type;
ULONG Count;
- PANSI_STRING Old;
+ PANSI_STRING Old = NULL;
ULONG Index;
PANSI_STRING New;
NTSTATUS status;