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?
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.