First steps to make Win32 app running under Wine
martin at hinner.info
Thu Mar 20 04:26:20 CDT 2008
I am solving problem how to get one Win32 app (for which I have
source code) running under Wine. The biggest issue is drivers and
ioctls. Linux has driver support for what we need and provides similar
ioctls for some stuff, but it differs from Windows.
The difference is *so big* that I would prefer to modify our source
code to use different pieces of code when it detects Wine. I
understand, that this is *against* Wine policy and generally should
not be used. But writing built-in replacement for some DLLs (hack
Linux-style drivers into Windows-style) would be a nightmare, so
having small mods to Win code would be much easier. I am not talking
about "generic" functions, but about specific drivers/etc.
Imagine this: Under windows you get usb driver with some ioctl-based
interface, sometimes with DLL or without it (vendor provides only .lib
file that gets statically linked). Under Linux there is libusb used.
Difference between these two ways of driver implementation is *huge*
and making libusb driver compatible with Win32 driver is almost
impossible (in Win you have a real file handle, under libusb only
It would greatly help for this case to be able to:
- detect wine and platform from Win32 app (.exe)
- load native Linux library and perform ioctls (ioctl(2), not Windows
IOCTL!) on file handles
- get somehow access to files in Linux filesystem (i.e. in /dev)
This would allow to easily modify our source code in a few places
(i.e. hardware routines) and get it quickly running under Linux.
I can do all above by writing some built-in dll that would work just
for my case, but I think *maybe* it's worth it to provide some generic
interface in Wine??
More information about the wine-devel