[PATCH v2 2/2] wbemprox: Report 4095MiB video memory if it overflows.

Rémi Bernon rbernon at codeweavers.com
Wed Sep 30 03:16:04 CDT 2020


That's what Windows do apparently. Anything with more than 4GiB of VRAM
would report less otherwise, confusing the VRAM detection in some games.

The Mafia III launcher is trying to open a warning popup with a 8GiB
VRAM GPU for instance, as the reported value overflows to 0.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/wbemprox/builtin.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/dlls/wbemprox/builtin.c b/dlls/wbemprox/builtin.c
index 43268221936..8daa55eaeb4 100644
--- a/dlls/wbemprox/builtin.c
+++ b/dlls/wbemprox/builtin.c
@@ -3878,8 +3878,9 @@ static enum fill_status fill_videocontroller( struct table *table, const struct
     hr = IDXGIAdapter_GetDesc( adapter, &desc );
     if (SUCCEEDED(hr))
     {
-        vidmem = desc.DedicatedVideoMemory;
-        name   = desc.Description;
+        if (desc.DedicatedVideoMemory > UINT_MAX) vidmem = 0xfff00000;
+        else vidmem = desc.DedicatedVideoMemory;
+        name = desc.Description;
     }
 
 done:
-- 
2.28.0




More information about the wine-devel mailing list