Hacker News new | ask | show | jobs
by ack_complete 54 days ago
They've also used Detours within Windows itself. The auto super resolution (AutoSR) feature works by dxgi.dll detouring specific calls in user32.dll, in-process, to virtualize certain monitor metrics. I found this out because it was broken for a while on Windows 11 ARM64 when it couldn't handle PAC-enabled function prologs and enabling it would just crash programs by corrupting user32 functions.
1 comments

This has been a thing since the whole Windows MinWin project.

https://en.wikipedia.org/wiki/MinWin

https://techcommunity.microsoft.com/blog/windowsosplatform/o...

Detours like technology is used in API Sets, to redirect legacy DLLS into the new refactored ones.

https://learn.microsoft.com/en-us/windows/win32/apiindex/win...

No. API Sets use forwarding within the loader and are largely transparent to regular/delayed binding and GetProcAddress(). That would be fine. This is overwriting the prologue of the function in user32.dll similar to any other user-space hooking library.
Why would they need runtime patching instead of just replacing the legacy DLLs with ones that redirect to the new ones?
I was mistaken, the redirection workflow, takes another approach.

https://learn.microsoft.com/en-us/windows/win32/apiindex/api...