limit resolutions in EnumDisplayModes to prevent crashes
This commit is contained in:
parent
478d716a26
commit
90a31e1daf
2 changed files with 54 additions and 6 deletions
|
@ -451,10 +451,24 @@ HRESULT __stdcall ddraw_surface_GetPalette(IDirectDrawSurfaceImpl *This, LPDIREC
|
|||
return DD_OK;
|
||||
}
|
||||
|
||||
HRESULT __stdcall ddraw_surface_GetPixelFormat(IDirectDrawSurfaceImpl *This, LPDDPIXELFORMAT a)
|
||||
HRESULT __stdcall ddraw_surface_GetPixelFormat(IDirectDrawSurfaceImpl *This, LPDDPIXELFORMAT ddpfPixelFormat)
|
||||
{
|
||||
printf("IDirectDrawSurface::GetPixelFormat(This=%p, ...) ???\n", This);
|
||||
return DD_OK;
|
||||
printf("IDirectDrawSurface::GetPixelFormat(This=%p, ...)\n", This);
|
||||
|
||||
DWORD size = ddpfPixelFormat->dwSize;
|
||||
|
||||
if (size == sizeof(DDPIXELFORMAT))
|
||||
{
|
||||
memset(ddpfPixelFormat, 0, sizeof(DDPIXELFORMAT));
|
||||
|
||||
ddpfPixelFormat->dwSize = size;
|
||||
ddpfPixelFormat->dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB;
|
||||
ddpfPixelFormat->dwRGBBitCount = 8;
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
return DDERR_INVALIDPARAMS;
|
||||
}
|
||||
|
||||
HRESULT __stdcall ddraw_surface_Initialize(IDirectDrawSurfaceImpl *This, LPDIRECTDRAW a, LPDDSURFACEDESC b)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue