Author: greatlrd Date: Sun Mar 2 17:28:54 2008 New Revision: 32543
URL: http://svn.reactos.org/svn/reactos?rev=3D32543&view=3Drev Log: started adding support for more that one surface in DdCreateSurface
Modified: trunk/reactos/dll/win32/gdi32/misc/gdientry.c
Modified: trunk/reactos/dll/win32/gdi32/misc/gdientry.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/= gdientry.c?rev=3D32543&r1=3D32542&r2=3D32543&view=3Ddiff =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- trunk/reactos/dll/win32/gdi32/misc/gdientry.c (original) +++ trunk/reactos/dll/win32/gdi32/misc/gdientry.c Sun Mar 2 17:28:54 2008 @@ -274,6 +274,10 @@ (PDD_CANCREATESURFACEDATA)CanCreateSurf= ace); } =
+ + + + /* TODO : finish all fixme */ =
DWORD WINAPI @@ -286,7 +290,6 @@ DD_SURFACE_GLOBAL DdSurfaceGlobal; =
HANDLE hPrevSurface, hSurface; - =
PDD_SURFACE_LOCAL pDdSurfaceLocal =3D NULL; PDD_SURFACE_MORE pDdSurfaceMore =3D NULL; @@ -302,8 +305,40 @@ /* Check how many surfaces there are */ if (SurfaceCount !=3D 1) { - /* We'll have to allocate more data, our stack isn't big enough */ - + /* We got more that one surface so we need alloc memory for them */ + pDdSurfaceLocal =3D (PDD_SURFACE_LOCAL) HeapAlloc(GetProcessHeap()= , HEAP_ZERO_MEMORY, (sizeof(DD_SURFACE_LOCAL) * SurfaceCount )); + pDdSurfaceMore =3D (PDD_SURFACE_MORE) HeapAlloc(GetProcessHeap(), = HEAP_ZERO_MEMORY, (sizeof(DD_SURFACE_MORE) * SurfaceCount )); + pDdSurfaceGlobal =3D (PDD_SURFACE_GLOBAL) HeapAlloc(GetProcessHea= p(), HEAP_ZERO_MEMORY, (sizeof(DD_SURFACE_GLOBAL) * SurfaceCount )); + phSurface =3D HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (sizeo= f(HANDLE) * SurfaceCount )); + puhSurface =3D HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (size= of(HANDLE) * SurfaceCount )); + + /* check if we sueese alloc all memory we need */ + if ((pDdSurfaceLocal =3D=3D NULL) || (pDdSurfaceMore =3D=3D NULL) = || (pDdSurfaceGlobal =3D=3D NULL) || (phSurface =3D=3D NULL) || (puhSurface= =3D=3D NULL)) + { + pCreateSurface->ddRVal =3D DDERR_OUTOFMEMORY; + + if ( pDdSurfaceLocal !=3D NULL ) + { + HeapFree(GetProcessHeap(), 0, pDdSurfaceLocal); + } + + if ( pDdSurfaceMore !=3D NULL ) + { + HeapFree(GetProcessHeap(), 0, pDdSurfaceMore); + } + + if ( phSurface !=3D NULL ) + { + HeapFree(GetProcessHeap(), 0, phSurface); + } + + if ( puhSurface !=3D NULL ) + { + HeapFree(GetProcessHeap(), 0, puhSurface); + } + + return DDHAL_DRIVER_HANDLED; + } } else { @@ -455,7 +490,25 @@ /* Check if we have to free all our local allocations */ if (SurfaceCount > 1) { - /* FIXME: */ + if ( pDdSurfaceLocal !=3D NULL ) + { + HeapFree(GetProcessHeap(), 0, pDdSurfaceLocal); + } + + if ( pDdSurfaceMore !=3D NULL ) + { + HeapFree(GetProcessHeap(), 0, pDdSurfaceMore); + } + + if ( phSurface !=3D NULL ) + { + HeapFree(GetProcessHeap(), 0, phSurface); + } + + if ( puhSurface !=3D NULL ) + { + HeapFree(GetProcessHeap(), 0, puhSurface); + } } =
/* Return */ @@ -1094,9 +1147,7 @@ * ReactOS keep this behoir to be compatible with * Windows XP */ - pData->ddRVal =3D retValue; - =
- + pData->ddRVal =3D retValue; =
} =
/* D3D Callbacks version 2 check and setup for DirectX/ ReactX */