Skip to content

Commit

Permalink
Blacklist openxr_load.dll while SK is injected into games
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaldaien committed Apr 15, 2024
1 parent 20592ed commit 04344ba
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,5 @@ paket-files/
unity_*.cpp
opengl_stateblock.cpp
/StructLayoutSettings.json
/resource/textures/Gamepads/PS5 Button Icons and Controls/Buttons Full Solid/Black/128w/Circle.png
*.png
10 changes: 9 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
24.4.14
24.4.15
=======
+ Removed ImGui nav focus on plot widgets (i.e. Framepacing Graph) when using
keyboard or gamepad in the control panel
+ Condensed Frametime calculation selection in advanced Framerate Limiter view
+ Blacklist openxr_load.dll while SK is injected into games, because it will
deadlock when the game exits. It's optional and for VR, so not a big deal.

24.4.14
=======
+ Fixed incorrect battery level for DualShock 4 Bluetooth controllers
+ Added support for binding DualShock 4 trackpad click to keyboard input
Expand Down
11 changes: 7 additions & 4 deletions SpecialK.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ if exist "$(TargetDir)$(TargetName).exp" ( del "$(TargetDir)$(TargetName).exp" )
<Profile>false</Profile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<EnableCOMDATFolding>false</EnableCOMDATFolding>
<DataExecutionPrevention>true</DataExecutionPrevention>
<AdditionalOptions>/GUARD:NO /IGNORE:4099,4286 %(AdditionalOptions)</AdditionalOptions>
<LinkErrorReporting>NoErrorReport</LinkErrorReporting>
Expand All @@ -458,7 +458,7 @@ if exist "$(TargetDir)$(TargetName).exp" ( del "$(TargetDir)$(TargetName).exp" )
<CETCompat>false</CETCompat>
<SectionAlignment>
</SectionAlignment>
<ShowProgress>LinkVerboseSAFESEH</ShowProgress>
<ShowProgress>NotSet</ShowProgress>
<StackReserveSize>0x200000</StackReserveSize>
<StackCommitSize>0x4000</StackCommitSize>
<CreateHotPatchableImage>ItaniumImage</CreateHotPatchableImage>
Expand Down Expand Up @@ -497,6 +497,9 @@ if exist "$(TargetDir)$(TargetName).exp" ( del "$(TargetDir)$(TargetName).exp" )
<Xdcmake>
<DocumentLibraryDependencies>false</DocumentLibraryDependencies>
</Xdcmake>
<ResourceCompile>
<NullTerminateStrings>true</NullTerminateStrings>
</ResourceCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
Expand Down Expand Up @@ -573,7 +576,7 @@ if exist "$(TargetDir)$(TargetName).exp" ( del "$(TargetDir)$(TargetName).exp" )
<Profile>false</Profile>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<EnableCOMDATFolding>false</EnableCOMDATFolding>
<DataExecutionPrevention>true</DataExecutionPrevention>
<AdditionalOptions>/GUARD:NO /IGNORE:4099,4286 %(AdditionalOptions)</AdditionalOptions>
<LinkErrorReporting>NoErrorReport</LinkErrorReporting>
Expand All @@ -583,7 +586,7 @@ if exist "$(TargetDir)$(TargetName).exp" ( del "$(TargetDir)$(TargetName).exp" )
<CETCompat>false</CETCompat>
<SectionAlignment>
</SectionAlignment>
<ShowProgress>LinkVerboseSAFESEH</ShowProgress>
<ShowProgress>NotSet</ShowProgress>
<StackReserveSize>0x200000</StackReserveSize>
<StackCommitSize>0x4000</StackCommitSize>
<CreateHotPatchableImage>ItaniumImage</CreateHotPatchableImage>
Expand Down
2 changes: 1 addition & 1 deletion include/SpecialK/DLL_VERSION.H
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#define SK_YEAR 24
#define SK_MONTH 4
#define SK_DATE 14
#define SK_DATE 15
#define SK_REV_N 0
#define SK_REV 0

Expand Down
2 changes: 1 addition & 1 deletion src/diagnostics/debug_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4865,7 +4865,7 @@ SK_Win32_FormatMessageForException (
if (lpMsgBuf != nullptr)
{
va_list args = nullptr;
va_start (args, lpMsgFormat);
va_start (args, nExceptionCode);
vswprintf_s (lpMsgBuf, 4096, lpMsgFormat, args);
va_end (args);

Expand Down
9 changes: 9 additions & 0 deletions src/diagnostics/load_library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,7 @@ LoadLibrary_Marshal ( LPVOID lpRet,
if (hModEarly == nullptr && BlacklistLibrary (compliant_path))
{
SK_UnlockDllLoader ();
SK_SetLastError (ERROR_MOD_NOT_FOUND);
return nullptr;
}

Expand Down Expand Up @@ -2416,6 +2417,14 @@ BlacklistLibrary (const _T* lpFileName)
}
}

if (StrStrI (lpFileName, SK_TEXT("openxr_loader.dll")))
{
SK_LOGs0 ( L"DLL Loader",
L"OpenXR DLL Blocked to Prevent Deadlock at Shutdown" );

return TRUE;
}

return FALSE;

#pragma pop_macro ("StrStrI")
Expand Down

0 comments on commit 04344ba

Please sign in to comment.