Author: greatlrd
Date: Sun Apr 9 03:01:04 2006
New Revision: 21520
URL:
http://svn.reactos.ru/svn/reactos?rev=21520&view=rev
Log:
parly implement surface_Lock it does not work yet but here is the code almost complete for
HAL
Modified:
trunk/reactos/dll/directx/ddraw/hal/surface_hal.c
trunk/reactos/dll/directx/ddraw/main/surface_main.c
trunk/reactos/dll/directx/ddraw/rosdraw.h
Modified: trunk/reactos/dll/directx/ddraw/hal/surface_hal.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/hal/surfa…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/hal/surface_hal.c (original)
+++ trunk/reactos/dll/directx/ddraw/hal/surface_hal.c Sun Apr 9 03:01:04 2006
@@ -315,7 +315,37 @@
HRESULT Hal_DDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect, LPDDSURFACEDESC2
pDDSD, DWORD flags, HANDLE event)
{
- DX_STUB;
+
+ IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
+
+
+ DDHAL_LOCKDATA Lock;
+
+ if (prect!=NULL)
+ {
+ Lock.bHasRect = TRUE;
+ memcpy(&Lock.rArea,prect,sizeof(RECTL));
+ }
+ else
+ {
+ Lock.bHasRect = FALSE;
+ }
+
+ Lock.ddRVal = DDERR_NOTPALETTIZED;
+ Lock.Lock = This->owner->mCallbacks.HALDDSurface.Lock;
+ Lock.dwFlags = flags;
+ Lock.lpDDSurface = This->Surf->mpPrimaryLocals[0];
+ Lock.lpDD = &This->owner->mDDrawGlobal;
+ // FIXME lpSurfData
+ //Lock.lpSurfData =
+
+ if (This->owner->mCallbacks.HALDDSurface.Lock(&Lock)!=
DDHAL_DRIVER_NOTHANDLED)
+ {
+ return Lock.ddRVal;
+ }
+ // FIXME LPDDSURFACEDESC2
+
+ return DD_OK;
}
HRESULT Hal_DDrawSurface_Unlock(LPDIRECTDRAWSURFACE7 iface, LPRECT pRect)
{
Modified: trunk/reactos/dll/directx/ddraw/main/surface_main.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/main/surf…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/main/surface_main.c (original)
+++ trunk/reactos/dll/directx/ddraw/main/surface_main.c Sun Apr 9 03:01:04 2006
@@ -81,6 +81,11 @@
DX_WINDBG_trace();
IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
+
+ if (event != NULL)
+ {
+ return DDERR_INVALIDPARAMS;
+ }
if (This->owner->mCallbacks.HALDDSurface.dwFlags & DDHAL_SURFCB32_LOCK)
{
Modified: trunk/reactos/dll/directx/ddraw/rosdraw.h
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/directx/ddraw/rosdraw.h…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/rosdraw.h (original)
+++ trunk/reactos/dll/directx/ddraw/rosdraw.h Sun Apr 9 03:01:04 2006
@@ -9,6 +9,22 @@
#include <ddrawi.h>
#include <d3dhal.h>
#include <ddrawgdi.h>
+
+
+/* this sturct are not longer in DDK
+ I did recrate it by looking diffent betwin DD_xx struct and _DDHAL strucrt
+ only diffent I found was the global pointer have been change from
LPDDRAWI_DDRAWSURFACE_GBL
+ to DD_DIRECTDRAW_GLOBAL
+*/
+
+typedef struct _DDHAL_MAPMEMORYDATA
+{
+ LPDDRAWI_DDRAWSURFACE_GBL lpDD;
+ BOOL bMap;
+ HANDLE hProcess;
+ FLATPTR fpProcess;
+ HRESULT ddRVal;
+} DDHAL_MAPMEMORYDATA;
/* own macro to alloc memmory */
#define DxHeapMemAlloc(m) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, m)