diff --git a/dlls/ddraw/ddraw/thunks.c b/dlls/ddraw/ddraw/thunks.c index 10296fa238a..9bb7a8ca407 100644 --- a/dlls/ddraw/ddraw/thunks.c +++ b/dlls/ddraw/ddraw/thunks.c @@ -326,9 +326,13 @@ struct displaymodescallback_context static HRESULT CALLBACK EnumDisplayModesCallbackThunk(LPDDSURFACEDESC2 pDDSD2, LPVOID context) { + DDSURFACEDESC DDSD; struct displaymodescallback_context *cbcontext = context; - return cbcontext->func((LPDDSURFACEDESC)pDDSD2, cbcontext->context); + memcpy(&DDSD,pDDSD2,sizeof DDSD); + DDSD.dwSize = sizeof DDSD; + + return cbcontext->func(&DDSD, cbcontext->context); } static HRESULT WINAPI diff --git a/include/ddraw.h b/include/ddraw.h index 29e7943c316..7ec10e6c207 100644 --- a/include/ddraw.h +++ b/include/ddraw.h @@ -979,7 +979,7 @@ typedef struct _DDSURFACEDESC typedef struct _DDSURFACEDESC2 { - DWORD dwSize; /* 0: size of the DDSURFACEDESC structure*/ + DWORD dwSize; /* 0: size of the DDSURFACEDESC2 structure*/ DWORD dwFlags; /* 4: determines what fields are valid*/ DWORD dwHeight; /* 8: height of surface to be created*/ DWORD dwWidth; /* C: width of input surface*/