Author: greatlrd
Date: Wed Jan 2 11:47:46 2008
New Revision: 31554
URL:
http://svn.reactos.org/svn/reactos?rev=31554&view=rev
Log:
implement DxEngLockShareSem
implement DxEngUnlockShareSem
Modified:
trunk/reactos/include/reactos/drivers/directx/dxeng.h
trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c
Modified: trunk/reactos/include/reactos/drivers/directx/dxeng.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/drivers/di…
==============================================================================
--- trunk/reactos/include/reactos/drivers/directx/dxeng.h (original)
+++ trunk/reactos/include/reactos/drivers/directx/dxeng.h Wed Jan 2 11:47:46 2008
@@ -78,13 +78,15 @@
/* Notes : Set Gamma ramp */
BOOL DxEngSetDeviceGammaRamp(HDEV hPDev, PGAMMARAMP Ramp, BOOL Unuse);
-/* prototypes are not done yet, I need gather all my notes
- * to make them correct
+BOOLEAN DxEngLockShareSem();
+BOOLEAN DxEngUnlockShareSem();
+
+/* prototypes are not done yet, I need gather all my notes
+ * to make them correct
*/
DWORD DxEngCreateMemoryDC(DWORD x1);
DWORD DxEngScreenAccessCheck();
-DWORD DxEngLockShareSem();
-DWORD DxEngUnlockShareSem();
+
DWORD DxEngLockHdev(DWORD x1);
DWORD DxEngUnlockHdev(DWORD x1);
DWORD DxEngReferenceHdev(DWORD x1);
Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c Wed Jan 2 11:47:46 2008
@@ -10,6 +10,7 @@
#include <w32k.h>
#include <debug.h>
+ERESOURCE ghsemShareDevLock;
@@ -214,22 +215,57 @@
return FALSE;
}
-/************************************************************************/
-/* DxEngLockShareSem */
-/************************************************************************/
-DWORD DxEngLockShareSem()
-{
- UNIMPLEMENTED;
- return FALSE;
-}
-
-/************************************************************************/
-/* DxEngUnlockShareSem */
-/************************************************************************/
-DWORD DxEngUnlockShareSem()
-{
- UNIMPLEMENTED;
- return FALSE;
+/*++
+* @name DxEngLockShareSem
+* @implemented
+*
+* The function DxEngLockShareSem doing share lock of ghsemShareDevLock
+*
+* @return
+* This function returns TRUE for susssess, or FALSE for fail, FALSE can only
+* mean it being already lock.
+*
+* @remarks.
+* it being use in diffent ntuser* functions and ntgdi*
+* ReactOS specify it is not been inuse at moment
+*SystemResourcesList
+*--*/
+BOOLEAN
+DxEngLockShareSem()
+{
+ BOOLEAN retVal = 0;
+
+ if (ExIsResourceAcquiredExclusiveLite(&ghsemShareDevLock) == FALSE)
+ {
+ KeEnterCriticalRegion();
+ retVal = ExAcquireResourceExclusiveLite(&ghsemShareDevLock, TRUE);
+ }
+
+ return retVal;
+}
+
+/*++
+* @name DxEngUnlockShareSem
+* @implemented
+*
+* The function DxEngUnlockShareSem doing share unlock of ghsemShareDevLock
+*
+* @return
+* This function returns TRUE no matter what
+*
+* @remarks.
+* ReactOS specify it is not been inuse at moment
+*
+*--*/
+BOOLEAN
+DxEngUnlockShareSem()
+{
+ if (ExIsResourceAcquiredExclusiveLite(&ghsemShareDevLock) == TRUE)
+ {
+ ExReleaseResourceLite(&ghsemShareDevLock);
+ KeLeaveCriticalRegion();
+ }
+ return TRUE;
}
/************************************************************************/
@@ -415,9 +451,9 @@
* The DC handle
*
* @param DWORD type
-* value 1 = Is DC fullscreen
-* value 2 = Get Complexity of visible region.
-* value 3 = Get Driver hdev, which is a pPDev.
+* value 1 = Is DC fullscreen
+* value 2 = Get Complexity of visible region.
+* value 3 = Get Driver hdev, which is a pPDev.
*
* @return
* Return one of the type values
@@ -445,13 +481,13 @@
break;
case 3:
{
- /* Return the HDEV of this DC. */
+ /* Return the HDEV of this DC. */
retVal = (DWORD) pDC->pPDev;
break;
}
default:
/* if a valid type is not found, zero is returned */
- DPRINT1("Warning did not find type %d\n",type);
+ DPRINT1("Warning did not find type %d\n",type);
break;
}
DC_UnlockDc(pDC);