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