From 2e9f55a2f0c0192c779e8472bb1d795171c24fdd Mon Sep 17 00:00:00 2001 From: narzoul Date: Sat, 17 Aug 2024 16:37:27 +0200 Subject: [PATCH] Added ForceD3D9On12=forceoff setting The default "off" setting no longer replaces D3D9On12 with igd9trinity32.dll. It was causing issues when used with older driver versions. Newer drivers use igd9trinity32.dll by default. --- DDrawCompat/Config/Settings/ForceD3D9On12.h | 8 +++++--- DDrawCompat/D3dDdi/KernelModeThunks.cpp | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/DDrawCompat/Config/Settings/ForceD3D9On12.h b/DDrawCompat/Config/Settings/ForceD3D9On12.h index f1db1c0..298539b 100644 --- a/DDrawCompat/Config/Settings/ForceD3D9On12.h +++ b/DDrawCompat/Config/Settings/ForceD3D9On12.h @@ -1,16 +1,18 @@ #pragma once -#include +#include namespace Config { namespace Settings { - class ForceD3D9On12 : public BoolSetting + class ForceD3D9On12 : public EnumSetting { public: + enum Values { FORCEOFF, OFF, ON }; + ForceD3D9On12() - : BoolSetting("ForceD3D9On12", "off") + : EnumSetting("ForceD3D9On12", "off", { "forceoff", "off", "on" }) { } }; diff --git a/DDrawCompat/D3dDdi/KernelModeThunks.cpp b/DDrawCompat/D3dDdi/KernelModeThunks.cpp index d1073b5..f59cb08 100644 --- a/DDrawCompat/D3dDdi/KernelModeThunks.cpp +++ b/DDrawCompat/D3dDdi/KernelModeThunks.cpp @@ -210,7 +210,7 @@ namespace switch (pData->Type) { case KMTQAITYPE_UMDRIVERNAME: - if (Config::forceD3D9On12.get() && + if (Config::Settings::ForceD3D9On12::ON == Config::forceD3D9On12.get() && KMTUMDVERSION_DX9 == static_cast(pData->pPrivateDriverData)->Version) { return STATUS_INVALID_PARAMETER; @@ -237,7 +237,7 @@ namespace } } } - else if (!Config::forceD3D9On12.get() && + else if (Config::Settings::ForceD3D9On12::FORCEOFF == Config::forceD3D9On12.get() && KMTQAITYPE_UMDRIVERNAME == pData->Type && KMTUMDVERSION_DX9 == static_cast(pData->pPrivateDriverData)->Version) {