[WIN32SS] Do not call DrvEnableDriver/DrvDisableDriver for LDEV_IMAGE types

This commit is contained in:
Hervé Poussineau 2022-04-17 13:52:10 +02:00
parent 168fea0eee
commit 0ce5985109

View file

@ -174,6 +174,9 @@ LDEVOBJ_bEnableDriver(
ASSERT(pldev); ASSERT(pldev);
ASSERT(pldev->cRefs == 0); ASSERT(pldev->cRefs == 0);
if (pldev->ldevtype == LDEV_IMAGE)
return TRUE;
/* Call the drivers DrvEnableDriver function */ /* Call the drivers DrvEnableDriver function */
RtlZeroMemory(&ded, sizeof(ded)); RtlZeroMemory(&ded, sizeof(ded));
if (!pfnEnableDriver(GDI_ENGINE_VERSION, sizeof(ded), &ded)) if (!pfnEnableDriver(GDI_ENGINE_VERSION, sizeof(ded), &ded))
@ -205,6 +208,9 @@ LDEVOBJ_vDisableDriver(
TRACE("LDEVOBJ_vDisableDriver('%wZ')\n", &pldev->pGdiDriverInfo->DriverName); TRACE("LDEVOBJ_vDisableDriver('%wZ')\n", &pldev->pGdiDriverInfo->DriverName);
if (pldev->ldevtype == LDEV_IMAGE)
return;
if (pldev->pfn.DisableDriver) if (pldev->pfn.DisableDriver)
{ {
/* Call the unload function */ /* Call the unload function */
@ -430,20 +436,16 @@ LDEVOBJ_pLoadDriver(
goto leave; goto leave;
} }
/* Shall we load a driver? */ /* Load the driver */
if (ldevtype != LDEV_IMAGE) if (!LDEVOBJ_bEnableDriver(pldev, pldev->pGdiDriverInfo->EntryPoint))
{ {
/* Load the driver */ ERR("LDEVOBJ_bEnableDriver failed\n");
if (!LDEVOBJ_bEnableDriver(pldev, pldev->pGdiDriverInfo->EntryPoint))
{
ERR("LDEVOBJ_bEnableDriver failed\n");
/* Unload the image. */ /* Unload the image. */
LDEVOBJ_bUnloadImage(pldev); LDEVOBJ_bUnloadImage(pldev);
LDEVOBJ_vFreeLDEV(pldev); LDEVOBJ_vFreeLDEV(pldev);
pldev = NULL; pldev = NULL;
goto leave; goto leave;
}
} }
/* Insert the LDEV into the global list */ /* Insert the LDEV into the global list */