Fixed broken driver unloading on shutdown/crash

This commit is contained in:
Alex
2022-12-17 18:20:47 +02:00
parent d33a812703
commit ed49b3ab7c
7 changed files with 28 additions and 38 deletions

View File

@ -670,23 +670,7 @@ namespace CrashHandler
ExceptionOccurred = true;
if (DriverManager)
{
KernelCallback callback;
foreach (Driver::DriverFile *drv in DriverManager->GetDrivers())
{
memset(&callback, 0, sizeof(KernelCallback));
callback.Reason = StopReason;
debug("Stopping driver %ld...", drv->DriverUID);
DriverManager->IOCB(drv->DriverUID, (void *)&callback);
for (size_t i = 0; i < sizeof(drv->InterruptHook) / sizeof(drv->InterruptHook[0]); i++)
{
if (!drv->InterruptHook[i])
continue;
delete drv->InterruptHook[i];
}
}
}
DriverManager->UnloadAllDrivers();
debug("Reading control registers...");
crashdata.Frame = Frame;