Driver: Force reauth on conf changes.

This commit is contained in:
Nodir Temirkhodjaev 2017-09-07 09:05:15 +05:00
parent 3e00b080da
commit 9655bb564a

View File

@ -304,6 +304,26 @@ fort_callout_remove (void)
g_device->active = FALSE;
}
static NTSTATUS
fort_callout_force_reauth (PDEVICE_OBJECT device)
{
NTSTATUS status;
// Unregister
fort_callout_remove();
fort_prov_unregister();
// Register
status = fort_prov_register(!g_device->prov_temporary,
g_device->prov_boot, NULL, NULL);
if (status == STATUS_SUCCESS) {
status = fort_callout_install(device);
}
return status;
}
static NTSTATUS
fort_device_create (PDEVICE_OBJECT device, PIRP irp)
{
@ -375,7 +395,7 @@ fort_device_control (PDEVICE_OBJECT device, PIRP irp)
status = STATUS_INSUFFICIENT_RESOURCES;
} else {
fort_conf_ref_set(conf_ref);
status = STATUS_SUCCESS;
status = fort_callout_force_reauth(device);
}
}
break;
@ -386,7 +406,7 @@ fort_device_control (PDEVICE_OBJECT device, PIRP irp)
if (len == sizeof(FORT_CONF_FLAGS)) {
fort_conf_ref_flags_set(conf_flags);
status = STATUS_SUCCESS;
status = fort_callout_force_reauth(device);
}
break;
}