From 565a5715468fa990cf9e7cbfe38ac59ddcde1e76 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B3zef=20Kucia?= Date: Fri, 11 Mar 2016 13:28:03 +0100 Subject: [PATCH] wined3d: Limit amount of video memory for older Windows versions. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This should affect only 32-bit applications when the emulated Windows version is set to "Windows 2003" or older. Signed-off-by: Józef Kucia Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/wined3d/directx.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 60fb5ac03ff..1aea568f87a 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1510,6 +1510,18 @@ static void init_driver_info(struct wined3d_driver_info *driver_info, driver = DRIVER_UNKNOWN; } + /** + * Diablo 2 crashes when the amount of video memory is greater than 0x7fffffff. + * In order to avoid this application bug we limit the amount of video memory + * to LONG_MAX for older Windows versions. + */ + if (os_version.dwMajorVersion <= 5 && os_version.dwMinorVersion <= 2 + && driver_info->vram_bytes > LONG_MAX) + { + TRACE("Limiting amount of video memory to %#lx bytes for OS version older than Vista.\n", LONG_MAX); + driver_info->vram_bytes = LONG_MAX; + } + if (wined3d_settings.emulated_textureram) { TRACE("Overriding amount of video memory with 0x%s bytes.\n", -- 2.11.4.GIT