Windows has the capability to apply shims to mis-behaving applications. Shims are used to intercept API calls and change it. For example, shims can be used to:
The Application Compatibility Tookit has quite a few existing shims you can apply to your own mis-behaving application. Here's an example of one that ignores your API call and instead calls a completely different API instead:
i need a shim that isn't one of the hundreds of shims Microsoft already wrote. i need a custom shim.
In my case i want to intercept calls to:
GetSystemMetrics(0x1000)
so that it returns 0
. i can't find any information on how to give Windows my own DLL that will have the fix i need. i don't even know if you can create custom shims.
Does Windows support custom shims?
Application shimming is a Windows Application Compatibility framework that Windows created to allow programs to run on versions of the OS that they were not initially created to run on. Most applications that used to run on Windows XP can today run on Windows 10 due to this framework.
In computer programming, a shim is a small library which transparently intercepts an API, changes the parameters passed, handles the operation itself, or redirects the operation elsewhere. Shims can also be used for running programs on different software platforms than they were developed for.
I'm not aware of any way of someone other than Microsoft implementing an appcompat shim.
You might want to investigate Detours, it might provide the functionality you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With