- Fixed releasing of display ownership.

svn path=/trunk/; revision=9024
This commit is contained in:
Filip Navara 2004-04-08 09:43:55 +00:00
parent 3cb07b0ba8
commit a7270ad893
2 changed files with 14 additions and 4 deletions

View file

@ -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 @@ IntVideoPortResetDisplayParameters(ULONG Columns, ULONG Rows)
&ResetDisplayParametersDeviceExtension->MiniPortDeviceExtension,
Columns, Rows))
{
ResetDisplayParametersDeviceExtension = NULL;
return FALSE;
}
ResetDisplayParametersDeviceExtension = NULL;
return TRUE;
}
@ -131,6 +131,8 @@ IntVideoPortDispatchOpen(
{
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 @@ IntVideoPortDispatchClose(
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);

View file

@ -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 @@ typedef struct _VIDEO_PORT_DEVICE_EXTENSTION
LIST_ENTRY AddressMappingListHead;
KDPC DpcObject;
VIDEO_PORT_DRIVER_EXTENSION *DriverExtension;
ULONG DeviceOpened;
CHAR MiniPortDeviceExtension[1];
} VIDEO_PORT_DEVICE_EXTENSION, *PVIDEO_PORT_DEVICE_EXTENSION;