Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
339 views
in Technique[技术] by (71.8m points)

compatibility - Windows: How to create custom appcompat shims (Application Fixes)?

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:

  • change the incoming paramters
  • lie about the return values
  • change it to call something else

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:

alt text

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...