mirror of
https://github.com/reactos/reactos.git
synced 2025-07-30 22:12:05 +00:00
Fix some crach in ddraw.dll startup process for surface, we still got crach and surface are being setup wrong. working on this.
svn path=/trunk/; revision=18908
This commit is contained in:
parent
2995749811
commit
36704a0989
3 changed files with 17 additions and 10 deletions
|
@ -13,7 +13,8 @@
|
|||
HRESULT Hal_DDrawSurface_Blt(LPDIRECTDRAWSURFACE7 iface, LPRECT rDest,
|
||||
LPDIRECTDRAWSURFACE7 src, LPRECT rSrc, DWORD dwFlags, LPDDBLTFX lpbltfx)
|
||||
{
|
||||
IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
|
||||
|
||||
IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
|
||||
IDirectDrawSurfaceImpl* That = (IDirectDrawSurfaceImpl*)src;
|
||||
|
||||
if (!(This->owner->DirectDrawGlobal.lpDDCBtmp->HALDDSurface.dwFlags & DDHAL_SURFCB32_BLT))
|
||||
|
|
|
@ -38,7 +38,8 @@ HRESULT WINAPI Main_DirectDraw_Initialize (LPDIRECTDRAW7 iface, LPGUID lpGUID)
|
|||
// ... then overwrite with hal
|
||||
if((ret = Hel_DirectDraw_Initialize (iface)) != DD_OK)
|
||||
return ret;
|
||||
|
||||
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
|
@ -165,22 +166,30 @@ HRESULT WINAPI Main_DirectDraw_CreateSurface (LPDIRECTDRAW7 iface, LPDDSURFACEDE
|
|||
return DDERR_UNSUPPORTED;
|
||||
|
||||
// the nasty com stuff
|
||||
IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
|
||||
|
||||
IDirectDrawSurfaceImpl* That;
|
||||
|
||||
That = (IDirectDrawSurfaceImpl*)HeapAlloc(GetProcessHeap(), 0, sizeof(IDirectDrawSurfaceImpl));
|
||||
|
||||
|
||||
if (That == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
ZeroMemory(That, sizeof(IDirectDrawSurfaceImpl));
|
||||
|
||||
|
||||
That->lpVtbl = &DirectDrawSurface7_Vtable;
|
||||
That->lpVtbl_v3 = &DDRAW_IDDS3_Thunk_VTable;
|
||||
|
||||
|
||||
This->DirectDrawGlobal.dsList = (LPDDRAWI_DDRAWSURFACE_INT)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
|
||||
sizeof(DDRAWI_DDRAWSURFACE_INT));
|
||||
|
||||
That->owner = (IDirectDrawImpl *)This;
|
||||
|
||||
That->owner->DirectDrawGlobal.dsList->dwIntRefCnt =1;
|
||||
|
||||
/* we alwasy set to use the DirectDrawSurface7_Vtable as internel */
|
||||
That->owner->DirectDrawGlobal.dsList->lpVtbl = (PVOID) &DirectDrawSurface7_Vtable;
|
||||
|
||||
|
||||
*ppSurf = (LPDIRECTDRAWSURFACE7)That;
|
||||
|
||||
|
|
|
@ -14,17 +14,14 @@
|
|||
HRESULT WINAPI Main_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAW pDD, LPDDSURFACEDESC2 pDDSD)
|
||||
{
|
||||
IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
|
||||
|
||||
if (This->owner)
|
||||
return DDERR_ALREADYINITIALIZED;
|
||||
|
||||
|
||||
if(sizeof(DDSURFACEDESC2) != pDDSD->dwSize)
|
||||
return DDERR_UNSUPPORTED;
|
||||
|
||||
if(!(pDDSD->dwFlags & DDSD_CAPS))
|
||||
return DDERR_INVALIDPARAMS;
|
||||
|
||||
This->owner = (IDirectDrawImpl*)pDD;
|
||||
This->owner = (IDirectDrawImpl*)pDD;
|
||||
|
||||
if (This->owner->DirectDrawGlobal.lpDDCBtmp->HALDD.dwFlags & DDHAL_CB32_CANCREATESURFACE)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue