From 8b676541fe5173e821aa506eafb96711e6e7f6f6 Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sun, 30 Oct 2005 08:10:43 +0000 Subject: [PATCH] Fix one crach in createsurface for DrFred svn path=/trunk/; revision=18870 --- reactos/lib/ddraw/hal/ddraw.c | 2 -- reactos/lib/ddraw/main/surface.c | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/reactos/lib/ddraw/hal/ddraw.c b/reactos/lib/ddraw/hal/ddraw.c index 87f33a2dc04..bf4f2a61940 100644 --- a/reactos/lib/ddraw/hal/ddraw.c +++ b/reactos/lib/ddraw/hal/ddraw.c @@ -409,6 +409,4 @@ HRESULT Hal_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,H } return WaitVectorData.ddRVal; - - return DD_OK; } diff --git a/reactos/lib/ddraw/main/surface.c b/reactos/lib/ddraw/main/surface.c index 452bb79c056..fb758c0129b 100644 --- a/reactos/lib/ddraw/main/surface.c +++ b/reactos/lib/ddraw/main/surface.c @@ -31,14 +31,15 @@ HRESULT WINAPI Main_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIREC memset(&CanCreateData, 0, sizeof(DDHAL_CANCREATESURFACEDATA)); CanCreateData.lpDD = &This->owner->DirectDrawGlobal; CanCreateData.lpDDSurfaceDesc = (DDSURFACEDESC*)pDDSD; - CanCreateData.CanCreateSurface = This->owner->HalInfo.lpDDCallbacks->CanCreateSurface; - - if (CanCreateData.CanCreateSurface(&CanCreateData) == DDHAL_DRIVER_NOTHANDLED) + + if (This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.CanCreateSurface(&CanCreateData) == DDHAL_DRIVER_NOTHANDLED) return DDERR_INVALIDPARAMS; if(CanCreateData.ddRVal != DD_OK) return CanCreateData.ddRVal; + /* down here we got a crach */ + /* surface global struct */ DDRAWI_DDRAWSURFACE_GBL Global; memset(&Global, 0, sizeof(DDRAWI_DDRAWSURFACE_GBL)); @@ -77,8 +78,7 @@ HRESULT WINAPI Main_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIREC CreateData.lpDD = &This->owner->DirectDrawGlobal; CreateData.lpDDSurfaceDesc = (DDSURFACEDESC*)pDDSD; CreateData.dwSCnt = 1; - CreateData.lplpSList = pLocal; - CreateData.CreateSurface = This->owner->HalInfo.lpDDCallbacks->CreateSurface; + CreateData.lplpSList = pLocal; /* this is the call we were waiting for */ if(CreateData.CreateSurface(&CreateData) == DDHAL_DRIVER_NOTHANDLED)