difference between DLL wrapper and DLL [closed]

2019-06-27 17:19发布

I have no idea what is DLL wrapper. Could someone please explain me
1) what is DLL wrapper?
2) how it is different from DLL ?
3) how to use it?

Thanks and regards,

标签: c++ windows dll
2条回答
家丑人穷心不美
2楼-- · 2019-06-27 18:01

When a program uses a DLL, it goes like this:

  • Application loads foo.dll
  • Application calls function in foo.dll
  • foo.dll executes function and returns value to application

With a wrapper DLL, this would happen:

  • Application loads foo.dll (not knowing or caring that foo.dll is in fact the wrapper, and the original DLL has been renamed to foo_original.dll)
  • foo.dll loads foo_original.dll
  • Application calls function in foo.dll
  • foo.dll forwards the call to foo_original.dll
  • foo_original.dll executes function and returns value to foo.dll
  • foo.dll returns value to application

This gives the DLL wrapper an opportunity to inspect/log all calls made by the application to the original DLL, as well as a chance to modify data being passed between the two.

查看更多
Explosion°爆炸
3楼-- · 2019-06-27 18:19

DLL wrapper calls another dll to provide required functionality. It may or may not provide its special API for simplicity or compatibility reasons. This is a tutorial that shows how to make a wrapper DLL. In this specific tutorial some of the classes from DirectX 9 are wrapped and used to render a teapot inside the Blitz3D window.

查看更多
登录 后发表回答