Author: greatlrd
Date: Tue Jul 25 20:57:57 2006
New Revision: 23287
URL:
http://svn.reactos.org/svn/reactos?rev=23287&view=rev
Log:
Implement Main_DDrawSurface_EnumAttachedSurfaces after wine desgin of it
we need rewrite Createsurface and Implement AttahedSurface
Thanks to wine code and some wine devloper to expain how it works
I got one more directx sdk sample working parlty with this change.
Modified:
trunk/reactos/dll/directx/ddraw/main/surface_main.c
Modified: trunk/reactos/dll/directx/ddraw/main/surface_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/main/sur…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/main/surface_main.c (original)
+++ trunk/reactos/dll/directx/ddraw/main/surface_main.c Tue Jul 25 20:57:57 2006
@@ -190,9 +190,45 @@
LPVOID context,
LPDDENUMSURFACESCALLBACK7 cb)
{
- DX_WINDBG_trace();
-
- DX_STUB;
+ IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
+ IDirectDrawSurfaceImpl *surf;
+ DDSURFACEDESC2 desc;
+
+ DX_WINDBG_trace();
+
+ /*
+ Wine Code from wine cvs 27/7-2006
+ with small changes to fith into our ddraw desgin
+ */
+
+ if(cb == NULL)
+ {
+ return DDERR_INVALIDPARAMS;
+ }
+
+ for (surf = (IDirectDrawSurfaceImpl*)This->Surf->next_complex; surf != NULL; surf
= (IDirectDrawSurfaceImpl*)surf->Surf->next_complex)
+ {
+ Main_DDrawSurface_AddRef((LPDIRECTDRAWSURFACE7)surf);
+ desc = surf->Surf->mddsdPrimary;
+ /* check: != DDENUMRET_OK or == DDENUMRET_CANCEL? */
+ if (cb((LPDIRECTDRAWSURFACE7)surf, &desc, context) == DDENUMRET_CANCEL)
+ {
+ return DD_OK;
+ }
+ }
+
+ for (surf = (IDirectDrawSurfaceImpl*)This->Surf->next_attached; surf != NULL; surf
= (IDirectDrawSurfaceImpl*)surf->Surf->next_attached)
+ {
+ Main_DDrawSurface_AddRef((LPDIRECTDRAWSURFACE7)surf);
+ desc = surf->Surf->mddsdPrimary;
+ /* check: != DDENUMRET_OK or == DDENUMRET_CANCEL? */
+ if (cb((LPDIRECTDRAWSURFACE7)surf, &desc, context) == DDENUMRET_CANCEL)
+ {
+ return DD_OK;
+ }
+ }
+
+ return DD_OK;
}
HRESULT WINAPI