diff --git a/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c b/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c index 7b5807851bb..2b764cadc77 100644 --- a/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c +++ b/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c @@ -130,11 +130,14 @@ HRESULT WINAPI Main_DirectDraw_CreateSurface (LPDIRECTDRAW7 iface, LPDDSURFACEDE DX_WINDBG_trace(); - if (pUnkOuter) - return DDERR_GENERIC; - /* FIXME vaildate input pointers or warp everthing with SEH */ + if (pUnkOuter) + { + /* FIXME send back right return code */ + return DDERR_GENERIC; + } + EnterCriticalSection(&ddcs); ret = DDERR_GENERIC; @@ -164,13 +167,21 @@ HRESULT WINAPI Main_DirectDraw_CreateSurface (LPDIRECTDRAW7 iface, LPDDSURFACEDE return DDERR_INVALIDPARAMS; } - /* FIXME add one gbl check with one pDDSD check */ - ret = Internal_CreateSurface(dd_int,ppSurf,&dd_desc_v2); + /* check if this process belong to this ddraw */ + if ( dd_int->lcl->dwProcessId != GetCurrentProcessId() ) + { + /* FIXME send back right return code */ + return DDERR_GENERIC; + } + + ret = internal_CreateSurface(dd_int,dd_desc_v2,ppSurf,pUnkOuter); LeaveCriticalSection(&ddcs); return ret; } + + IDirectDraw7Vtbl DirectDraw7_Vtable = { Main_DirectDraw_QueryInterface, diff --git a/reactos/dll/directx/ddraw/Surface/createsurface.c b/reactos/dll/directx/ddraw/Surface/createsurface.c index 71f8a3a83d1..f8322edd661 100644 --- a/reactos/dll/directx/ddraw/Surface/createsurface.c +++ b/reactos/dll/directx/ddraw/Surface/createsurface.c @@ -21,6 +21,7 @@ void CopyDDSurfDescToDDSurfDesc2(LPDDSURFACEDESC2 dst_pDesc, LPDDSURFACEDESC src { RtlZeroMemory(dst_pDesc,sizeof(DDSURFACEDESC2)); RtlCopyMemory(dst_pDesc,src_pDesc,sizeof(DDSURFACEDESC)); + dst_pDesc->dwSize = sizeof(DDSURFACEDESC2); }