From a9d93d4d8e836bd882bfa2b89d0093e6b7d3d531 Mon Sep 17 00:00:00 2001 From: blattersturm Date: Sat, 5 Aug 2023 00:48:50 +0200 Subject: [PATCH] tweak(graphics/five): reshade 5.9+ check There's a lot of crashes with the following call stack (or similar): ntdll 0x7ff890a7c1f9 RtlReportFatalFailure (0x9:0) ntdll 0x7ff890a7c1c3 RtlReportCriticalFailure (0x97:0) ntdll 0x7ff890a8525a RtlpHeapHandleError (0x12:0) ntdll 0x7ff890a8553a RtlpHpHeapHandleError (0x7a:0) ntdll 0x7ff890a91535 RtlpLogHeapFailure (0x45:0) ntdll 0x7ff8909abebc RtlpFreeHeapInternal (0x84c:0) ntdll 0x7ff8909aab01 RtlFreeHeap (0x51:0) dxgi 0x7ff80be1d90d 0x7ff80be1d90d dxgi 0x7ff80bbf9cf9 0x7ff80bbf9cf9 dxgi 0x7ff80be5b308 0x7ff80be5b308 ntdll 0x7ff89099ab0b LdrpInitializeDllPath (0x27:0) These crashes all appear to have 'dxgi.dll' with version '5.9.0.1750', which matches ReShade 5.9. This is likely a regression in ReShade, but it's causing a lot of user confusion. --- code/components/rage-graphics-five/src/ReShadeFixups.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/components/rage-graphics-five/src/ReShadeFixups.cpp b/code/components/rage-graphics-five/src/ReShadeFixups.cpp index 15c0b46ee4..89f864156d 100644 --- a/code/components/rage-graphics-five/src/ReShadeFixups.cpp +++ b/code/components/rage-graphics-five/src/ReShadeFixups.cpp @@ -65,6 +65,12 @@ bool IsValidGraphicsLibrary(const std::wstring& path) { return false; } + // ReShade >= 5.9 causes heap corruption basically *all the time* so we hard-block it + else if (fixedInfo->dwProductVersionMS >= 0x50009) + { + console::Printf("script:reshade", "Blocked load of ReShade version 5.9 or higher, it causes crashes in RtlReportFatalFailure.\nDowngrade to 5.8 or below to be able to use ReShade, or report the issue to the ReShade authors.\n"); + return false; + } // as is ReShade v5+ because of an unknown crash (unless setting an override) else if (fixedInfo->dwProductVersionMS >= 0x50000) {