https://git.reactos.org/?p=reactos.git;a=commitdiff;h=08a68340750adffc7912e06fc761d762a8a9c22e

commit 08a68340750adffc7912e06fc761d762a8a9c22e
Author:     Hervé Poussineau <hpous...@reactos.org>
AuthorDate: Mon Sep 30 18:23:39 2024 +0200
Commit:     Hervé Poussineau <hpous...@reactos.org>
CommitDate: Fri Oct 11 20:35:23 2024 +0200

    [VIDEOPRT] Allow conflicting resources if this is the video base driver
    
    CORE-18960
---
 win32ss/drivers/videoprt/resource.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/win32ss/drivers/videoprt/resource.c 
b/win32ss/drivers/videoprt/resource.c
index 25c5a89f62c..9f50c4bd5e7 100644
--- a/win32ss/drivers/videoprt/resource.c
+++ b/win32ss/drivers/videoprt/resource.c
@@ -24,8 +24,18 @@
 #define NDEBUG
 #include <debug.h>
 
+extern BOOLEAN VpBaseVideo;
+
 /* PRIVATE FUNCTIONS 
**********************************************************/
 
+static BOOLEAN
+IntIsVgaSaveDriver(
+    IN PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension)
+{
+    UNICODE_STRING VgaSave = RTL_CONSTANT_STRING(L"\\Driver\\VgaSave");
+    return RtlEqualUnicodeString(&VgaSave, 
&DeviceExtension->DriverObject->DriverName, TRUE);
+}
+
 NTSTATUS NTAPI
 IntVideoPortGetLegacyResources(
     IN PVIDEO_PORT_DRIVER_EXTENSION DriverExtension,
@@ -994,6 +1004,16 @@ VideoPortVerifyAccessRanges(
 
     ExFreePoolWithTag(ResourceList, TAG_VIDEO_PORT);
 
+    /* If VgaSave driver is conflicting and we don't explicitely want
+     * to use it, ignore the problem (because win32k will try to use
+     * this driver only if all other ones are failing). */
+    if (Status == STATUS_CONFLICTING_ADDRESSES &&
+        IntIsVgaSaveDriver(DeviceExtension) &&
+        !VpBaseVideo)
+    {
+        return NO_ERROR;
+    }
+
     if (!NT_SUCCESS(Status) || ConflictDetected)
         return ERROR_INVALID_PARAMETER;
     else

Reply via email to