WineHQ
WineHQ

5.2. Writing the spec file

Start by writing the spec file. This file will describe the interface as if it were a DLL. See elsewhere for the details of the format of a spec file (e.g. man winebuild).

In the simple example we want a Wine built-in DLL that corresponds to the MyWin DLL. The spec file is MyWin.dll.spec and looks something like this:

#
# File: MyWin.dll.spec
#
# some sort of copyright
#
# Wine spec file for the MyWin.dll built-in library (a minimal wrapper around the
# linux library libMyLinux)
#
# For further details of wine spec files see the Winelib documentation at
# www.winehq.org

2 stdcall MyWinFunc (long ptr ptr ptr ptr long long ptr) MyProxyWinFunc

# End of file
Notice that the arguments are flagged as long even though they are smaller than that. With this example we will link directly to the Linux shared library whereas with the ODBC example we will load the Linux shared library dynamically.

In the case of the ODBC example you can see this in the file odbc32.spec.