Do not create a surface from wrong process.
authorMagnus Olsen <magnus@greatlord.com>
Sat, 15 Dec 2007 20:53:33 +0000 (20:53 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Sat, 15 Dec 2007 20:53:33 +0000 (20:53 +0000)
if we found it was another process try call on createsurface that have started ddraw it will fail.

svn path=/trunk/; revision=31258

reactos/dll/directx/ddraw/Surface/createsurface.c

index 950af45..7743031 100644 (file)
@@ -54,6 +54,10 @@ Internal_CreateSurface( LPDDRAWI_DIRECTDRAW_INT pDDraw, LPDDSURFACEDESC2 pDDSD,
     {
         return DDERR_INVALIDPARAMS;
     }
+    if (pDDraw->lpLcl->dwProcessId != GetCurrentProcessId() )
+    {
+        return DDERR_INVALIDOBJECT;
+    }
 
     if(!(pDDSD->dwFlags & DDSD_HEIGHT) && !(pDDSD->dwFlags & DDSD_HEIGHT)
         && !(pDDSD->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE))