Author: greatlrd
Date: Thu Dec 9 08:58:46 2010
New Revision: 49992
URL:
http://svn.reactos.org/svn/reactos?rev=49992&view=rev
Log:
implement VBEVideoUnShareVideoMemmory
for DdUnlock and DdMapmemmory
Modified:
branches/reactx/reactos/drivers/video/miniport/vbe/vbemp.c
branches/reactx/reactos/drivers/video/miniport/vbe/vbemp.h
Modified: branches/reactx/reactos/drivers/video/miniport/vbe/vbemp.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/drivers/video/mi…
==============================================================================
--- branches/reactx/reactos/drivers/video/miniport/vbe/vbemp.c [iso-8859-1] (original)
+++ branches/reactx/reactos/drivers/video/miniport/vbe/vbemp.c [iso-8859-1] Thu Dec 9
08:58:46 2010
@@ -538,6 +538,17 @@
(PVIDEO_SHARE_MEMORY_INFORMATION)RequestPacket->OutputBuffer,
RequestPacket->StatusBlock);
break;
+ case IOCTL_VIDEO_UNSHARE_VIDEO_MEMORY:
+ if (RequestPacket->InputBufferLength < sizeof(VIDEO_SHARE_MEMORY))
+ {
+ RequestPacket->StatusBlock->Status = ERROR_INSUFFICIENT_BUFFER;
+ return TRUE;
+ }
+ Result = VBEVideoUnShareVideoMemmory(
+ (PVBE_DEVICE_EXTENSION)HwDeviceExtension,
+ (PVIDEO_SHARE_MEMORY)RequestPacket->InputBufferLength,
+ RequestPacket->StatusBlock);
+ break;
default:
RequestPacket->StatusBlock->Status = ERROR_INVALID_FUNCTION;
@@ -853,7 +864,7 @@
}
/*
- * VBEQueryNumAvailModes
+ * VBEVideoShareVideoMemmory
*
*/
BOOLEAN FASTCALL
@@ -877,8 +888,8 @@
*/
if ( ((DeviceExtension->ModeInfo[DeviceExtension->CurrentMode].ModeAttributes
& VBE_MODEATTR_LINEAR) != VBE_MODEATTR_LINEAR) ||
- (pShareMemory->ViewOffset > VBEDeviceExtension->VbeInfo.TotalMemory)
||
- ((pShareMemory->ViewOffset + pShareMemory->ViewSize) >
VBEDeviceExtension->VbeInfo.TotalMemory) )
+ (pShareMemory->ViewOffset > DeviceExtension->VbeInfo.TotalMemory) ||
+ ((pShareMemory->ViewOffset + pShareMemory->ViewSize) >
DeviceExtension->VbeInfo.TotalMemory) )
{
retvalue = FALSE;
}
@@ -912,9 +923,35 @@
}
}
-
return retvalue;
}
+
+/*
+ * VBEVideoUnShareVideoMemmory
+ *
+ */
+BOOLEAN FASTCALL
+VBEVideoUnShareVideoMemmory(
+ PVBE_DEVICE_EXTENSION DeviceExtension,
+ PVIDEO_SHARE_MEMORY pShareMemory,
+ PSTATUS_BLOCK StatusBlock)
+{
+ BOOLEAN retvalue;
+
+ StatusBlock->Status = VideoPortUnmapMemory( DeviceExtension,
+
pShareMemory->RequestedVirtualAddress,
+ pShareMemory->ProcessHandle);
+ if (StatusBlock->Status == NO_ERROR)
+ {
+ retvalue = TRUE;
+ }
+ else
+ {
+ retvalue = FALSE;
+ }
+ return retvalue;
+}
+
/*
* VBEQueryNumAvailModes
*
@@ -1091,7 +1128,7 @@
* For VGA compatible adapters program the color registers directly.
*/
- if (!(DeviceExtension->VbeInfo.Capabilities & 2))
+ if (!(DeviceExtension->VbeInfo.Capabilities & VBE_CHECK_VGA_COMPATIBLE))
{
for (Entry = ColorLookUpTable->FirstEntry;
Entry < ColorLookUpTable->NumEntries + ColorLookUpTable->FirstEntry;
Modified: branches/reactx/reactos/drivers/video/miniport/vbe/vbemp.h
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/reactos/drivers/video/mi…
==============================================================================
--- branches/reactx/reactos/drivers/video/miniport/vbe/vbemp.h [iso-8859-1] (original)
+++ branches/reactx/reactos/drivers/video/miniport/vbe/vbemp.h [iso-8859-1] Thu Dec 9
08:58:46 2010
@@ -101,6 +101,12 @@
#define VBE_GETRETURNCODE(x) (x & 0xFFFF)
/*
+ * VBE checkflags Codes
+ */
+#define VBE_CHECK_VGA_COMPATIBLE 0x02
+#define VBE_CHECK_STEROSCOPIC_HW_SUPPORT 0x08
+
+/*
* VBE specification defined structure for general adapter info
* returned by function VBE_GET_CONTROLLER_INFORMATION command.
*/
@@ -312,3 +318,9 @@
PVIDEO_SHARE_MEMORY pShareMemory,
PVIDEO_SHARE_MEMORY_INFORMATION pShareMemoryInformation,
PSTATUS_BLOCK StatusBlock);
+
+BOOLEAN FASTCALL
+VBEVideoUnShareVideoMemmory(
+ PVBE_DEVICE_EXTENSION DeviceExtension,
+ PVIDEO_SHARE_MEMORY pShareMemory,
+ PSTATUS_BLOCK StatusBlock);