Commit in reactos/drivers/video/videoprt on MAIN
dispatch.c+12-31.2 -> 1.3
videoprt.h+2-11.9 -> 1.10
+14-4
2 modified files
- Fixed releasing of display ownership.

reactos/drivers/video/videoprt
dispatch.c 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- dispatch.c	19 Mar 2004 20:58:32 -0000	1.2
+++ dispatch.c	8 Apr 2004 09:43:55 -0000	1.3
@@ -18,7 +18,7 @@
  * If not, write to the Free Software Foundation,
  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * $Id: dispatch.c,v 1.2 2004/03/19 20:58:32 navaraf Exp $
+ * $Id: dispatch.c,v 1.3 2004/04/08 09:43:55 navaraf Exp $
  */
 
 #include "videoprt.h"
@@ -55,11 +55,11 @@
           &ResetDisplayParametersDeviceExtension->MiniPortDeviceExtension,
           Columns, Rows))
    {
+      ResetDisplayParametersDeviceExtension = NULL;
       return FALSE;
    }
 
    ResetDisplayParametersDeviceExtension = NULL;
-
    return TRUE;
 }
 
@@ -131,6 +131,8 @@
    {
       Irp->IoStatus.Status = STATUS_SUCCESS;
 
+      InterlockedIncrement(&DeviceExtension->DeviceOpened);
+
       /*
        * Storing the device extension pointer in a static variable is an
        * ugly hack. Unfortunately, we need it in VideoPortResetDisplayParameters
@@ -168,10 +170,17 @@
    IN PDEVICE_OBJECT DeviceObject,
    IN PIRP Irp)
 {
+   PVIDEO_PORT_DEVICE_EXTENSION DeviceExtension;
+
    DPRINT("IntVideoPortDispatchClose\n");
 
-   if (ResetDisplayParametersDeviceExtension != NULL)
+   DeviceExtension = (PVIDEO_PORT_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
+   if (DeviceExtension->DeviceOpened > 1 &&
+       InterlockedDecrement(&DeviceExtension->DeviceOpened) == 0)
+   {
+      ResetDisplayParametersDeviceExtension = DeviceExtension;
       HalReleaseDisplayOwnership();
+   }
 
    Irp->IoStatus.Status = STATUS_SUCCESS;
    IoCompleteRequest(Irp, IO_NO_INCREMENT);

reactos/drivers/video/videoprt
videoprt.h 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- videoprt.h	21 Mar 2004 12:31:19 -0000	1.9
+++ videoprt.h	8 Apr 2004 09:43:55 -0000	1.10
@@ -18,7 +18,7 @@
  * If not, write to the Free Software Foundation,
  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  *
- * $Id: videoprt.h,v 1.9 2004/03/21 12:31:19 gvg Exp $
+ * $Id: videoprt.h,v 1.10 2004/04/08 09:43:55 navaraf Exp $
  */
 
 #ifndef VIDEOPRT_H
@@ -71,6 +71,7 @@
    LIST_ENTRY AddressMappingListHead;
    KDPC DpcObject;
    VIDEO_PORT_DRIVER_EXTENSION *DriverExtension;
+   ULONG DeviceOpened;
    CHAR MiniPortDeviceExtension[1];
 } VIDEO_PORT_DEVICE_EXTENSION, *PVIDEO_PORT_DEVICE_EXTENSION;
 
CVSspam 0.2.8