Scenario
I have a plugin (dll) written for a Windows application (in C++).
That application works fine on Linux under Wine, however, in the plugin I would like to use a feature which is not yet available in Wine.
Assuming I can detect at runtime that the application is running in Wine, can I dynamically load native Linux library (or access native Linux API in any other way) in order to emulate said feature?
I am curious whether this can be done without any serious hacking.
Seems like someone has faced similar problem, or at least has predicted such situation. Wrapper-library should help you:
For one reason or another you may find yourself with a Linux library that you want to use as if it were a Windows DLL. There are various reasons for this including the following:
...
- You have a binary only Windows application that can be extended through plugins, such as a text editor or IDE.
In few words - you should create thin Wine builtin-dll, that acts like a bridge between ABI of your PE binary and ABI of native Linux Library. Then you should link your code against this wrapper. For Windows distribution you can provide "wrapper" with empty stubs. Such approach allows you to use one binary for your plugin, that will use wine-specific functional wrapper DLL on Linux and stub DLL on Windows.