diff --git a/dlls/ddraw/ddraw/dga2.c b/dlls/ddraw/ddraw/dga2.c index 4ee83b7883e..f5adca4ccea 100644 --- a/dlls/ddraw/ddraw/dga2.c +++ b/dlls/ddraw/ddraw/dga2.c @@ -35,8 +35,8 @@ static ICOM_VTABLE(IDirectDraw7) XF86DGA2_DirectDraw_VTable; static const DDDEVICEIDENTIFIER2 xf86dga2_device = { + "display", "XF86DGA2 Driver", - "WINE DirectDraw on XF86DGA2", { { 0x00010001, 0x00010001 } }, 0, 0, 0, 0, /* e2dcb020-dc60-11d1-8407-9714f5d50803 */ diff --git a/dlls/ddraw/ddraw/user.c b/dlls/ddraw/ddraw/user.c index 3032b636c31..35f9f56128a 100644 --- a/dlls/ddraw/ddraw/user.c +++ b/dlls/ddraw/ddraw/user.c @@ -25,8 +25,8 @@ static ICOM_VTABLE(IDirectDraw7) User_DirectDraw_VTable; static const DDDEVICEIDENTIFIER2 user_device = { - "User Driver", - "WINE DirectDraw on User (and GDI)", + "display", + "User (and GDI)", { { 0x00010001, 0x00010001 } }, 0, 0, 0, 0, /* fe38440c-8969-4283-bc73-749e7bc3c2eb */ diff --git a/dlls/ddraw/ddraw/xvidmode.c b/dlls/ddraw/ddraw/xvidmode.c index 910c71afa45..2e6141704ef 100644 --- a/dlls/ddraw/ddraw/xvidmode.c +++ b/dlls/ddraw/ddraw/xvidmode.c @@ -36,8 +36,8 @@ static ICOM_VTABLE(IDirectDraw7) XVidMode_DirectDraw_VTable; static const DDDEVICEIDENTIFIER2 xvidmode_device = { - "User/XF86VidMode Driver", - "WINE DirectDraw on User with XF86VidMode", + "display", + "XF86VidMode", { { 0x00010001, 0x00010001 } }, 0, 0, 0, 0, /* 40c1b248-9d7d-4a29-b7d7-4cd8109f3d5d */ diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index 412a5c23e2f..6bb896ff6fb 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -19,6 +19,13 @@ (x)->dwSize = sizeof(*x); \ } while (0) +#define DD_STRUCT_COPY_BYSIZE(to,from) \ + do { \ + DWORD __size = to->dwSize; \ + memcpy(to,from,__size); \ + to->dwSize = __size;/*restore size*/ \ + } while (0) + /***************************************************************************** * IDirectDraw implementation structure */ diff --git a/dlls/ddraw/dsurface/main.c b/dlls/ddraw/dsurface/main.c index 1901679a90e..eba0c93eb7b 100644 --- a/dlls/ddraw/dsurface/main.c +++ b/dlls/ddraw/dsurface/main.c @@ -739,7 +739,13 @@ Main_DirectDrawSurface_GetSurfaceDesc(LPDIRECTDRAWSURFACE7 iface, ICOM_THIS(IDirectDrawSurfaceImpl, iface); TRACE("(%p)->(%p)\n",This,pDDSD); - *pDDSD = This->surface_desc; + if ((pDDSD->dwSize < sizeof(DDSURFACEDESC)) || + (pDDSD->dwSize > sizeof(DDSURFACEDESC2))) { + ERR("Impossible/Strange struct size %ld.\n",pDDSD->dwSize); + return DDERR_GENERIC; + } + + DD_STRUCT_COPY_BYSIZE(pDDSD,&This->surface_desc); return DD_OK; }