2005-10-06 18:10:01 +02:00
|
|
|
.TH WINEBUILD 1 "October 2005" "@PACKAGE_STRING@" "Wine Developers Manual"
|
2002-07-28 20:58:41 +02:00
|
|
|
.SH NAME
|
|
|
|
winebuild \- Wine dll builder
|
|
|
|
.SH SYNOPSIS
|
2013-07-17 16:45:19 +02:00
|
|
|
.B winebuild
|
|
|
|
.RI [ options ]\ [ inputfile ...]
|
2002-07-28 20:58:41 +02:00
|
|
|
.SH DESCRIPTION
|
|
|
|
.B winebuild
|
2005-09-29 15:41:34 +02:00
|
|
|
generates the assembly files that are necessary to build a Wine dll,
|
|
|
|
which is basically a Win32 dll encapsulated inside a Unix library.
|
2002-07-28 20:58:41 +02:00
|
|
|
.PP
|
|
|
|
.B winebuild
|
|
|
|
has different modes, depending on what kind of file it is asked to
|
|
|
|
generate. The mode is specified by one of the mode options specified
|
|
|
|
below. In addition to the mode option, various other command-line
|
|
|
|
option can be specified, as described in the \fBOPTIONS\fR section.
|
|
|
|
.SH "MODE OPTIONS"
|
|
|
|
You have to specify exactly one of the following options, depending on
|
|
|
|
what you want winebuild to generate.
|
|
|
|
.TP
|
2005-03-08 17:55:26 +01:00
|
|
|
.BI \--dll
|
2005-09-21 12:22:28 +02:00
|
|
|
Build an assembly file from a .spec file (see \fBSPEC FILE SYNTAX\fR
|
2005-10-06 13:40:43 +02:00
|
|
|
for details), or from a standard Windows .def file. The .spec/.def
|
2013-07-17 16:45:19 +02:00
|
|
|
file is specified via the \fB-E\fR option. The resulting file must be
|
2005-10-06 13:40:43 +02:00
|
|
|
assembled and linked to the other object files to build a working Wine
|
|
|
|
dll. In this mode, the
|
2002-08-01 20:34:12 +02:00
|
|
|
.I input files
|
|
|
|
should be the list of all object files that will be linked into the
|
|
|
|
final dll, to allow
|
|
|
|
.B winebuild
|
|
|
|
to get the list of all undefined symbols that need to be imported from
|
|
|
|
other dlls.
|
2002-07-28 20:58:41 +02:00
|
|
|
.TP
|
2005-03-08 17:55:26 +01:00
|
|
|
.BI \--exe
|
2005-09-21 12:22:28 +02:00
|
|
|
Build an assembly file for an executable. This is basically the same as
|
2013-07-17 16:45:19 +02:00
|
|
|
the \fB--dll\fR mode except that it doesn't require a .spec/.def file as input,
|
2005-03-08 17:55:26 +01:00
|
|
|
since an executable need not export functions. Some executables however
|
|
|
|
do export functions, and for those a .spec/.def file can be specified via
|
2013-07-17 16:45:19 +02:00
|
|
|
the \fB-E\fR option. The executable is named from the .spec/.def file name if
|
|
|
|
present, or explicitly through the \fB-F\fR option. The resulting file must be
|
2005-09-21 12:22:28 +02:00
|
|
|
assembled and linked to the other object files to build a working Wine
|
2005-03-08 17:55:26 +01:00
|
|
|
executable, and all the other object files must be listed as
|
2002-08-01 20:34:12 +02:00
|
|
|
.I input files.
|
|
|
|
.TP
|
2005-03-08 17:55:26 +01:00
|
|
|
.BI \--def
|
|
|
|
Build a .def file from a spec file. The .spec file is specified via the
|
2013-07-17 16:45:19 +02:00
|
|
|
\fB-E\fR option. This is used when building dlls with a PE (Win32) compiler.
|
2002-07-28 20:58:41 +02:00
|
|
|
.TP
|
2009-12-30 11:51:19 +01:00
|
|
|
.BI \--implib
|
2016-03-25 07:32:22 +01:00
|
|
|
Build a .a import library from a spec file. The .spec file is
|
2019-05-02 15:56:15 +02:00
|
|
|
specified via the \fB-E\fR option. If the output library name ends
|
|
|
|
in .delay.a, a delayed import library is built.
|
2009-12-30 11:51:19 +01:00
|
|
|
.TP
|
2020-03-04 17:15:34 +01:00
|
|
|
.BI \--staticlib
|
|
|
|
Build a .a static library from object files.
|
|
|
|
.TP
|
2019-12-18 21:05:27 +01:00
|
|
|
.BI \--builtin
|
|
|
|
Mark a PE module as a Wine builtin module, by adding the "Wine builtin
|
|
|
|
DLL" signature string after the DOS header.
|
|
|
|
.TP
|
2009-05-30 21:39:50 +02:00
|
|
|
.B \--resources
|
|
|
|
Generate a .o file containing all the input resources. This is useful
|
|
|
|
when building with a PE compiler, since the PE binutils cannot handle
|
|
|
|
multiple resource files as input. For a standard Unix build, the
|
|
|
|
resource files are automatically included when building the spec file,
|
|
|
|
so there's no need for an intermediate .o file.
|
2002-07-28 20:58:41 +02:00
|
|
|
.SH OPTIONS
|
|
|
|
.TP
|
2005-09-19 19:04:43 +02:00
|
|
|
.BI \--as-cmd= as-command
|
|
|
|
Specify the command to use to compile assembly files; the default is
|
|
|
|
\fBas\fR.
|
|
|
|
.TP
|
2013-07-17 16:45:19 +02:00
|
|
|
.BI \-b,\ --target= cpu-manufacturer\fR[\fB-\fIkernel\fR]\fB-\fIos
|
2009-01-14 12:52:53 +01:00
|
|
|
Specify the target CPU and platform on which the generated code will
|
|
|
|
be built. The target specification is in the standard autoconf format
|
|
|
|
as returned by config.sub.
|
|
|
|
.TP
|
2019-09-10 17:53:19 +02:00
|
|
|
.BI \-B\ directory
|
|
|
|
Add the directory to the search path for the various binutils tools
|
|
|
|
like \fBas\fR, \fBnm\fR and \fBld\fR.
|
|
|
|
.TP
|
2013-06-10 13:19:29 +02:00
|
|
|
.BI \--cc-cmd= cc-command
|
|
|
|
Specify the C compiler to use to compile assembly files; the default
|
|
|
|
is to instead use the assembler specified with \fB--as-cmd\fR.
|
|
|
|
.TP
|
2005-05-06 17:54:41 +02:00
|
|
|
.BI \-d,\ --delay-lib= name
|
|
|
|
Set the delayed import mode for the specified library, which must be
|
|
|
|
one of the libraries imported with the \fB-l\fR option. Delayed mode
|
|
|
|
means that the library won't be loaded until a function imported from
|
|
|
|
it is actually called.
|
|
|
|
.TP
|
2002-07-28 20:58:41 +02:00
|
|
|
.BI \-D\ symbol
|
|
|
|
Ignored for compatibility with the C compiler.
|
|
|
|
.TP
|
2003-03-23 02:12:30 +01:00
|
|
|
.BI \-e,\ --entry= function
|
2002-11-06 21:02:59 +01:00
|
|
|
Specify the module entry point function; if not specified, the default
|
|
|
|
is
|
|
|
|
.B DllMain
|
|
|
|
for dlls, and
|
2004-04-08 06:41:14 +02:00
|
|
|
.B main
|
2006-02-16 19:32:35 +01:00
|
|
|
for executables (if the standard C
|
|
|
|
.B main
|
|
|
|
is not defined,
|
|
|
|
.B WinMain
|
2004-04-08 06:41:14 +02:00
|
|
|
is used instead). This is only valid for Win32 modules.
|
2002-11-06 21:02:59 +01:00
|
|
|
.TP
|
2005-03-08 17:55:26 +01:00
|
|
|
.BI \-E,\ --export= filename
|
|
|
|
Specify a .spec file (see \fBSPEC FILE SYNTAX\fR for details),
|
|
|
|
or a standard Windows .def file that defines the exports
|
|
|
|
of the DLL or executable that is being built.
|
|
|
|
.TP
|
2006-04-18 20:49:29 +02:00
|
|
|
.B \--external-symbols
|
|
|
|
Allow linking to external symbols directly from the spec
|
|
|
|
file. Normally symbols exported by a dll have to be defined in the dll
|
|
|
|
itself; this option makes it possible to use symbols defined in
|
|
|
|
another Unix library (for symbols defined in another dll, a
|
|
|
|
.I forward
|
|
|
|
specification must be used instead).
|
|
|
|
.TP
|
2010-04-11 12:07:44 +02:00
|
|
|
.BI \-f\ option
|
|
|
|
Specify a code generation option. Currently \fB\-fPIC\fR and
|
|
|
|
\fB\-fasynchronous-unwind-tables\fR are supported. Other options are
|
|
|
|
ignored for compatibility with the C compiler.
|
2002-07-28 20:58:41 +02:00
|
|
|
.TP
|
2009-08-14 14:16:38 +02:00
|
|
|
.B \--fake-module
|
|
|
|
Create a fake PE module for a dll or exe, instead of the normal
|
|
|
|
assembly or object file. The PE module contains the resources for the
|
|
|
|
module, but no executable code.
|
|
|
|
.TP
|
2003-03-23 02:12:30 +01:00
|
|
|
.BI \-F,\ --filename= filename
|
2003-01-02 20:30:17 +01:00
|
|
|
Set the file name of the module. The default is to use the base name
|
|
|
|
of the spec file (without any extension).
|
|
|
|
.TP
|
2003-03-23 02:12:30 +01:00
|
|
|
.B \-h, --help
|
2002-07-28 20:58:41 +02:00
|
|
|
Display a usage message and exit.
|
|
|
|
.TP
|
2003-03-23 02:12:30 +01:00
|
|
|
.BI \-H,\ --heap= size
|
2002-09-13 00:51:20 +02:00
|
|
|
Specify the size of the module local heap in bytes (only valid for
|
|
|
|
Win16 modules); default is no local heap.
|
|
|
|
.TP
|
2003-03-23 02:12:30 +01:00
|
|
|
.BI \-I\ directory
|
2002-07-28 20:58:41 +02:00
|
|
|
Ignored for compatibility with the C compiler.
|
|
|
|
.TP
|
2003-03-23 02:12:30 +01:00
|
|
|
.B \-k, --kill-at
|
2002-12-12 05:06:28 +01:00
|
|
|
Remove the stdcall decorations from the symbol names in the
|
|
|
|
generated .def file. Only meaningful in \fB--def\fR mode.
|
|
|
|
.TP
|
2003-03-23 02:12:30 +01:00
|
|
|
.BI \-K\ flags
|
|
|
|
Ignored for compatibility with the C compiler.
|
|
|
|
.TP
|
2009-06-17 16:10:35 +02:00
|
|
|
.BI \--large-address-aware
|
|
|
|
Set a flag in the executable to notify the loader that this
|
|
|
|
application supports address spaces larger than 2 gigabytes.
|
|
|
|
.TP
|
2004-10-08 23:11:18 +02:00
|
|
|
.BI \--ld-cmd= ld-command
|
|
|
|
Specify the command to use to link the object files; the default is
|
|
|
|
\fBld\fR.
|
|
|
|
.TP
|
2003-03-23 02:12:30 +01:00
|
|
|
.BI \-L,\ --library-path= directory
|
2002-07-28 20:58:41 +02:00
|
|
|
Append the specified directory to the list of directories that are
|
|
|
|
searched for import libraries.
|
|
|
|
.TP
|
2003-03-23 02:12:30 +01:00
|
|
|
.BI \-l,\ --library= name
|
2002-07-28 20:58:41 +02:00
|
|
|
Import the specified library, looking for a corresponding
|
2003-03-23 02:12:30 +01:00
|
|
|
\fIlibname.def\fR file in the directories specified with the \fB-L\fR
|
2002-07-28 20:58:41 +02:00
|
|
|
option.
|
|
|
|
.TP
|
2010-07-21 12:43:53 +02:00
|
|
|
.B \-m16, -m32, -m64
|
2013-07-17 16:45:19 +02:00
|
|
|
Generate respectively 16-bit, 32-bit or 64-bit code.
|
2009-01-15 21:17:51 +01:00
|
|
|
.TP
|
2018-11-05 20:20:25 +01:00
|
|
|
.BI \-marm,\ \-mthumb,\ \-march= option ,\ \-mcpu= option ,\ \-mfpu= option ,\ \-mfloat-abi= option
|
2014-02-12 12:57:27 +01:00
|
|
|
Set code generation options for the assembler.
|
|
|
|
.TP
|
2019-06-17 09:24:25 +02:00
|
|
|
.B \-munix
|
|
|
|
Build a library that imports standard functions from the Unix C
|
|
|
|
library instead of the Windows runtime.
|
|
|
|
.TP
|
2003-03-23 02:12:30 +01:00
|
|
|
.BI \-M,\ --main-module= module
|
2009-12-29 21:36:43 +01:00
|
|
|
When building a 16-bit dll, set the name of its 32-bit counterpart to
|
|
|
|
\fImodule\fR. This is used to enforce that the load order for the
|
|
|
|
16-bit dll matches that of the 32-bit one.
|
2002-07-28 20:58:41 +02:00
|
|
|
.TP
|
2003-03-23 02:12:30 +01:00
|
|
|
.BI \-N,\ --dll-name= dllname
|
2002-09-13 00:51:20 +02:00
|
|
|
Set the internal name of the module. It is only used in Win16
|
|
|
|
modules. The default is to use the base name of the spec file (without
|
|
|
|
any extension). This is used for KERNEL, since it lives in
|
|
|
|
KRNL386.EXE. It shouldn't be needed otherwise.
|
|
|
|
.TP
|
2005-09-19 19:04:43 +02:00
|
|
|
.BI \--nm-cmd= nm-command
|
|
|
|
Specify the command to use to get the list of undefined symbols; the
|
|
|
|
default is \fBnm\fR.
|
|
|
|
.TP
|
2013-07-17 16:45:19 +02:00
|
|
|
.BI --nxcompat= yes\fR|\fIno
|
2006-12-07 20:51:49 +01:00
|
|
|
Specify whether the module is compatible with no-exec support. The
|
|
|
|
default is yes.
|
|
|
|
.TP
|
2003-03-23 02:12:30 +01:00
|
|
|
.BI \-o,\ --output= file
|
2005-09-21 12:22:28 +02:00
|
|
|
Set the name of the output file (default is standard output). If the
|
2013-07-17 16:45:19 +02:00
|
|
|
output file name ends in .o, the text output is sent to a
|
2005-09-21 12:22:28 +02:00
|
|
|
temporary file that is then assembled to produce the specified .o
|
|
|
|
file.
|
2002-07-28 20:58:41 +02:00
|
|
|
.TP
|
2003-03-23 02:12:30 +01:00
|
|
|
.BI \-r,\ --res= rsrc.res
|
2002-07-28 20:58:41 +02:00
|
|
|
Load resources from the specified binary resource file. The
|
2005-09-21 12:22:28 +02:00
|
|
|
\fIrsrc.res\fR file can be produced from a source resource file with
|
2013-07-17 16:45:19 +02:00
|
|
|
.BR wrc (1)
|
2002-07-28 20:58:41 +02:00
|
|
|
(or with a Windows resource compiler).
|
2002-12-07 00:26:29 +01:00
|
|
|
.br
|
|
|
|
This option is only necessary for Win16 resource files, the Win32 ones
|
|
|
|
can simply listed as
|
|
|
|
.I input files
|
|
|
|
and will automatically be handled correctly (though the
|
|
|
|
.B \-r
|
|
|
|
option will also work for Win32 files).
|
2002-07-28 20:58:41 +02:00
|
|
|
.TP
|
2005-09-21 12:22:28 +02:00
|
|
|
.B --save-temps
|
|
|
|
Do not delete the various temporary files that \fBwinebuild\fR generates.
|
|
|
|
.TP
|
2013-07-17 16:45:19 +02:00
|
|
|
.BI --subsystem= subsystem\fR[\fB:\fImajor\fR[\fB.\fIminor\fR]]
|
2004-03-25 01:40:52 +01:00
|
|
|
Set the subsystem of the executable, which can be one of the following:
|
|
|
|
.br
|
|
|
|
.B console
|
|
|
|
for a command line executable,
|
|
|
|
.br
|
|
|
|
.B windows
|
|
|
|
for a graphical executable,
|
|
|
|
.br
|
|
|
|
.B native
|
2010-11-08 18:52:12 +01:00
|
|
|
for a native-mode dll,
|
|
|
|
.br
|
|
|
|
.B wince
|
|
|
|
for a ce dll.
|
2004-03-25 01:40:52 +01:00
|
|
|
.br
|
|
|
|
The entry point of a command line executable is a normal C \fBmain\fR
|
|
|
|
function. A \fBwmain\fR function can be used instead if you need the
|
|
|
|
argument array to use Unicode strings. A graphical executable has a
|
|
|
|
\fBWinMain\fR entry point.
|
|
|
|
.br
|
|
|
|
Optionally a major and minor subsystem version can also be specified;
|
|
|
|
the default subsystem version is 4.0.
|
|
|
|
.TP
|
2005-08-19 13:28:56 +02:00
|
|
|
.BI \-u,\ --undefined= symbol
|
|
|
|
Add \fIsymbol\fR to the list of undefined symbols when invoking the
|
|
|
|
linker. This makes it possible to force a specific module of a static
|
|
|
|
library to be included when resolving imports.
|
|
|
|
.TP
|
2005-09-21 12:22:28 +02:00
|
|
|
.B \-v, --verbose
|
|
|
|
Display the various subcommands being invoked by
|
2013-07-17 16:45:19 +02:00
|
|
|
.BR winebuild .
|
2005-09-21 12:22:28 +02:00
|
|
|
.TP
|
2003-03-23 02:12:30 +01:00
|
|
|
.B \--version
|
|
|
|
Display the program version and exit.
|
|
|
|
.TP
|
|
|
|
.B \-w, --warnings
|
2002-07-28 20:58:41 +02:00
|
|
|
Turn on warnings.
|
|
|
|
.SH "SPEC FILE SYNTAX"
|
|
|
|
.SS "General syntax"
|
2002-12-08 00:54:12 +01:00
|
|
|
A spec file should contain a list of ordinal declarations. The general
|
|
|
|
syntax is the following:
|
2002-07-28 20:58:41 +02:00
|
|
|
.PP
|
|
|
|
.I ordinal functype
|
2003-03-18 06:30:54 +01:00
|
|
|
.RI [ flags ]\ exportname \ \fB(\fR\ [ args... ] \ \fB) \ [ handler ]
|
2002-07-28 20:58:41 +02:00
|
|
|
.br
|
|
|
|
.IB ordinal\ variable
|
|
|
|
.RI [ flags ]\ exportname \ \fB(\fR\ [ data... ] \ \fB)
|
|
|
|
.br
|
2003-03-17 01:02:11 +01:00
|
|
|
.IB ordinal\ extern
|
2003-03-18 06:30:54 +01:00
|
|
|
.RI [ flags ]\ exportname \ [ symbolname ]
|
2003-03-17 01:02:11 +01:00
|
|
|
.br
|
2002-07-28 20:58:41 +02:00
|
|
|
.IB ordinal\ stub
|
2011-05-03 12:49:15 +02:00
|
|
|
.RI [ flags ]\ exportname \ [\ \fB( args... \fB)\fR\ ]
|
2002-07-28 20:58:41 +02:00
|
|
|
.br
|
|
|
|
.IB ordinal\ equate
|
|
|
|
.RI [ flags ]\ exportname\ data
|
|
|
|
.br
|
2002-12-08 00:54:12 +01:00
|
|
|
.BI #\ comments
|
2002-07-28 20:58:41 +02:00
|
|
|
.PP
|
2003-03-18 06:30:54 +01:00
|
|
|
Declarations must fit on a single line, except if the end of line is
|
|
|
|
escaped using a backslash character. The
|
2002-07-28 20:58:41 +02:00
|
|
|
.B #
|
2003-03-18 06:30:54 +01:00
|
|
|
character anywhere in a line causes the rest of the line to be ignored
|
|
|
|
as a comment.
|
2002-12-08 00:54:12 +01:00
|
|
|
.PP
|
2002-07-28 20:58:41 +02:00
|
|
|
.I ordinal
|
|
|
|
specifies the ordinal number corresponding to the entry point, or '@'
|
|
|
|
for automatic ordinal allocation (Win32 only).
|
|
|
|
.PP
|
|
|
|
.I flags
|
|
|
|
is a series of optional flags, preceded by a '-' character. The
|
|
|
|
supported flags are:
|
|
|
|
.RS
|
|
|
|
.TP
|
|
|
|
.B -norelay
|
|
|
|
The entry point is not displayed in relay debugging traces (Win32
|
|
|
|
only).
|
|
|
|
.TP
|
|
|
|
.B -noname
|
2007-10-26 12:47:40 +02:00
|
|
|
The entry point will be exported by ordinal instead of by name. The
|
|
|
|
name is still available for importing.
|
2002-07-28 20:58:41 +02:00
|
|
|
.TP
|
2003-08-27 04:20:44 +02:00
|
|
|
.B -ret16
|
|
|
|
The function returns a 16-bit value (Win16 only).
|
|
|
|
.TP
|
2002-07-28 20:58:41 +02:00
|
|
|
.B -ret64
|
|
|
|
The function returns a 64-bit value (Win32 only).
|
|
|
|
.TP
|
|
|
|
.B -register
|
2005-12-16 12:44:16 +01:00
|
|
|
The function uses CPU register to pass arguments.
|
2002-07-28 20:58:41 +02:00
|
|
|
.TP
|
2003-07-28 21:19:48 +02:00
|
|
|
.B -private
|
|
|
|
The function cannot be imported from other dlls, it can only be
|
|
|
|
accessed through GetProcAddress.
|
2007-10-26 12:47:40 +02:00
|
|
|
.TP
|
|
|
|
.B -ordinal
|
|
|
|
The entry point will be imported by ordinal instead of by name. The
|
|
|
|
name is still exported.
|
2008-12-08 17:07:50 +01:00
|
|
|
.TP
|
2019-02-27 17:09:51 +01:00
|
|
|
.B -thiscall
|
|
|
|
The function uses the
|
|
|
|
.I thiscall
|
|
|
|
calling convention (first parameter in %ecx register on i386).
|
|
|
|
.TP
|
2019-02-27 17:11:08 +01:00
|
|
|
.B -fastcall
|
|
|
|
The function uses the
|
|
|
|
.I fastcall
|
|
|
|
calling convention (first two parameters in %ecx/%edx registers on
|
|
|
|
i386).
|
|
|
|
.TP
|
2019-06-21 12:08:44 +02:00
|
|
|
.B -import
|
|
|
|
The function is imported from another module. This can be used instead
|
|
|
|
of a
|
|
|
|
.I forward
|
|
|
|
specification when an application expects to find the function's
|
|
|
|
implementation inside the dll.
|
|
|
|
.TP
|
2019-10-16 14:28:38 +02:00
|
|
|
.B -arch=\fR[\fB!\fR]\fIcpu\fR[\fB,\fIcpu\fR]
|
2009-12-29 21:36:43 +01:00
|
|
|
The entry point is only available on the specified CPU
|
|
|
|
architecture(s). The names \fBwin32\fR and \fBwin64\fR match all
|
2013-07-17 16:45:19 +02:00
|
|
|
32-bit or 64-bit CPU architectures respectively. In 16-bit dlls,
|
2009-12-29 21:36:43 +01:00
|
|
|
specifying \fB-arch=win32\fR causes the entry point to be exported
|
2019-10-16 14:28:38 +02:00
|
|
|
from the 32-bit wrapper module. A CPU name can be prefixed with
|
|
|
|
\fB!\fR to exclude only that specific architecture.
|
|
|
|
.RE
|
2002-07-28 20:58:41 +02:00
|
|
|
.SS "Function ordinals"
|
|
|
|
Syntax:
|
|
|
|
.br
|
|
|
|
.I ordinal functype
|
2003-03-18 06:30:54 +01:00
|
|
|
.RI [ flags ]\ exportname \ \fB(\fR\ [ args... ] \ \fB) \ [ handler ]
|
2002-07-28 20:58:41 +02:00
|
|
|
.br
|
|
|
|
|
|
|
|
This declaration defines a function entry point. The prototype defined by
|
|
|
|
.IR exportname \ \fB(\fR\ [ args... ] \ \fB)
|
|
|
|
specifies the name available for dynamic linking and the format of the
|
|
|
|
arguments. '@' can be used instead of
|
|
|
|
.I exportname
|
|
|
|
for ordinal-only exports.
|
|
|
|
.PP
|
|
|
|
.I functype
|
|
|
|
should be one of:
|
|
|
|
.RS
|
|
|
|
.TP
|
|
|
|
.B stdcall
|
|
|
|
for a normal Win32 function
|
|
|
|
.TP
|
2003-08-27 04:20:44 +02:00
|
|
|
.B pascal
|
|
|
|
for a normal Win16 function
|
|
|
|
.TP
|
2002-07-28 20:58:41 +02:00
|
|
|
.B cdecl
|
2003-08-27 04:20:44 +02:00
|
|
|
for a Win16 or Win32 function using the C calling convention
|
2002-07-28 20:58:41 +02:00
|
|
|
.TP
|
|
|
|
.B varargs
|
2003-08-27 04:20:44 +02:00
|
|
|
for a Win16 or Win32 function using the C calling convention with a
|
|
|
|
variable number of arguments
|
2002-07-28 20:58:41 +02:00
|
|
|
.RE
|
|
|
|
.PP
|
|
|
|
.I args
|
|
|
|
should be one or several of:
|
|
|
|
.RS
|
|
|
|
.TP
|
|
|
|
.B word
|
|
|
|
(16-bit unsigned value)
|
|
|
|
.TP
|
|
|
|
.B s_word
|
|
|
|
(16-bit signed word)
|
|
|
|
.TP
|
|
|
|
.B long
|
2010-08-30 12:40:53 +02:00
|
|
|
(pointer-sized integer value)
|
|
|
|
.TP
|
|
|
|
.B int64
|
|
|
|
(64-bit integer value)
|
|
|
|
.TP
|
|
|
|
.B int128
|
|
|
|
(128-bit integer value)
|
|
|
|
.TP
|
|
|
|
.B float
|
|
|
|
(32-bit floating point value)
|
2002-07-28 20:58:41 +02:00
|
|
|
.TP
|
|
|
|
.B double
|
2010-08-30 12:40:53 +02:00
|
|
|
(64-bit floating point value)
|
2002-07-28 20:58:41 +02:00
|
|
|
.TP
|
|
|
|
.B ptr
|
|
|
|
(linear pointer)
|
|
|
|
.TP
|
|
|
|
.B str
|
|
|
|
(linear pointer to a null-terminated ASCII string)
|
|
|
|
.TP
|
|
|
|
.B wstr
|
|
|
|
(linear pointer to a null-terminated Unicode string)
|
|
|
|
.TP
|
|
|
|
.B segptr
|
|
|
|
(segmented pointer)
|
|
|
|
.TP
|
|
|
|
.B segstr
|
|
|
|
(segmented pointer to a null-terminated ASCII string).
|
|
|
|
.HP
|
2010-08-30 12:40:53 +02:00
|
|
|
Note: The 16-bit and segmented pointer types are only valid for Win16
|
|
|
|
functions.
|
2002-07-28 20:58:41 +02:00
|
|
|
.RE
|
|
|
|
.PP
|
|
|
|
.I handler
|
|
|
|
is the name of the actual C function that will implement that entry
|
2002-12-15 02:22:40 +01:00
|
|
|
point in 32-bit mode. The handler can also be specified as
|
|
|
|
.IB dllname . function
|
|
|
|
to define a forwarded function (one whose implementation is in another
|
2003-03-18 06:30:54 +01:00
|
|
|
dll). If
|
|
|
|
.I handler
|
|
|
|
is not specified, it is assumed to be identical to
|
|
|
|
.I exportname.
|
2002-07-28 20:58:41 +02:00
|
|
|
.PP
|
2003-03-18 06:30:54 +01:00
|
|
|
This first example defines an entry point for the 32-bit GetFocus()
|
2002-07-28 20:58:41 +02:00
|
|
|
call:
|
|
|
|
.IP
|
|
|
|
@ stdcall GetFocus() GetFocus
|
|
|
|
.PP
|
2003-03-18 06:30:54 +01:00
|
|
|
This second example defines an entry point for the 16-bit
|
|
|
|
CreateWindow() call (the ordinal 100 is just an example); it also
|
|
|
|
shows how long lines can be split using a backslash:
|
|
|
|
.IP
|
|
|
|
100 pascal CreateWindow(ptr ptr long s_word s_word s_word \\
|
|
|
|
s_word word word word ptr) WIN_CreateWindow
|
|
|
|
.PP
|
2003-08-27 04:20:44 +02:00
|
|
|
To declare a function using a variable number of arguments, specify
|
|
|
|
the function as
|
2002-07-28 20:58:41 +02:00
|
|
|
.B varargs
|
2003-08-27 04:20:44 +02:00
|
|
|
and declare it in the C file with a '...' parameter for a Win32
|
|
|
|
function, or with an extra VA_LIST16 argument for a Win16 function.
|
|
|
|
See the wsprintf* functions in user.exe.spec and user32.spec for an
|
|
|
|
example.
|
2002-07-28 20:58:41 +02:00
|
|
|
.SS "Variable ordinals"
|
|
|
|
Syntax:
|
|
|
|
.br
|
|
|
|
.IB ordinal\ variable
|
|
|
|
.RI [ flags ]\ exportname \ \fB(\fR\ [ data... ] \ \fB)
|
|
|
|
.PP
|
|
|
|
This declaration defines data storage as 32-bit words at the ordinal
|
|
|
|
specified.
|
|
|
|
.I exportname
|
|
|
|
will be the name available for dynamic
|
|
|
|
linking.
|
|
|
|
.I data
|
2005-03-02 14:53:50 +01:00
|
|
|
can be a decimal number or a hex number preceded by "0x". The
|
2002-07-28 20:58:41 +02:00
|
|
|
following example defines the variable VariableA at ordinal 2 and
|
|
|
|
containing 4 ints:
|
|
|
|
.IP
|
|
|
|
2 variable VariableA(-1 0xff 0 0)
|
2003-03-17 01:02:11 +01:00
|
|
|
.PP
|
|
|
|
This declaration only works in Win16 spec files. In Win32 you should
|
|
|
|
use
|
|
|
|
.B extern
|
|
|
|
instead (see below).
|
|
|
|
.SS "Extern ordinals"
|
|
|
|
Syntax:
|
|
|
|
.br
|
|
|
|
.IB ordinal\ extern
|
2003-03-18 06:30:54 +01:00
|
|
|
.RI [ flags ]\ exportname \ [ symbolname ]
|
2003-03-17 01:02:11 +01:00
|
|
|
.PP
|
|
|
|
This declaration defines an entry that simply maps to a C symbol
|
|
|
|
(variable or function). It only works in Win32 spec files.
|
|
|
|
.I exportname
|
|
|
|
will point to the symbol
|
|
|
|
.I symbolname
|
|
|
|
that must be defined in the C code. Alternatively, it can be of the
|
|
|
|
form
|
|
|
|
.IB dllname . symbolname
|
|
|
|
to define a forwarded symbol (one whose implementation is in another
|
2003-03-18 06:30:54 +01:00
|
|
|
dll). If
|
|
|
|
.I symbolname
|
|
|
|
is not specified, it is assumed to be identical to
|
|
|
|
.I exportname.
|
2002-07-28 20:58:41 +02:00
|
|
|
.SS "Stub ordinals"
|
|
|
|
Syntax:
|
|
|
|
.br
|
|
|
|
.IB ordinal\ stub
|
2011-05-03 12:49:15 +02:00
|
|
|
.RI [ flags ]\ exportname \ [\ \fB( args... \fB)\fR\ ]
|
2002-07-28 20:58:41 +02:00
|
|
|
.PP
|
|
|
|
This declaration defines a stub function. It makes the name and
|
|
|
|
ordinal available for dynamic linking, but will terminate execution
|
|
|
|
with an error message if the function is ever called.
|
|
|
|
.SS "Equate ordinals"
|
|
|
|
Syntax:
|
|
|
|
.br
|
|
|
|
.IB ordinal\ equate
|
|
|
|
.RI [ flags ]\ exportname\ data
|
|
|
|
.PP
|
|
|
|
This declaration defines an ordinal as an absolute value.
|
|
|
|
.I exportname
|
|
|
|
will be the name available for dynamic linking.
|
|
|
|
.I data
|
2005-03-02 14:53:50 +01:00
|
|
|
can be a decimal number or a hex number preceded by "0x".
|
2002-07-28 20:58:41 +02:00
|
|
|
.SH AUTHORS
|
|
|
|
.B winebuild
|
|
|
|
has been worked on by many people over the years. The main authors are
|
|
|
|
Robert J. Amstadt, Alexandre Julliard, Martin von Loewis, Ulrich
|
2013-07-16 23:09:41 +02:00
|
|
|
Weigand and Eric Youngdale. Many other people have contributed new features
|
|
|
|
and bug fixes. For a complete list, see the git commit logs.
|
2002-07-28 20:58:41 +02:00
|
|
|
.SH BUGS
|
|
|
|
It is not yet possible to use a PE-format dll in an import
|
|
|
|
specification; only Wine dlls can be imported.
|
|
|
|
.PP
|
2013-07-16 20:48:05 +02:00
|
|
|
Bugs can be reported on the
|
2017-11-30 19:57:02 +01:00
|
|
|
.UR https://bugs.winehq.org
|
2013-07-16 20:48:05 +02:00
|
|
|
.B Wine bug tracker
|
|
|
|
.UE .
|
2002-07-28 20:58:41 +02:00
|
|
|
.SH AVAILABILITY
|
|
|
|
.B winebuild
|
2013-07-16 20:48:05 +02:00
|
|
|
is part of the Wine distribution, which is available through WineHQ,
|
2002-07-28 20:58:41 +02:00
|
|
|
the
|
2017-11-30 19:57:02 +01:00
|
|
|
.UR https://www.winehq.org/
|
2013-07-16 20:48:05 +02:00
|
|
|
.B Wine development headquarters
|
|
|
|
.UE .
|
2002-07-28 20:58:41 +02:00
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR wine (1),
|
2005-03-08 17:55:26 +01:00
|
|
|
.BR winegcc (1),
|
2013-07-16 20:48:05 +02:00
|
|
|
.BR wrc (1),
|
|
|
|
.br
|
2017-11-30 19:57:02 +01:00
|
|
|
.UR https://www.winehq.org/help
|
2013-07-16 20:48:05 +02:00
|
|
|
.B Wine documentation and support
|
|
|
|
.UE .
|