Windows dll replacement with Linux library

Dan Timis timis at museresearch.com
Wed Dec 31 18:10:45 CST 2003


Hi,

I wrote to  the list a few weeks ago.  I needed to support a USB device 
without changing the Windows dll that I have to use.  I was trying to 
hack into wine to implement support for the USB device using 
CreateFile() and DeviceIoControl().  That was not a clean solution.

The author of the Windows dll has agreed to support a mid level dll 
that would implement functions like USBDeviceOpen(), USBDeviceClose(), 
USBDeviceRead(), and USBDeviceWrite().  On Windows those would use 
CreateFile() and DeviceIoControl(), while on Linux they would use 
libusb calls.

I followed the example from winelib user guide, chapter 5 "Using Linux 
libraries as DLLs"  As an example I will talk just about 
USBDeviceOpen().  Here it is how it is declared together with a proxy 
function:

HANDLE WINAPI USBDeviceOpen(const DWORD in_dwIndex);
HANDLE WINAPI USBDeviceOpenProxy(const DWORD in_dwIndex);

This function opens a specific device from a specific manufacturer.  If 
more than one device connected

In the spec file I put:

101 stdcall USBDeviceOpen (long) USBDeviceOpenProxy

I used winemaker, configure, make, and make install.  Now I have 
"USBUtils.dll.so in /




More information about the wine-devel mailing list