Release 970804
[wine/multimedia.git] / tools / build-spec.txt
blob8d731485d043d342e6c407655e9da17bf1f8e2ca
1 name    NAME
2 type    win16|win32
3 [file   WINFILENAME]
4 [base   ORDINAL]
5 [heap   SIZE]
7 ORDINAL VARTYPE EXPORTNAME (DATA [DATA [DATA [...]]])
9 ORDINAL FUNCTYPE EXPORTNAME([ARGTYPE [ARGTYPE [...]]]) HANDLERNAME
11 ORDINAL stub EXPORTNAME
13 ORDINAL equate EXPORTNAME DATA
15 ORDINAL return EXPORTNAME ARGLENGTH RETVALUE
17 ORDINAL extern EXPORTNAME SYMBOLNAME
19 # COMMENT_TEXT
21 --------------------
22 General:
23 ========
25     "name" and "type" fields are mandatory.  Specific ordinal
26 declarations are optional, but the default handler will print an error
27 message.  "base" gives the offset of the first ordinal; default is 0.
28 "heap" is the size of the module local heap (only valid for Win16
29 modules); default is no local heap. "file" gives the name of the
30 Windows file that is replaced by the builtin. <name>.DLL is assumed if
31 none is given. (This is important for kernel, which lives in the
32 Windows file KRNL386.EXE).  Lines whose first character is a '#' will
33 be ignored as comments.
36 Variable ordinals:
37 ==================
39     This type defines data storage at the ordinal specified.  You may
40 store items as bytes, 16-bit words, or 32-bit words.
41     "ORDINAL" is replaced by the ordinal number corresponding to the
42 variable.  "VARTYPE" should be "byte", "word" or "long" for 8, 16, or
43 32 bits respectively.  "EXPORTNAME" will be the name available for
44 dynamic linking.  "DATA" can be a decimal number or a hex number preceeded
45 by "0x".  The following example defines the variable "VariableA" at
46 ordinal 2 and containing 4 bytes:
48         2 byte VariableA(-1 0xff 0 0)
50 Function ordinals:
51 ==================
53     This type defines a function entry point.  The prototype defined by
54 "EXPORTNAME ([ARGTYPE [ARGTYPE [...]]])" specifies the name available for
55 dynamic linking and the format of the arguments. "ORDINAL" is replaced
56 by the ordinal number corresponding to the function.
58 "FUNCTYPE" should be one of:
59 - "pascal16" for a Win16 function returning a 16-bit value
60 - "pascal" for a Win16 function returning a 32-bit value
61 - "register" for a function using CPU register to pass arguments
62 - "stdcall" for a normal Win32 function
63 - "cdecl" for a Win32 function using the C calling convention
65 "ARGTYPE" should be one of:
66 - "byte"
67 - "word"
68 - "long"
69 - "ptr" (linear pointer)
70 - "str" (linear pointer to a null-terminated string)
71 - "s_byte" (signed byte)
72 - "s_word" (signed word)
73 - "s_long" (signed long)
74 - "segptr" (segmented pointer).
75 - "segstr" (segmented pointer to a null-terminated string)
77 Only "ptr", "str" and "long" are valid for Win32 functions.
79 "HANDLERNAME" is the name of the actual Wine function that will
80 process the request in 32-bit mode.
82     This first example defines an entry point for the CreateWindow()
83 call (the ordinal 100 is just an example):
85         100 pascal CreateWindow(ptr ptr long s_word s_word s_word s_word
86                                 word word word ptr)
87                    WIN_CreateWindow
89    This second example defines an entry point for the GetFocus()
90 call (the ordinal 100 is just an example):
92         100 pascal GetFocus() WIN_GetFocus()
94 To declare a function using a variable number of arguments, specify
95 the function as taking no arguments. In this special case, in Win32
96 the called function will be passed a pointer to the first arg; in
97 Win16, the args are available with CURRENT_STACK16->args. See the
98 wsprintf* functions in user.spec and user32.spec for an example.
100 Stub ordinals:
101 ==============
103     This type defines a stub function. It makes the name and ordinal
104 available for dynamic linking, but will terminate execution with an
105 error message if the function is ever called.
107 Equate ordinals:
108 ================
110     This type defines an ordinal as an absolute value.
111 "ORDINAL" is replaced by the ordinal number corresponding to the
112 variable.  "EXPORTNAME" will be the name available for dynamic linking.  
113 "DATA" can be a decimal number or a hex number preceeded by "0x".
115 Return ordinals:
116 ================
118     This type defines a function entry point whose handler should do
119 nothing but return a value.
120     "ORDINAL" is replaced by the ordinal number corresponding to the
121 variable.  ARGLENGTH is the number of bytes that need to be removed
122 from the stack before returning to the caller.  RETVALUE is the
123 return value which will be passed back to the caller.
125 Extern ordinals:
126 ================
128     This type defines an entry that simply maps to a Wine symbol
129 (variable or function); "EXPORTNAME" will point to the symbol
130 "SYMBOLNAME" that must be defined in C code. This type only works with
131 Win32.