From e5b4190710ca7dafe040c4259edad2cd7519d5f3 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Mon, 26 May 2008 18:32:40 +0000 Subject: [PATCH] Fix incorrect logic in IntVideoPortSetupInterrupt and add comment. svn path=/trunk/; revision=33717 --- reactos/drivers/video/videoprt/interrupt.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/reactos/drivers/video/videoprt/interrupt.c b/reactos/drivers/video/videoprt/interrupt.c index 06407aa1eda..6dd8e0f1fae 100644 --- a/reactos/drivers/video/videoprt/interrupt.c +++ b/reactos/drivers/video/videoprt/interrupt.c @@ -48,13 +48,17 @@ IntVideoPortSetupInterrupt( DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension; - if (ConfigInfo->BusInterruptVector == 0) - ConfigInfo->BusInterruptVector = DeviceExtension->InterruptVector; + /* + * MSDN documentation for VIDEO_PORT_CONFIG_INFO states: "If a miniport driver's + * HwVidFindAdapter function finds that the video adapter does not generate + * interrupts or that it cannot determine a valid interrupt vector/level for + * the adapter, HwVidFindAdapter should set both BusInterruptVector and + * BusInterruptLevel to zero. + */ - if (ConfigInfo->BusInterruptLevel == 0) - ConfigInfo->BusInterruptLevel = DeviceExtension->InterruptLevel; - - if (DriverExtension->InitializationData.HwInterrupt != NULL) + if (DriverExtension->InitializationData.HwInterrupt != NULL && + ConfigInfo->BusInterruptLevel != 0 && + ConfigInfo->BusInterruptVector != 0) { ULONG InterruptVector; KIRQL Irql;