Fix one crach in createsurface for DrFred
authorMagnus Olsen <magnus@greatlord.com>
Sun, 30 Oct 2005 08:10:43 +0000 (08:10 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Sun, 30 Oct 2005 08:10:43 +0000 (08:10 +0000)
svn path=/trunk/; revision=18870

reactos/lib/ddraw/hal/ddraw.c
reactos/lib/ddraw/main/surface.c

index 87f33a2..bf4f2a6 100644 (file)
@@ -409,6 +409,4 @@ HRESULT Hal_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,H
        }
 
        return WaitVectorData.ddRVal;
-
-       return DD_OK;
 }
index 452bb79..fb758c0 100644 (file)
@@ -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)