7 [mode dll|cuiexe|guiexe|cuiexe_unicode|guiexe_unicode]
11 [import [IMP_FLAGS] DLL]
13 [debug_channels ([CHANNEL [CHANNEL...]])]
14 [ignore ([SYMBOL [SYMBOL...]])]
16 ORDINAL FUNCTYPE [FLAGS] EXPORTNAME([ARGTYPE [ARGTYPE [...]]]) HANDLERNAME
18 ORDINAL variable [FLAGS] EXPORTNAME (DATA [DATA [DATA [...]]])
20 ORDINAL stub [FLAGS] EXPORTNAME
22 ORDINAL equate [FLAGS] EXPORTNAME DATA
24 ORDINAL extern [FLAGS] EXPORTNAME SYMBOLNAME
26 ORDINAL forward [FLAGS] EXPORTNAME SYMBOLNAME
34 "name" and "type" fields are mandatory. Specific ordinal
35 declarations are optional, but the default handler will print an error
38 "mode" specifies whether it is the spec file for a dll or the main exe.
39 This is only valid for Win32 spec files.
41 "heap" is the size of the module local heap (only valid for Win16
42 modules); default is no local heap.
44 "stack" is the stack size for Win32 exe modules, in kilobytes; default
45 size is 1024 (1Mb stack).
47 "file" gives the name of the Windows file that is replaced by the
48 builtin. <name>.DLL is assumed if none is given. (This is important
49 for kernel, which lives in the Windows file KRNL386.EXE).
51 "init" specifies a function which will be called when this dll
52 is loaded. This is only valid for Win32 modules.
54 "import" names a module that this one depends on (only for Win32
55 modules at the present). The import declaration can be present several
58 "IMP_FLAGS" is a series of optional flags, preceded by a '-'
59 character. The supported flags are:
60 "-delay": the module this module depends upon will be loaded
61 when the first API will be called (and not while this
64 "rsrc" specifies the path of the compiled resource file.
66 "debug_channels" specifies the list of debug channels used by the dll.
68 "ignore" specifies a list of symbols that should be ignored when
69 resolving undefined symbols against the imported libraries.
71 "ORDINAL" specified the ordinal number corresponding to the entry
72 point, or "@" for automatic ordinal allocation (Win32 only).
74 "FLAGS" is a series of optional flags, preceded by a '-' character.
75 The supported flags are:
76 "-noimport": the entry point is not made available for importing
77 from winelib applications (Win32 only).
78 "-norelay": the entry point is not displayed in relay debugging
80 "-ret64": the function returns a 64-bit value (Win32 only).
81 "-i386": the entry point is only available on i386 platforms.
82 "-register": the function uses CPU register to pass arguments.
83 "-interrupt": the function is an interrupt handler routine.
85 Lines whose first character is a '#' will be ignored as comments.
91 This type defines data storage as 32-bit words at the ordinal specified.
92 "EXPORTNAME" will be the name available for dynamic linking. "DATA"
93 can be a decimal number or a hex number preceeded by "0x". The
94 following example defines the variable "VariableA" at ordinal 2 and
97 2 variable VariableA(-1 0xff 0 0)
102 This type defines a function entry point. The prototype defined by
103 "EXPORTNAME ([ARGTYPE [ARGTYPE [...]]])" specifies the name available for
104 dynamic linking and the format of the arguments. "@" can be used
105 instead of "EXPORTNAME" for ordinal-only exports.
107 "FUNCTYPE" should be one of:
108 - "pascal16" for a Win16 function returning a 16-bit value
109 - "pascal" for a Win16 function returning a 32-bit value
110 - "stdcall" for a normal Win32 function
111 - "cdecl" for a Win32 function using the C calling convention
112 - "varargs" for a Win32 function taking a variable number of arguments
114 "ARGTYPE" should be one of:
115 - "word" (16-bit unsigned value)
116 - "s_word" (16-bit signed word)
117 - "long" (32-bit value)
118 - "double" (64-bit value)
119 - "ptr" (linear pointer)
120 - "str" (linear pointer to a null-terminated ASCII string)
121 - "wstr" (linear pointer to a null-terminated Unicode string)
122 - "segptr" (segmented pointer)
123 - "segstr" (segmented pointer to a null-terminated ASCII string)
125 Only "ptr", "str", "wstr", "long" and "double" are valid for Win32 functions.
127 "HANDLERNAME" is the name of the actual Wine function that will
128 process the request in 32-bit mode.
130 This first example defines an entry point for the CreateWindow()
131 call (the ordinal 100 is just an example):
133 100 pascal CreateWindow(ptr ptr long s_word s_word s_word s_word
137 This second example defines an entry point for the GetFocus()
138 call (the ordinal 100 is just an example):
140 100 pascal GetFocus() WIN_GetFocus()
142 To declare a function using a variable number of arguments in Win16,
143 specify the function as taking no arguments. The arguments are then
144 available with CURRENT_STACK16->args. In Win32, specify the function
145 as 'varargs' and declare it with a '...' parameter in the C file. See
146 the wsprintf* functions in user.spec and user32.spec for an example.
151 This type defines a stub function. It makes the name and ordinal
152 available for dynamic linking, but will terminate execution with an
153 error message if the function is ever called.
158 This type defines an ordinal as an absolute value.
159 "EXPORTNAME" will be the name available for dynamic linking.
160 "DATA" can be a decimal number or a hex number preceeded by "0x".
165 This type defines an entry that simply maps to a Wine symbol
166 (variable or function); "EXPORTNAME" will point to the symbol
167 "SYMBOLNAME" that must be defined in C code. This type only works with
173 This type defines an entry that is forwarded to another entry
174 point (kind of a symbolic link). "EXPORTNAME" will forward to the
175 entry point "SYMBOLNAME" that must be of the form "DLL.Function". This
176 type only works with Win32.