winejack.drv only supports 16bit sound so we can simplify the sound
[wine] / tools / winedump / winedump.man
1 .TH WINEDUMP 1 "February 2004" "Wine Manpage" "Wine Developers Manual"
2 .SH NAME
3 winedump \- A Wine DLL tool
4 .SH SYNOPSIS
5 .BR "winedump " [ "-h " "| "
6 .BI "sym " "<sym> "
7 |
8 .BI "spec " "<dll> "
9 |
10 .BI "dump " "<dll>"
11 .RI "] [" "mode_options" ]
12 .SH DESCRIPTION
13 .B winedump
14 is a Wine tool which aims to help:
15 .nf
16 A: Reimplementing a Win32 DLL for use within Wine, or
17 .nf
18 B: Compiling a Win32 application with Winelib that uses x86 DLL's
19 .PP
20 For both tasks in order to be able to link to the Win functions some
21 glue code is needed.  This 'glue' comes in the form of a \fI.spec\fR file.
22 The \fI.spec\fR file, along with some dummy code, is used to create a
23 Wine .so corresponding to the Windows DLL.  The \fBwinebuild\fR program
24 can then resolve calls made to DLL functions.
25 .PP
26 Creating a \fI.spec\fR file is a labour intensive task during which it is
27 easy to make a mistake. The idea of \fBwinedump\fR is to automate this task
28 and create the majority of the support code needed for your DLL. In
29 addition you can have \fBwinedump\fR create code to help you re-implement a
30 DLL, by providing tracing of calls to the DLL, and (in some cases)
31 automatically determining the parameters, calling conventions, and
32 return values of the DLL's functions.
33 .PP
34 Another use for this tool is to display (dump) information about a 32bit
35 DLL or PE format image file. When used in this way \fBwinedump\fR functions
36 similarly to tools such as pedump provided by many Win32 compiler
37 vendors.
38 .PP
39 Finally \fBwinedump\fR can be also used to demangle C++ symbols.
40 .SH MODES
41 .B winedump
42 can be used in several different modes.  The first argument to the
43 program determines the mode winedump will run in.
44 .IP \fB-h\fR
45 Help mode.
46 Basic usage help is printed.
47 .IP \fBdump\fR
48 To dump the contents of a PE file.
49 .IP \fBspec\fR
50 For generating .spec files and stub DLL's.
51 .IP \fBsym\fR
52 Symbol mode.
53 Used to demangle C++ symbols.
54 .SH OPTIONS
55 Mode options depend on the mode given as the first argument.
56 .PP
57 .B Help mode:
58 .nf
59 No options are used.
60 The program prints the help info and than exits.
61 .PP
62 .B Dump mode:
63 .IP \fI<dll>\fR
64 Dumps the content of the dll named \fI<dll>\fR.
65 .IP \fB-C\fR
66 Turns on symbol demangling.
67 .IP \fB-f\fR
68 Dumps file header information.
69 This option dumps only the standard PE header structures,
70 along with the COFF sections available in the file.
71 .IP "\fB-j \fIsect_name\fR"
72 Dumps only the content of section sect_name (import,
73 export, debug).
74 To dump only a given directory, specify them using this
75 option. Currently only the import, export and debug
76 directories are implemented.
77 .IP \fB-x\fR
78 Dumps everything.
79 This command prints all available information about the
80 file. You may wish to pipe the output through more/less or
81 into a file, since a lot of output will be produced.
82 .PP
83 .B Spec mode:
84 .IP \fI<dll>\fR
85 Use dll for input file and generate implementation code.
86 .IP "\fB-I \fIdir\fR"
87 Look for prototypes in '\fIdir\fR' (implies \fB-c\fR). In the case of
88 Windows DLL's, this could be either the standard include
89 directory from your compiler, or a SDK include directory.
90 If you have a text document with prototypes (such as
91 documentation) that can be used also, however you may need
92 to delete some non-code lines to ensure that prototypes are
93 parsed correctly.
94 The '\fIdir\fR' argument can also be a file specification (e.g.
95 "include/*"). If it contains wildcards you must quote it to
96 prevent the shell from expanding it.
97 If you have no prototypes, specify /dev/null for '\fIdir\fR'.
98 Winedump may still be able to generate some working stub
99 code for you.
100 .IP \fB-c\fR
101 Generate skeleton code (requires \fB-I\fR).
102 This option tells winedump to create function stubs for each
103 function in the DLL. As winedump reads each exported symbol
104 from the source DLL, it first tries to demangle the name. If
105 the name is a C++ symbol, the arguments, class and return
106 value are all encoded into the symbol name. Winedump
107 converts this information into a C function prototype. If
108 this fails, the file(s) specified in the \fB-I\fR argument are
109 scanned for a function prototype. If one is found it is used
110 for the next step of the process, code generation.
111 .IP \fB-t\fR
112 TRACE arguments (implies \fB-c\fR).
113 This option produces the same code as \fB-c\fR, except that
114 arguments are printed out when the function is called.
115 Structs that are passed by value are printed as "struct",
116 and functions that take variable argument lists print "...".
117 .IP "\fB-f \fIdll\fR"
118 Forward calls to '\fIdll\fR' (implies \fB-t\fR).
119 This is the most complicated level of code generation. The
120 same code is generated as \fB-t\fR, however support is added for
121 forwarding calls to another DLL. The DLL to forward to is
122 given as '\fIdll\fR'.
123 .IP \fB-D\fR
124 Generate documentation.
125 By default, winedump generates a standard comment at the
126 header of each function it generates. Passing this option
127 makes winedump output a full header template for standard
128 Wine documentation, listing the parameters and return value
129 of the function.
130 .IP "\fB-o \fIname\fR"
131 Set the output dll name (default: \fIdll\fR).
132 By default, if winedump is run on DLL 'foo', it creates
133 files 'foo.spec', 'foo_main.c' etc, and prefixes any
134 functions generated with 'FOO_'.  If '-o bar' is given,
135 these will become 'bar.spec', 'bar_main.c' and 'BAR_'
136 respectively.
137 This option is mostly useful when generating a forwarding DLL.
138 .IP \fB-C\fR
139 Assume __cdecl calls (default: __stdcall).
140 If winebuild cannot determine the calling convention,
141 __stdcall is used by default, unless this option has
142 been given.
143 Unless \fB-q\fR is given, a warning will be printed for every
144 function that winedump determines the calling convention
145 for and which does not match the assumed calling convention.
146 .IP "\fB-s \fInum\fR"
147 Start prototype search after symbol '\fInum\fR'.
148 .IP "\fB-e \fInum\fR"
149 End prototype search after symbol '\fInum\fR'.
150 By passing the \fB-s\fR or \fB-e\fR options you can have winedump try to
151 generate code for only some functions in your DLL. This may
152 be used to generate a single function, for example, if you
153 wanted to add functionality to an existing DLL.
154 .IP "\fB-S \fIsymfile\fR"
155 Search only prototype names found in '\fIsymfile\fR'.
156 If you want to only generate code for a subset of exported
157 functions from your source DLL, you can use this option to
158 provide a text file containing the names of the symbols to
159 extract, one per line. Only the symbols present in this file
160 will be used in your output DLL.
161 .IP \fB-q\fR
162 Don't show progress (quiet).
163 No output is printed unless a fatal error is encountered.
164 .IP \fB-v\fR
165 Show lots of detail while working (verbose).
166 There are 3 levels of output while winedump is running. The
167 default level, when neither -q or -v are given, prints the
168 number of exported functions found in the dll, followed by
169 the name of each function as it is processed, and a status
170 indication of whether it was processed OK.  With -v given, a
171 lot of information is dumped while winedump works: this is
172 intended to help debug any problems.
173 .PP
174 .B Sym mode:
175 .IP \fI<sym>\fR
176 Demangles C++ symbol '\fI<sym>\fR' and then exits.
177 .SH FILES
178 .I function_grep.pl
179 .RS
180 Perl script used to retrieve a function prototype.
181 .RE
182 .PP
183 Files output in
184 .B spec mode
185 for
186 .I foo.dll:
187 .nf
188 .I foo.spec
189 .RS
190 This is the .spec file.
191 .RE
192 .I foo_dll.h
193 .nf
194 .I foo_main.c
195 .RS
196 These are the source code files containing the minimum set
197 of code to build a stub DLL. The C file contains one
198 function, FOO_Init, which does nothing (but must be
199 present).
200 .RE
201 .I Makefile.in
202 .RS
203 This is a template for 'configure' to produce a makefile. It
204 is designed for a DLL that will be inserted into the Wine
205 source tree.
206 .RE
207 .I foo_install
208 .RS
209 A shell script for adding
210 .I foo
211 to the Wine source tree.
212 .SH BUGS
213 C++ name demangling is currently under development. Since the
214 algorithm used is not documented, it must be decoded. Many simple
215 prototypes are already working however.
216 .SH AUTHORS
217 Jon P. Griffiths <jon_p_griffiths at yahoo dot com>
218 .nf
219 Michael Stefaniuc <mstefani at redhat dot com>
220 .SH "SEE ALSO"
221 .BR winedump "'s README file"
222 .nf
223 The Winelib User Guide
224 .nf
225 The Wine Developers Guide