Repository navigation
RFC: Handling passive Vulkan/DirectShow DLL locks in init-hook-files.c #14104
Unanswered
tonicofonico
asked this question in
Development Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
When a background process initializes Vulkan (e.g.,
RadeonSoftware.exe/AMDRSServ.exeloadingobs-vulkan64.jsonas an implicit layer),graphics-hook64.dllstays mapped in memory withFILE_SHARE_READ | FILE_SHARE_DELETE. On the next OBS launch after an update,CopyFileWinfrontend/updater/init-hook-files.cfails withERROR_SHARING_VIOLATION(32) and leaves the stale hook in%PROGRAMDATA%\obs-studio-hook\.Because
init-hook-files.cnormally runs non-elevated (just like its best-effortHKLMchecks),MOVEFILE_DELAY_UNTIL_REBOOTcannot be relied upon to clean up renamed files sincePendingFileRenameOperationsrequires administrator privileges. However, includingDELETEin theadd_aap_permsaccess mask allows standard non-elevated startups to both rename the locked DLL and clean up any previously unlocked.oldfile on subsequent launches:(Paired with
GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | DELETEinadd_aap_perms).Note that this only addresses the startup hook sync in
obs-studioand is separate from the NSIS pre-install check inobsproject/bouf(extra/nsis/mp-installer.nsireturning exit code 6 whenobs-virtualcam-module*.dllorgraphics-hook*.dllare mapped by external processes).Would a minimal PR with just this
init-hook-files.cchange be welcome, or are there any concerns where renaming an in-use hook DLL on startup could cause issues?All reactions