- Some formatting fixes

- Some checks and fixed return values

svn path=/trunk/; revision=27224
This commit is contained in:
Maarten Bosma 2007-06-18 14:58:44 +00:00
parent 93e0ad758f
commit 0e95f8362e
2 changed files with 71 additions and 59 deletions

View file

@ -489,7 +489,7 @@ Main_DirectDraw_CreateSurface (LPDIRECTDRAW iface, LPDDSURFACEDESC pDDSD,
} }
_SEH_HANDLE _SEH_HANDLE
{ {
ret = DDERR_GENERIC; ret = DDERR_INVALIDPARAMS;
} }
_SEH_END; _SEH_END;
// LeaveCriticalSection(&ddcs); // LeaveCriticalSection(&ddcs);
@ -511,7 +511,7 @@ Main_DirectDraw_CreateSurface4(LPDIRECTDRAW7 iface, LPDDSURFACEDESC2 pDDSD,
} }
_SEH_HANDLE _SEH_HANDLE
{ {
ret = DDERR_GENERIC; ret = DDERR_INVALIDPARAMS;
} }
_SEH_END; _SEH_END;
@ -519,8 +519,6 @@ Main_DirectDraw_CreateSurface4(LPDIRECTDRAW7 iface, LPDDSURFACEDESC2 pDDSD,
return ret; return ret;
} }
/* 5 of 31 DirectDraw7_Vtable api are working simluare to windows */ /* 5 of 31 DirectDraw7_Vtable api are working simluare to windows */
/* 8 of 31 DirectDraw7_Vtable api are under devloping / testing */ /* 8 of 31 DirectDraw7_Vtable api are under devloping / testing */

View file

@ -41,8 +41,33 @@ Internal_CreateSurface( LPDDRAWI_DIRECTDRAW_INT pDDraw, LPDDSURFACEDESC2 pDDSD,
DWORD num_of_surf=1; DWORD num_of_surf=1;
DWORD count; DWORD count;
/* Fixme adding vaidlate of income param */ /* Fixme adding vaidlate of income param */
if(pDDraw->lpLcl->dwLocalFlags == 0x20000)
{
return DDERR_NOCOOPERATIVELEVELSET;
}
if(pUnkOuter)
{
return CLASS_E_NOAGGREGATION;
}
if(!pDDSD->dwFlags & DDSD_CAPS)
{
return DDERR_INVALIDPARAMS;
}
if(!(pDDSD->dwFlags & DDSD_HEIGHT) && !(pDDSD->dwFlags & DDSD_HEIGHT)
&& !(pDDSD->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE))
{
return DDERR_INVALIDPARAMS;
}
else if(pDDSD->dwFlags & DDSD_HEIGHT && pDDSD->dwFlags & DDSD_HEIGHT
&& pDDSD->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
{
return DDERR_INVALIDPARAMS;
}
/* FIXME count our how many surface we need */ /* FIXME count our how many surface we need */
@ -75,9 +100,6 @@ Internal_CreateSurface( LPDDRAWI_DIRECTDRAW_INT pDDraw, LPDDSURFACEDESC2 pDDSD,
return DDERR_OUTOFMEMORY; return DDERR_OUTOFMEMORY;
} }
for( count=0; count < num_of_surf; count++ ) for( count=0; count < num_of_surf; count++ )
{ {
/* Alloc the surface interface and need members */ /* Alloc the surface interface and need members */
@ -156,14 +178,10 @@ Internal_CreateSurface( LPDDRAWI_DIRECTDRAW_INT pDDraw, LPDDSURFACEDESC2 pDDSD,
ThisSurfLcl->dwProcessId = GetCurrentProcessId(); ThisSurfLcl->dwProcessId = GetCurrentProcessId();
/* FIXME the lpLnk */ /* FIXME the lpLnk */
/* FIXME the ref counter */ /* FIXME the ref counter */
} }
/* Fixme call on DdCanCreate then on DdCreateSurface createsurface data here */ /* Fixme call on DdCanCreate then on DdCreateSurface createsurface data here */
/* FIXME bIsDifferentPixelFormat being set to true or false with automatic detcitons */ /* FIXME bIsDifferentPixelFormat being set to true or false with automatic detcitons */
@ -398,7 +416,6 @@ CreateOverlaySurface(LPDDRAWI_DIRECTDRAW_INT This,
LPDDRAWI_DDRAWSURFACE_INT *That, LPDDRAWI_DDRAWSURFACE_INT *That,
LPDDSURFACEDESC2 pDDSD) LPDDSURFACEDESC2 pDDSD)
{ {
DDSURFACEDESC mddsdOverlay; DDSURFACEDESC mddsdOverlay;
DDRAWI_DDRAWSURFACE_GBL mOverlayGlobal; DDRAWI_DDRAWSURFACE_GBL mOverlayGlobal;
DDRAWI_DDRAWSURFACE_LCL mOverlayLocal[6]; DDRAWI_DDRAWSURFACE_LCL mOverlayLocal[6];
@ -540,9 +557,6 @@ CreateOverlaySurface(LPDDRAWI_DIRECTDRAW_INT This,
mDdUpdateOverlay.rSrc.right = 50; mDdUpdateOverlay.rSrc.right = 50;
mDdUpdateOverlay.rSrc.bottom = 50; mDdUpdateOverlay.rSrc.bottom = 50;
if ( mDdUpdateOverlay.UpdateOverlay(&mDdUpdateOverlay) == DDHAL_DRIVER_NOTHANDLED) if ( mDdUpdateOverlay.UpdateOverlay(&mDdUpdateOverlay) == DDHAL_DRIVER_NOTHANDLED)
{ {
DX_STUB_str("UpdateOverlay fail"); DX_STUB_str("UpdateOverlay fail");