Author: greatlrd
Date: Mon Dec 31 02:12:59 2007
New Revision: 31509
URL:
http://svn.reactos.org/svn/reactos?rev=31509&view=rev
Log:
Implement DxDdUnlockDirectDrawSurface
Fixed smaller typo in DxDdLockDirectDrawSurface sorry
Modified:
trunk/reactos/drivers/directx/dxg/dxg_driver.h
trunk/reactos/drivers/directx/dxg/dxg_int.h
trunk/reactos/drivers/directx/dxg/eng.c
trunk/reactos/include/reactos/drivers/directx/dxg.h
Modified: trunk/reactos/drivers/directx/dxg/dxg_driver.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/directx/dxg/dxg_dr…
==============================================================================
--- trunk/reactos/drivers/directx/dxg/dxg_driver.h (original)
+++ trunk/reactos/drivers/directx/dxg/dxg_driver.h Mon Dec 31 02:12:59 2007
@@ -89,7 +89,7 @@
//{DXG_INDEX_DxDdAllocPrivateUserMem, (PFN)DxDdAllocPrivateUserMem},
//{DXG_INDEX_DxDdFreePrivateUserMem, (PFN)DxDdFreePrivateUserMem},
{DXG_INDEX_DxDdLockDirectDrawSurface, (PFN)DxDdLockDirectDrawSurface},
- //{DXG_INDEX_DxDdUnlockDirectDrawSurface, (PFN)DxDdUnlockDirectDrawSurface},
+ {DXG_INDEX_DxDdUnlockDirectDrawSurface, (PFN)DxDdUnlockDirectDrawSurface},
//{DXG_INDEX_DxDdSetAccelLevel, (PFN)DxDdSetAccelLevel},
//{DXG_INDEX_DxDdGetSurfaceLock, (PFN)DxDdGetSurfaceLock},
//{DXG_INDEX_DxDdEnumLockedSurfaceRect, (PFN)DxDdEnumLockedSurfaceRect},
Modified: trunk/reactos/drivers/directx/dxg/dxg_int.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/directx/dxg/dxg_in…
==============================================================================
--- trunk/reactos/drivers/directx/dxg/dxg_int.h (original)
+++ trunk/reactos/drivers/directx/dxg/dxg_int.h Mon Dec 31 02:12:59 2007
@@ -89,6 +89,7 @@
DWORD STDCALL DxDxgGenericThunk(ULONG_PTR ulIndex, ULONG_PTR ulHandle, SIZE_T
*pdwSizeOfPtr1, PVOID pvPtr1, SIZE_T *pdwSizeOfPtr2, PVOID pvPtr2);
DWORD STDCALL DxDdIoctl(ULONG ulIoctl, PVOID pBuffer, ULONG ulBufferSize);
PDD_SURFACE_LOCAL STDCALL DxDdLockDirectDrawSurface(HANDLE hDdSurface);
+BOOL STDCALL DxDdUnlockDirectDrawSurface(PDD_SURFACE_LOCAL pSurface);
/* Internel functions */
BOOL FASTCALL VerifyObjectOwner(PDD_ENTRY pEntry);
Modified: trunk/reactos/drivers/directx/dxg/eng.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/directx/dxg/eng.c?…
==============================================================================
--- trunk/reactos/drivers/directx/dxg/eng.c (original)
+++ trunk/reactos/drivers/directx/dxg/eng.c Mon Dec 31 02:12:59 2007
@@ -16,16 +16,32 @@
STDCALL
DxDdLockDirectDrawSurface(HANDLE hDdSurface)
{
- PDD_ENTRY pObject;
PDD_SURFACE_LOCAL pSurfacelcl = NULL;
- pObject = DdHmgLock(hDdSurface, 2, 0);
- if (pObject != NULL)
+ pSurfacelcl = DdHmgLock(hDdSurface, 2, FALSE);
+ if (pSurfacelcl != NULL)
{
- pSurfacelcl = (PDD_SURFACE_LOCAL)((PBYTE)pObject + sizeof(PDD_ENTRY));
+ pSurfacelcl = (PDD_SURFACE_LOCAL)(((PBYTE)&pSurfacelcl) +
sizeof(DD_BASEOBJECT));
}
return pSurfacelcl;
}
+BOOL
+STDCALL
+DxDdUnlockDirectDrawSurface(PDD_SURFACE_LOCAL pSurface)
+{
+ BOOL retVal = FALSE;
+ PDD_BASEOBJECT pObject = NULL;
+ if (pSurface)
+ {
+ pObject = (PDD_BASEOBJECT)( ((PBYTE)&pSurface) - sizeof(DD_BASEOBJECT));
+ InterlockedDecrement(&pObject->cExclusiveLock);
+ retVal = TRUE;
+ }
+
+ return retVal;
+}
+
+
Modified: trunk/reactos/include/reactos/drivers/directx/dxg.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/drivers/di…
==============================================================================
--- trunk/reactos/include/reactos/drivers/directx/dxg.h (original)
+++ trunk/reactos/include/reactos/drivers/directx/dxg.h Mon Dec 31 02:12:59 2007
@@ -207,7 +207,7 @@
//typedef x (NTAPI *PGD_DxDdAllocPrivateUserMem)(
//typedef x (NTAPI *PGD_DxDdFreePrivateUserMem)(
typedef PDD_SURFACE_LOCAL (NTAPI *PGD_DxDdLockDirectDrawSurface)(HANDLE hDdSurface);
-//typedef x (NTAPI *PGD_DxDdUnlockDirectDrawSurface)(
+typedef BOOL (NTAPI *PGD_DxDdUnlockDirectDrawSurface)(HANDLE hDdSurface);
//typedef x (NTAPI *PGD_DxDdSetAccelLevel)(
//typedef x (NTAPI *PGD_DxDdGetSurfaceLock)(
//typedef x (NTAPI *PGD_DxDdEnumLockedSurfaceRect)(