Filip Navara:
authorColin Finck <colin@reactos.org>
Wed, 7 May 2008 21:51:39 +0000 (21:51 +0000)
committerColin Finck <colin@reactos.org>
Wed, 7 May 2008 21:51:39 +0000 (21:51 +0000)
- Only increment VideoPortDeviceNumber, when IntVideoPortCreateAdapterDeviceObject and IntVideoPortFindAdapter succeeded.
  This fixes loading the CL54xx miniport driver. But it still isn't usable, because win32k cannot find the DDI driver for it.

svn path=/trunk/; revision=33357

reactos/drivers/video/videoprt/dispatch.c
reactos/drivers/video/videoprt/videoprt.c
reactos/drivers/video/videoprt/videoprt.h

index f4161bd..0f36ad1 100644 (file)
@@ -81,6 +81,8 @@ IntVideoPortAddDevice(
       DriverExtension,
       PhysicalDeviceObject,
       &DeviceObject);
+   if (NT_SUCCESS(Status))
+      VideoPortDeviceNumber++;
 
    return Status;
 }
index 8693b0a..e21a044 100644 (file)
@@ -187,7 +187,7 @@ IntVideoPortCreateAdapterDeviceObject(
     * object names and symlinks.
     */
 
-   DeviceNumber = VideoPortDeviceNumber++;
+   DeviceNumber = VideoPortDeviceNumber;
    if (DeviceNumber == 0xFFFFFFFF)
    {
       WARN_(VIDEOPRT, "Can't find free device number\n");
@@ -721,6 +721,8 @@ VideoPortInitialize(
          return Status;
       Status = IntVideoPortFindAdapter(DriverObject, DriverExtension, DeviceObject);
       INFO_(VIDEOPRT, "IntVideoPortFindAdapter returned 0x%x\n", Status);
+      if (NT_SUCCESS(Status))
+         VideoPortDeviceNumber++;
       return Status;
    }
    else
index f1717b7..870092c 100644 (file)
@@ -196,6 +196,7 @@ IntVideoPortMapPhysicalMemory(
 
 extern ULONG CsrssInitialized;
 extern PKPROCESS Csrss;
+extern ULONG VideoPortDeviceNumber;
 
 VOID FASTCALL
 IntAttachToCSRSS(PKPROCESS *CallingProcess, PKAPC_STATE ApcState);