- add documentation section to README
[wine] / documentation / configuring.sgml
1   <chapter id="configuring">
2     <title>Configuring Wine</title>
3     <para>Setting up config files, etc.</para>
4
5     <sect1 id="config">
6       <title>General Configuration</title>
7       <para>
8         Copyright 1999 &name-adam-sacarny; <email>&email-adam-sacarny;</email>
9       </para>
10       <para>
11         (Extracted from <filename>wine/documentation/config</filename>)
12       </para>
13
14       <sect2>
15         <title>The Wine Config File</title>
16         <para>
17           The Wine config file stores various settings for Wine. These include:
18           <itemizedlist>
19             <listitem>
20               <para>
21                 Drives and Information about them
22               </para>
23             </listitem>
24             <listitem>
25               <para>
26                 Directory Settings
27               </para>
28             </listitem>
29             <listitem>
30               <para>
31                 Port Settings
32               </para>
33             </listitem>
34             <listitem>
35               <para>
36                 The Wine look and feel
37               </para>
38             </listitem>
39             <listitem>
40               <para>
41                 Wine's DLL Usage
42               </para>
43             </listitem>
44             <listitem>
45               <para>
46                 Wine's Multimedia drivers and DLL configuration
47               </para>
48             </listitem>
49           </itemizedlist>
50         </para>
51       </sect2>
52
53       <sect2>
54         <title>How Do I Make One?</title>
55         <para>
56           This section will guide you through the process of making a
57           config file. Take a look at the file <filename>&lt;dirs to
58           wine>/documentation/samples/config</filename>. It is organized by section.
59         </para>
60
61         <informaltable frame="all">
62           <tgroup cols="3">
63             <thead>
64               <row>
65                 <entry>Section Name</entry>
66                 <entry>Needed?</entry>
67                 <entry>What it Does</entry>
68               </row>
69             </thead>
70             <tbody>
71               <row>
72                 <entry>[Drive X]</entry>
73                 <entry>yes</entry>
74                 <entry>Sets up drives recognized by wine</entry>
75               </row>
76               <row>
77                 <entry>[wine]</entry>
78                 <entry>yes</entry>
79                 <entry>Settings for wine directories</entry>
80               </row>
81               <row>
82                 <entry>[DllDefaults]</entry>
83                 <entry>recmd</entry>
84                 <entry>Defaults for loading DLL's</entry>
85               </row>
86               <row>
87                 <entry>[DllPairs]</entry>
88                 <entry>recmd</entry>
89                 <entry>Sanity checkers for DLL's</entry>
90               </row>
91               <row>
92                 <entry>[DllOverrides]</entry>
93                 <entry>recmd</entry>
94                 <entry>Overides defaults for DLL loading</entry>
95               </row>
96               <row>
97                 <entry>[x11drv]</entry>
98                 <entry>recmd</entry>
99                 <entry>Graphic driver settings</entry>
100               </row>
101               <row>
102                 <entry>[fonts]</entry>
103                 <entry>yes</entry>
104                 <entry>Font appearance and recognition</entry>
105               </row>
106               <row>
107                 <entry>[serialports]</entry>
108                 <entry>no</entry>
109                 <entry>COM ports seen by wine</entry>
110               </row>
111               <row>
112                 <entry>[parallelports]</entry>
113                 <entry>no</entry>
114                 <entry>LPT ports seen by wine</entry>
115               </row>
116               <row>
117                 <entry>[ppdev]</entry>
118                 <entry>no</entry>
119                 <entry>Parallelport emulation</entry>
120               </row>
121               <row>
122                 <entry>[spooler]</entry>
123                 <entry>no</entry>
124                 <entry>Print spooling</entry>
125               </row>
126               <row>
127                 <entry>[ports]</entry>
128                 <entry>no</entry>
129                 <entry>Direct port access</entry>
130               </row>
131               <row>
132                 <entry>[spy]</entry>
133                 <entry>no</entry>
134                 <entry>What to do with certain debug messages</entry>
135               </row>
136               <row>
137                 <entry>[Registry]</entry>
138                 <entry>no</entry>
139                 <entry>Specifies locations of windows registry files</entry>
140               </row>
141               <row>
142                 <entry>[tweak.layout]</entry>
143                 <entry>recmd</entry>
144                 <entry>Appearance of wine</entry>
145               </row>
146               <row>
147                 <entry>[programs]</entry>
148                 <entry>no</entry>
149                 <entry>Programs to be run automatically</entry>
150               </row>
151               <row>
152                 <entry>[Console]</entry>
153                 <entry>no</entry>
154                 <entry>Console settings</entry>
155               </row>
156               <row>
157                 <entry>[Clipboard]</entry>
158                 <entry>no</entry>
159                 <entry>Interaction for wine and X11 clipboard</entry>
160               </row>
161               <row>
162                 <entry>[afmdirs]</entry>
163                 <entry>no</entry>
164                 <entry>Postscript driver settings</entry>
165               </row>
166               <row>
167                 <entry>[WinMM]</entry>
168                 <entry>yes</entry>
169                 <entry>Multimedia settings</entry>
170               </row>
171               <row>
172                 <entry>[AppDefaults]</entry>
173                 <entry>no</entry>
174                 <entry>Overwrite the settings of previous sections for special programs</entry>
175               </row>
176             </tbody>
177           </tgroup>
178         </informaltable>
179
180         <sect3>
181           <title>The [Drive X] Section</title>
182           <para>
183             It should be pretty self explanatory, but here is an
184             in-depth tutorial about them. There are up to 6 lines for
185             each drive in Wine.
186           </para>
187           <para>
188             <programlisting>[Drive X]</programlisting>
189             The above line begins the section for a drive whose letter is X. 
190           </para>
191           <para>
192             <programlisting>Path=/dir/to/path</programlisting> This
193             path is where the drive will begin. When Wine is browsing
194             in drive X, it will see the files that are in the
195             directory <filename>/dir/to/path</filename>. Don't forget
196             to leave off the trailing slash!
197           </para>
198           <para>
199             <programlisting>"Type" = "floppy|hd|cdrom|network"</programlisting>
200             Sets up the type of drive Wine will see it as. Type must
201             equal one of the four <literal>floppy</literal>,
202             <literal>hd</literal>, <literal>cdrom</literal>, or
203             <literal>network</literal>. They are self-explanatory.
204             (The |'s mean "Type = '&lt;one of the options&gt;'".)
205           </para>
206           <para>
207             <programlisting>"Label" = "blah"</programlisting> Defines the
208             drive label. Generally only needed for programs that look
209             for a special CD-ROM. Info on finding the lable is in
210             <literal>&lt;dirs to wine>/documentation/cdrom-labels</literal>.
211             The label may be up to 11 characters.
212           </para>
213           <para>
214             <programlisting>"Serial" = "deadbeef"</programlisting>
215             Tells Wine the serial number of the drive. A few programs with
216             intense protection for pirating might need this, but otherwise
217             don't use it. Up to 8 characters and hexadecimal.
218           </para>
219           <para>
220             <programlisting>"Filesystem" = "msdos|win95|unix"</programlisting>
221             Sets up the way Wine looks at files on the drive.
222           </para>
223
224           <variablelist>
225             <varlistentry>
226               <term><literal>msdos</literal></term>
227               <listitem>
228                 <para>
229                   Case insensitive filesystem. Alike to DOS and
230                   Windows 3.x. <literal>8.3</literal> is the maximum
231                   length of files (eightdot.123) - longer ones will be
232                   truncated. (NOTE: this is a very bad choice if you
233                   plan on running apps that use long filenames. win95
234                   should work fine with apps that were designed to run
235                   under the msdos system. In other words, you might
236                   not want to use this.)
237                 </para>
238               </listitem>
239             </varlistentry>
240             <varlistentry>
241               <term><literal>win95</literal></term>
242               <listitem>
243                 <para>
244                   Case insensitive. Alike to Windows 9x/NT 4. This is
245                   the long filename filesystem you are probably used
246                   to working with. The filesystem of choice for most
247                   applications to be run under wine.  PROBABLY THE ONE
248                   YOU WANT!
249                 </para>
250               </listitem>
251             </varlistentry>
252             <varlistentry>
253               <term><literal>unix</literal></term>
254               <listitem>
255                 <para>
256                   Case sensitive. This filesystem has almost no use
257                   (Windows apps expect case insensitive filenames).
258                   Try it if you dare, but win95 is a  much better
259                   choice.
260                 </para>
261               </listitem>
262             </varlistentry>
263           </variablelist>
264
265           <programlisting>"Device" = "/dev/xx"</programlisting>
266           <para>
267             Use this ONLY for floppy and cdrom devices. Using it on
268             Extended2 partitions can have dire results (when a windows
269             app tries to do a lowlevel write, they do it in a FAT way
270             -- FAT does not mix with Extended2).
271           </para>
272           <note>
273             <para>
274               This setting is not really important; almost all apps
275               will have no problem if it remains unspecified. For
276               CD-ROMs you might want to add it to get automatic label
277               detection, though. If you are unsure about specifying
278               device names, just leave out this setting for your
279               drives.
280             </para>
281           </note>
282           <para>
283             Here is a setup for Drive X, a generic hard drive:
284             <programlisting>
285 [Drive X]
286 "Path" = "/dos-a"
287 "Type" = "hd"
288 "Label" = "Hard Drive"
289 "Filesystem" = "win95"
290 This is a setup for Drive X, a generic CD-ROM drive:
291 [Drive X]
292 "Path" = "/dos-d"
293 "Type" = "cdrom"
294 "Label" = "Total Annihilation"
295 "Filesystem" = "win95"
296 "Device" = "/dev/hdc"
297 And here is a setup for Drive X, a generic floppy drive:
298 [Drive X]
299 "Type" = "floppy"
300 "Path" = "/mnt/floppy"
301 "Label" = "Floppy Drive"
302 "Serial" = "87654321"
303 "Filesystem" = "win95"
304 "Device" = "/dev/fd0"
305             </programlisting>
306           </para>
307         </sect3>
308
309         <sect3>
310           <title>The [wine] Section </title>
311           <para>
312             The [wine] section of the configuration file contains all kinds
313             of general settings for Wine. When specifying the directories
314             for the directory related settings, make them as they would
315             appear in wine. If your drive <medialabel>C</medialabel>
316             has a path of <filename>/dos</filename>, and your
317             <filename>windows</filename> directory is located in
318             <filename>/dos/windows</filename>, then use:
319             <programlisting>"Windows" = "c:\\windows"</programlisting>
320           </para>
321           <para>
322             This sets up the <filename>windows</filename> directory.
323             Make one if you don't already have one. NO TRAILING SLASH
324             (NOT <filename>C:\\windows\</filename>)!
325           </para>
326           <para>
327             <programlisting>"System" = "c:\\windows\\system"</programlisting>
328             This sets up where the windows system files are. Should
329             reside in the directory used for the
330             <literal>Windows</literal> setting. If you don't have
331             <filename>windows</filename> then this is where the system
332             files will go. Again, NO TRAILING SLASH!
333           </para>
334           <para>
335             <programlisting>"Temp" = "c:\\temp"</programlisting> This should
336             be the directory you want your temp files stored in. YOU
337             MUST HAVE WRITE ACCESS TO IT.
338           </para>
339           <para>
340             <programlisting>
341 "Path" = "c:\\windows;c:\\windows\\system;c:\\blanco"
342             </programlisting>
343           </para>
344           <para>
345             Behaves like the <envar>PATH</envar> setting on UNIX
346             boxes. When wine is run like <userinput>wine
347               sol.exe</userinput>, if <filename>sol.exe</filename>
348             resides in a directory specified in the
349             <literal>Path</literal> setting, wine will run it (Of
350             course, if <filename>sol.exe</filename> resides in the
351             current directory, wine will run that one). Make sure it
352             always has your <filename>windows</filename> directory and
353             system directory (For this setup, it must have
354             <filename>"c:\\windows;c:\\windows\\system"</filename>).
355           </para>
356           <para>
357             <programlisting>"GraphicsDriver" = "x11drv|ttydrv"</programlisting>
358             Sets the graphics driver to use for Wine output.
359             x11drv is for X11 output, ttydrv is for text console output.
360             WARNING: if you use ttydrv here, then you won't be able to run
361             any Windows GUI programs. Thus this option is mainly interesting
362             for e.g. embedded use of Wine in web server scripts.
363           </para>
364           <para>
365             <programlisting>"Printer" = "off|on"</programlisting> Tells wine
366             whether to allow printing via printer drivers to work.
367             This option isn't needed for our builtin psdrv printer driver
368             at all.
369             Using these things are pretty alpha, so you might want to
370             watch out. Some people might find it useful, however. If
371             you're not planning on working on printing via windows printer
372             drivers, don't even add this to your wine config file
373             (It probably isn't already in it).
374             Check out the [spooler] and [parallelports] sections too.
375           </para>
376           <para>
377             <programlisting>"ShellLinker" = "wineshelllink"</programlisting>
378             This setting specifies the shell linker script to use for setting
379             up Windows icons in e.g. KDE or Gnome that are given by programs
380             making use of appropriate shell32.dll functionality to create
381             icons on the desktop/start menu during installation.
382           </para>
383           <para>
384             <programlisting>"ShowDirSymlinks" = "1"</programlisting>
385             Wine doesn't pass directory symlinks to Windows programs by
386             default, as doing so may crash some programs that do
387             recursive lookups of whole subdirectory trees
388             whenever a directory symlink points back to itself or one of its
389             parent directories.
390             That's why we disallowed the use of directory symlinks
391             and added this setting to reenable ("1") this functionality.
392           </para>
393           <para>
394             <programlisting>"SymbolTableFile" = "wine.sym"</programlisting>
395             Sets up the symbol table file for the wine debugger. You
396             probably don't need to fiddle with this. May be useful if
397             your wine is stripped.
398           </para>
399         </sect3>
400
401         <sect3>
402           <title>Introduction To DLL Sections</title>
403           <para>
404             There are a few things you will need to know before
405             configuring the DLL sections in your wine configuration
406             file.
407           </para>
408           <sect4>
409             <title>Windows DLL Pairs</title>
410             <para>
411               Most windows DLL's have a win16 (Windows 3.x) and win32
412               (Windows 9x/NT) form.  The combination of the win16 and
413               win32 DLL versions are called the "DLL pair". This is a
414               list of the most common pairs:
415             </para>
416
417             <informaltable>
418               <tgroup cols="3">
419                 <thead>
420                   <row>
421                     <entry>Win16</entry>
422                     <entry>Win32</entry>
423                     <entry>
424                       Native
425                       <footnote>
426                         <para>
427                           Is it possible to use native dll with wine?
428                           (See next section)
429                         </para>
430                       </footnote>
431                     </entry>
432                   </row>
433                 </thead>
434                 <tbody>
435                   <row>
436                     <entry>KERNEL</entry>
437                     <entry>KERNEL32</entry>
438                     <entry>No!</entry>
439                   </row>
440                   <row>
441                     <entry>USER</entry>
442                     <entry>USER32</entry>
443                     <entry>No!</entry>
444                   </row>
445                   <row>
446                     <entry>SHELL</entry>
447                     <entry>SHELL32</entry>
448                     <entry>Yes</entry>
449                   </row>
450                   <row>
451                     <entry>GDI</entry>
452                     <entry>GDI32</entry>
453                     <entry>No!</entry>
454                   </row>
455                   <row>
456                     <entry>COMMDLG</entry>
457                     <entry>COMDLG32</entry>
458                     <entry>Yes</entry>
459                   </row>
460                   <row>
461                     <entry>VER</entry>
462                     <entry>VERSION</entry>
463                     <entry>Yes</entry>
464                   </row>
465                 </tbody>
466               </tgroup>
467             </informaltable>
468           </sect4>
469
470           <sect4>
471             <title>Different Forms Of DLL's</title>
472             <para>
473               There are a few different forms of DLL's wine can load:
474               <variablelist>
475                 <varlistentry>
476                   <term>native</term>
477                   <listitem><para>
478                       The DLL's that are included with windows. Many
479                       windows DLL's can be loaded in their native
480                       form. Many times these native versions work
481                       better than their non-Microsoft equivalent --
482                       other times they don't.
483                     </para></listitem>
484                 </varlistentry>
485                 <varlistentry>
486                   <term>elfdll</term>
487                   <listitem><para>
488                       ELF encapsulated windows DLL's. This is currently
489                       experimental (Not working yet).
490                     </para></listitem>
491                 </varlistentry>
492                 <varlistentry>
493                   <term>so</term>
494                   <listitem><para>
495                       Native ELF libraries. Will not work yet.
496                     </para></listitem>
497                 </varlistentry>
498                 <varlistentry>
499                   <term>builtin</term>
500                   <listitem><para>
501                       The most common form of DLL loading. This is
502                       what you will use if the DLL is error-prone in
503                       native form (KERNEL for example), you don't have
504                       the native DLL, or you just want to be
505                       Microsoft-free.
506                     </para></listitem>
507                 </varlistentry>
508               </variablelist>
509             </para>
510           </sect4>
511         </sect3>
512
513         <sect3>
514           <title>The [DllDefaults] Section</title>
515           <para>
516             These settings provide wine's default handling of DLL loading.
517           </para>
518           <para>
519             <programlisting>"DefaultLoadOrder" =" native, so, builtin"</programlisting>
520           </para>
521           <para>
522             This setting is a comma-delimited list of the order in
523             which to attempt loading DLLs. If the first option fails,
524             it will try the second, and so on. The order specified
525             above is probably the best in most conditions.
526           </para>
527         </sect3>
528
529         <sect3>
530           <title>The [DllPairs] Section</title>
531           <para>
532           At one time, there was a section called [DllPairs] in the 
533           default configuration file, but this has been obsoleted
534           because the pairing information has now been embedded into
535           Wine itself. (The purpose of this section was merely to be
536           able to issue warnings if the user attempted to pair
537           codependent 16-bit/32-bit DLLs of different types.) If you
538           still have this in your <filename>wine.conf</filename> or
539           <filename>~/.wine/config</filename>, you may safely delete it.
540           </para>
541         </sect3>
542
543         <sect3>
544           <title>The [DllOverrides] Section</title>
545           <para>
546             The format for this section is the same for each line:
547             <programlisting>
548 &lt;DLL>{,&lt;DLL>,&lt;DLL>...} = &lt;FORM>{,&lt;FORM>,&lt;FORM>...}
549             </programlisting>
550           </para>
551           <para>
552             For example, to load builtin KERNEL pair (case doesn't
553             matter here):
554             <programlisting>
555 "kernel,kernel32" = "builtin"
556             </programlisting>
557           </para>
558           <para>
559             To load the native COMMDLG pair, but if that doesn't work
560             try builtin:
561             <programlisting>
562 "commdlg,comdlg32" = "native,builtin"
563             </programlisting>
564           </para>
565           <para>
566             To load the native COMCTL32:
567             <programlisting>
568 "comctl32" = "native"
569             </programlisting>
570           </para>
571           <para>
572             Here is a good generic setup (As it is defined in config
573             that was included with your wine package):
574             <programlisting>
575 [DllOverrides]
576 "commdlg"      = "builtin, native"
577 "comdlg32"     = "builtin, native"
578 "ver"          = "builtin, native"
579 "version"      = "builtin, native"
580 "shell"        = "builtin, native"
581 "shell32"      = "builtin, native"
582 "lzexpand"     = "builtin, native"
583 "lz32"         = "builtin, native"
584 "comctl32"     = "builtin, native"
585 "commctrl"     = "builtin, native"
586 "wsock32"      = "builtin"
587 "winsock"      = "builtin"
588 "advapi32"     = "builtin, native"
589 "crtdll"       = "builtin, native"
590 "mpr"          = "builtin, native"
591 "winspool.drv" = "builtin, native"
592 "ddraw"        = "builtin, native"
593 "dinput"       = "builtin, native"
594 "dsound"       = "builtin, native"
595 "mmsystem"     = "builtin"
596 "winmm"        = "builtin"
597 "msvcrt"       = "native, builtin"
598 "msvideo"      = "builtin, native"
599 "msvfw32"      = "builtin, native"
600 "mcicda.drv"   = "builtin, native"
601 "mciseq.drv"   = "builtin, native"
602 "mciwave.drv"  = "builtin, native"
603 "mciavi.drv"   = "native, builtin"
604 "mcianim.drv"  = "native, builtin"
605 "msacm.drv"    = "builtin, native"
606 "msacm"        = "builtin, native"
607 "msacm32"      = "builtin, native"
608 "midimap.drv"  = "builtin, native"
609 "wnaspi32"     = "builtin"
610 "icmp"         = "builtin"
611             </programlisting>
612           </para>
613           <note>
614             <para>
615               You see that elfdll or so is the first option for a few
616               of these dll's. This will fail for you, but you won't
617               notice it as wine will just use the second or third
618               option.
619             </para>
620           </note>
621         </sect3>
622
623         <sect3>
624           <title>The [fonts] Section</title>
625           <para>
626             This section sets up wine's font handling.
627           </para>
628           <para>
629             <programlisting>"Resolution" = "96"</programlisting>
630           </para>
631           <para>
632             Since the way X handles fonts is different from the way
633             Windows does, wine uses a special mechanism to deal with
634             them. It must scale them using the number defined in the
635             "Resolution" setting. 60-120 are reasonable values, 96 is
636             a nice in the middle one. If you have the real windows
637             fonts available (<filename>&lt;dirs to
638               wine>/documentation/ttfserver</filename> and
639             <filename>fonts</filename>), this parameter will not be as
640             important. Of course, it's always good to get your X fonts
641             working acceptably in wine.
642           </para>
643           <para>
644             <programlisting>"Default" = "-adobe-times-"</programlisting>
645             The default font wine uses. Fool around with it if you'd like.
646           </para>
647           <para>
648 OPTIONAL: 
649           </para>
650           <para>
651             The <literal>Alias</literal> setting allows you to map an X font to a font
652             used in wine. This is good for apps that need a special font you don't have,
653             but a good replacement exists. The syntax is like so:
654             <programlisting>
655 "AliasX" = "[Fake windows name],[Real X name]"&lt;,optional "masking" section>
656             </programlisting>
657           </para>
658           <para>
659             Pretty straightforward. Replace "AliasX" with "Alias0",
660             then "Alias1" and so on. The fake windows name is the name
661             that the font will be under a windows app in wine. The
662             real X name is the font name as seen by X (Run
663             "xfontsel"). The optional "masking" section allows you to
664             utilize the fake windows name you define. If it is not
665             used, then wine will just try to extract the fake windows
666             name itself and not use the value you enter.
667           </para>
668           <para>
669             Here is an example of an alias without masking. The font will show up in windows
670             apps as "Google". When defining an alias in a config file, forget about my
671             comment text (The "&lt;-- blah" stuff)
672             <programlisting>
673 "Alias0" = "Foo,--google-"      &lt;
674             </programlisting>
675           </para>
676           <para>
677             Here is an example with masking enabled. The font will show up as "Foo" in
678             windows apps.
679             <programlisting>
680 "Alias1" = "Foo,--google-,subst"
681             </programlisting>
682           </para>
683           <para>
684             For more info check out <filename>&lt;dirs to wine>/documentation/fonts</filename>
685           </para>
686         </sect3>
687
688         <sect3>
689           <title>The [serialports], [parallelports], [spooler], and [ports] Sections</title>
690           <para>
691             Even though it sounds like a lot of sections, these are
692             all closely related. They are all for communications and
693             parallel ports. 
694           </para>
695           <para>
696             The [serialports] section tells wine what serial ports it
697             is allowed to use.
698             <programlisting>"ComX" = "/dev/cuaY"</programlisting>
699           </para>
700           <para>
701             Replace <literal>X</literal> with the number of the COM
702             port in Windows (1-8) and <literal>Y</literal> with the
703             number of it in <literal>X</literal> (Usually the number
704             of the port in Windows minus 1). <literal>ComX</literal>
705             can actually equal any device
706             (<medialabel>/dev/modem</medialabel> is acceptable). It is
707             not always necessary to define any COM ports (An optional
708             setting). Here is an example:
709             <programlisting>"Com1" = "/dev/cua0"</programlisting>
710           </para>
711           <para>
712             Use as many of these as you like in the section to define
713             all of the COM ports you need.
714           </para>
715           <para>
716             The [parallelports] section sets up any parallel ports
717             that will be allowed access under wine.
718             <programlisting>"LptX" = "/dev/lpY"</programlisting>
719           </para>
720           <para>
721             Sounds familiar? Syntax is just like the COM port setting.
722             Replace <literal>X</literal> with a value from 1-4 as it
723             is in Windows and <literal>Y</literal> with a value from
724             0-3 (<literal>Y</literal> is usually the value in windows
725             minus 1, just like for COM ports). You don't always need
726             to define a parallel port (AKA, it's optional). As with
727             the other section, LptX can equal  any device (Maybe
728             <medialabel>/dev/printer</medialabel>). Here is an
729             example:  <programlisting>"Lpt1" = "/dev/lp0"</programlisting>
730           </para>
731           <para>
732             The [spooler] section will inform wine where to spool
733             print jobs. Use this if you want to try printing. Wine
734             docs claim that spooling is "rather primitive" at this
735             time, so it won't work perfectly. IT IS OPTIONAL. The only
736             setting you use in this section works to map a port (LPT1,
737             for example) to a file or a command. Here is an example,
738             mapping LPT1 to the file <filename>out.ps</filename>: 
739             <programlisting>"LPT1:" = "out.ps"</programlisting>
740           </para>
741           <para>
742             The following command maps printing jobs to LPT1 to the
743             command <command>lpr</command>. Notice  the |: 
744             <programlisting>"LPT1:" = "|lpr"</programlisting>
745           </para>
746           <para>
747             The [ports] section is usually useful only for people who
748             need direct port access for programs requiring dongles or
749             scanners. IF YOU DON'T NEED IT, DON'T USE IT! 
750           </para>
751           <para>
752             <programlisting>"read" = "0x779,0x379,0x280-0x2a0"</programlisting>
753             Gives direct read access to those IO's.
754           </para>
755           <para>
756             <programlisting>"write" = "0x779,0x379,0x280-0x2a0"</programlisting>
757             Gives direct write access to those IO's. It's probably a
758             good idea to keep the values of the
759             <literal>read</literal> and <literal>write</literal>
760             settings the same. This stuff will only work when you're
761             root.
762           </para>
763         </sect3>
764
765         <sect3>
766           <title>The [spy], [Registry], [tweak.layout], and [programs] Sections</title>
767           <para>
768             [spy] is used to include or exclude debug messages, and to
769             output them to a file. The latter is rarely used. THESE
770             ARE ALL OPTIONAL AND YOU PROBABLY DON'T NEED TO ADD OR
771             REMOVE ANYTHING IN THIS SECTION TO YOUR CONFIG.
772           </para>
773           <para>
774             <programlisting>"File" = "/blanco"</programlisting>
775             Sets the logfile for wine. Set to CON to log to standard out.
776             THIS IS RARELY USED.
777           </para>
778           <para>
779             <programlisting>"Exclude" = "WM_SIZE;WM_TIMER;"</programlisting>
780             Excludes debug messages about <constant>WM_SIZE</constant>
781             and <constant>WM_TIMER</constant> in the logfile.
782           </para>
783           <para>
784             <programlisting>"Include" = "WM_SIZE;WM_TIMER;"</programlisting>
785             Includes debug messages about <constant>WM_SIZE</constant>
786             and <constant>WM_TIMER</constant> in the logfile.
787           </para>
788           <para>
789             [Registry] can be used to tell wine where your old windows
790             registry files exist. This section is completely optional
791             and useless to people using wine without an existing
792             windows installation.
793           </para>
794           <para>
795             <programlisting>"UserFileName" = "/dirs/to/user.reg"</programlisting>
796             The location of your old <filename>user.reg</filename> file.
797           </para>
798           <para>
799             [tweak.layout] is devoted to wine's look. There is only
800             one setting for it.
801           </para>
802           <para>
803             <programlisting>"WineLook" = "win31|win95|win98"</programlisting>
804             Will change the look of wine from Windows 3.1 to Windows 95.
805             The <literal>win98</literal> setting behaves
806             just like <literal>win95</literal> most of the time.
807           </para>
808           <para>
809             [programs] can be used to say what programs run under
810             special conditions.
811           </para>
812           <para>
813             <programlisting>"Default" = "/program/to/execute.exe"</programlisting>
814             Sets the program to be run if wine is started without specifying a program.
815           </para>
816           <para>
817             <programlisting>"Startup" = "/program/to/execute.exe"</programlisting>
818             Sets the program to automatically be run at startup every time.
819           </para>
820         </sect3>
821
822         <sect3>
823           <title>The [WinMM] Section</title>
824           <para>
825             [WinMM] is used to define which multimedia drivers have to be loaded. Since
826             those drivers may depend on the multimedia interfaces available on your sustem
827             (OSS, Alsa... to name a few), it's needed to be able to configure which driver
828             has to be loaded.
829           </para>
830
831           <para>
832             The content of the section looks like:
833             <programlisting> 
834 [WinMM]
835 "Drivers" = "wineoss.drv"
836 "WaveMapper" = "msacm.drv"
837 "MidiMapper" = "midimap.drv"
838             </programlisting> 
839             All the keys must be defined:
840             <itemizedlist>
841               <listitem>
842                 <para>
843                   The "Drivers" key is a ';' separated list of modules name, each of 
844                   them containing a low level driver. All those drivers will be loaded 
845                   when MMSYSTEM/WINMM is started and will provide their inner features.
846                 </para>
847               </listitem>
848               <listitem>
849                 <para>
850                   The "WaveMapper" represents the name of the module containing the Wave
851                   Mapper driver. Only one wave mapper can be defined in the system.
852                 </para>
853               </listitem>
854               <listitem>
855                 <para>
856                   The "MidiMapper" represents the name of the module containing the Midi 
857                   Mapper driver. Only one Midi mapper can be defined in the system.
858                 </para>
859               </listitem>
860             </itemizedlist>
861           </para>
862         </sect3>
863
864         <sect3>
865           <title>The [AppDefaults] Section</title>
866           <para>
867             The section is used to overwrite the setting of this file for a
868             special program with different settings.
869             [AppDefaults] is not the real name of the section. The real name
870             consists of the leading word AppDefaults followed by the name 
871             of the executable the section is valid for. The end of the section
872             name is the name of the section of the configuration file its 
873             values should be overwritten with different settings. The three 
874             parts of the section name are separated by two backslashes.
875           </para>
876           <para>
877             Currently wine supports only overwriting the sections 
878             [DllOverrides] and [x11drv].
879           </para>
880           <para>
881             Here is an example that overwrites the normal settings for a
882             program:
883             <programlisting> 
884 ;; default settings
885 [x11drv]
886 "Managed" = "Y"
887 "Desktop" = "N"
888
889 ;; run install in desktop mode
890 [AppDefaults\\install.exe\\x11drv]
891 "Managed" = "N"
892 "Desktop" = "800x600"
893             </programlisting> 
894           </para>
895         </sect3>
896       </sect2>
897
898       <sect2>
899         <title>Where Do I Put It?</title>
900         <para>
901           The wine config file can go in two places.
902         </para>
903         <variablelist>
904           <varlistentry>
905             <term><filename>/usr/local/etc/wine.conf</filename></term>
906             <listitem><para>
907                 A systemwide config file, used for anyone who doesn't
908                 have their own. NOTE: this file is currently unused as a
909                 new global configuration mechanism is not in place at this
910                 time
911             </para></listitem>
912           </varlistentry>
913           <varlistentry>
914             <term><filename>$HOME/.wine/config</filename></term>
915             <listitem><para>
916                 Your own config file, that only is used for your user. 
917             </para></listitem>
918           </varlistentry>
919         </variablelist>
920         <para>
921           So copy your version of the <filename>wine.conf</filename> file to
922           <filename>/usr/local/etc/wine.conf</filename> or
923           <filename>$HOME/.wine/config</filename> for wine to recognize
924           it. 
925         </para>
926       </sect2>
927
928       <sect2>
929         <title>What If It Doesn't Work?</title>
930         <para>
931           There is always a chance that things will go wrong. If the
932           unthinkable happens,  try the newsgroup,
933           <systemitem>comp.emulators.ms-windows.wine</systemitem>,
934           or the IRCnet channel <systemitem>#WineHQ</systemitem> found on
935           irc.stealth.net:6668,  or connected servers.
936           Make sure that you have looked over this document thoroughly,
937           and have also read:
938         </para>
939         <itemizedlist>
940           <listitem>
941             <para><filename>README</filename></para>
942           </listitem>
943           <listitem>
944             <para>
945               <filename>http://www.la-sorciere.de/wine/index.html</filename>
946               (optional but recommended)
947             </para>
948           </listitem>
949         </itemizedlist>
950         <para>
951           If indeed it looks like you've done your research, be
952           prepared for helpful suggestions. If you haven't, brace
953           yourself for heaving flaming.
954         </para>
955       </sect2>
956     </sect1>
957
958     <sect1 id="win95look">
959       <title>Win95/98 Look</title>
960       <para>
961         Written by &name-david-cuthbert; <email>&email-david-cuthbert;</email>
962       </para>
963       <para>
964         (Extracted from <filename>wine/documentation/win95look</filename>)
965       </para>
966       <para>
967         Win95/Win98 interface code is being introduced.
968       </para>
969       <para>
970         Instead of compiling Wine for Win3.1 vs. Win95 using
971         <constant>#define</constant> switches, the code now looks in a
972         special [Tweak.Layout] section of
973         <filename>~/.wine/config</filename> for a
974         <literal>"WineLook" = "Win95"</literal> or
975         <literal>"WineLook" = "Win98"</literal> entry.
976       </para>
977       <para>
978         A few new sections and a number of entries have been added to
979         the <filename>~/.wine/config</filename> file -- these are for
980         debugging the Win95 tweaks only and may be removed in a future
981         release!  These entries/sections are:
982       </para>
983       <programlisting>
984 [Tweak.Fonts]
985 "System.Height" = "&lt;point size>"    # Sets the height of the system typeface
986 "System.Bold" = "[true|false]"      # Whether the system font should be boldfaced
987 "System.Italic" = "[true|false]"    # Whether the system font should be italicized
988 "System.Underline" = "[true|false]" # Whether the system font should be underlined
989 "System.StrikeOut" = "[true|false]" # Whether the system font should be struck out
990 "OEMFixed.xxx"                  # Same parameters for the OEM fixed typeface
991 "AnsiFixed.xxx"                 # Same parameters for the Ansi fixed typeface
992 "AnsiVar.xxx"                   # Same parameters for the Ansi variable typeface
993 "SystemFixed.xxx"               # Same parameters for the System fixed typeface
994
995 [Tweak.Layout]
996 "WineLook" = "[Win31|Win95|Win98]"  # Changes Wine's look and feel
997       </programlisting>
998     </sect1>
999
1000     <sect1 id="x11drv">
1001       <title>Configuring the x11drv Driver</title>
1002
1003       <para>
1004         Written by &name-ove-kaaven; <email>&email-ove-kaaven;</email>
1005       </para>
1006       <para>
1007         (Extracted from <filename>wine/documentation/x11drv</filename>)
1008       </para>
1009
1010       <para>
1011         Most Wine users run Wine under the windowing system known as
1012         X11. During most of Wine's history, this was the only display
1013         driver available, but in recent years, parts of Wine has been
1014         reorganized to allow for other display drivers (although the
1015         only alternative currently available is Patrik Stridvall's
1016         ncurses-based ttydrv, which he claims works for displaying
1017         calc.exe). The display driver is chosen with the
1018         <literal>GraphicsDriver</literal> option in the [wine] section
1019         of <filename>~/.wine/config</filename>, but I will only cover the
1020         x11drv driver in this article.
1021       </para>
1022
1023       <sect2>
1024         <title>x11drv modes of operation</title>
1025
1026         <para>
1027           <!-- FIXME: This is outdated -->
1028           Note: This is now all done in the config file. Needs an update...
1029         </para>
1030
1031         <para>
1032           The x11drv driver consists of two conceptually distinct
1033           pieces, the graphics driver (GDI part), and the windowing
1034           driver (USER part). Both of these are linked into the
1035           <filename>libx11drv.so</filename> module, though (which you
1036           load with the <literal>GraphicsDriver</literal> option). In
1037           Wine, running on X11, the graphics driver must draw on
1038           drawables (window interiors) provided by the windowing
1039           driver. This differs a bit from the Windows model, where the
1040           windowing system creates and configures device contexts
1041           controlled by the graphics driver, and applications are
1042           allowed to hook into this relationship anywhere they like.
1043           Thus, to provide any reasonable tradeoff between
1044           compatibility and usability, the x11drv has three different
1045           modes of operation.
1046         </para>
1047
1048         <variablelist>
1049           <varlistentry>
1050             <term>Unmanaged/Normal</term>
1051             <listitem>
1052               <para>
1053                 The default. Window-manager-independent (any running
1054                 window manager is ignored completely). Window
1055                 decorations (title bars, borders, etc) are drawn by
1056                 Wine to look and feel like the real Windows. This is
1057                 compatible with applications that depend on being able
1058                 to compute the exact sizes of any such decorations, or
1059                 that want to draw their own.
1060               </para>
1061             </listitem>
1062           </varlistentry>          
1063           <varlistentry>
1064             <term>Managed</term>
1065             <listitem>
1066               <para>
1067                 Specified by using the
1068                 <parameter>--managed</parameter> command-line option
1069                 or the <literal>Managed</literal>
1070                 <filename>wine.conf</filename> option (see below).
1071                 Ordinary top-level frame windows with thick borders,
1072                 title bars, and system menus will be managed by your
1073                 window manager. This lets these applications integrate
1074                 better with the rest of your desktop, but may not
1075                 always work perfectly. (A rewrite of this mode of
1076                 operation, to make it more robust and less patchy, is
1077                 highly desirable, though, and is planned to be done
1078                 before the Wine 1.0 release.)
1079               </para>
1080             </listitem>
1081           </varlistentry>
1082           <varlistentry>
1083             <term>Desktop-in-a-Box</term>
1084             <listitem>
1085               <para>
1086                 Specified by using the
1087                 <parameter>--desktop</parameter> command-line option
1088                 (with a geometry, e.g. <parameter>--desktop
1089                   800x600</parameter> for a such-sized desktop, or
1090                 even <parameter>--desktop 800x600+0+0</parameter> to
1091                 automatically position the desktop at the upper-left
1092                 corner of the display). This is the mode most
1093                 compatible with the Windows model. All application
1094                 windows will just be Wine-drawn windows inside the
1095                 Wine-provided desktop window (which will itself be
1096                 managed by your window manager), and Windows
1097                 applications can roam freely within this virtual
1098                 workspace and think they own it all, without
1099                 disturbing your other X apps.
1100               </para>
1101             </listitem>
1102           </varlistentry>
1103         </variablelist>
1104       </sect2>
1105
1106       <sect2>
1107         <title>The [x11drv] section</title>
1108
1109         <variablelist>
1110           <varlistentry>
1111             <term>AllocSystemColors</term>
1112             <listitem>
1113               <para>
1114                 Applies only if you have a palette-based display, i.e.
1115                 if your X server is set to a depth of 8bpp, and if you
1116                 haven't requested a private color map. It specifies
1117                 the maximum number of shared colormap cells (palette
1118                 entries) Wine should occupy. The higher this value,
1119                 the less colors will be available to other
1120                 applications.
1121               </para>
1122             </listitem>
1123           </varlistentry>          
1124           <varlistentry>
1125             <term>PrivateColorMap</term>
1126             <listitem>
1127               <para>
1128                 Applies only if you have a palette-based display, i.e.
1129                 if your X server is set to a depth of 8bpp. It
1130                 specifies that you don't want to use the shared color
1131                 map, but a private color map, where all 256 colors are
1132                 available. The disadvantage is that Wine's private
1133                 color map is only seen while the mouse pointer is
1134                 inside a Wine window, so psychedelic flashing and
1135                 funky colors will become routine if you use the mouse
1136                 a lot.
1137               </para>
1138             </listitem>
1139           </varlistentry>          
1140           <varlistentry>
1141             <term>PerfectGraphics</term>
1142             <listitem>
1143               <para>
1144                 This option only determines whether fast X11 routines
1145                 or exact Wine routines will be used for certain ROP
1146                 codes in blit operations. Most users won't notice any
1147                 difference.
1148               </para>
1149             </listitem>
1150           </varlistentry>          
1151           <varlistentry>
1152             <term>ScreenDepth</term>
1153             <listitem>
1154               <para>
1155                 Applies only to multi-depth displays. It specifies
1156                 which of the available depths Wine should use (and
1157                 tell Windows apps about).
1158               </para>
1159             </listitem>
1160           </varlistentry>          
1161           <varlistentry>
1162             <term>Display</term>
1163             <listitem>
1164               <para>
1165                 This specifies which X11 display to use, and if
1166                 specified, will override both the
1167                 <envar>DISPLAY</envar> environment variable and the
1168                 <parameter>--display</parameter> command-line option.
1169               </para>
1170             </listitem>
1171           </varlistentry>          
1172           <varlistentry>
1173             <term>Managed</term>
1174             <listitem>
1175               <para>
1176                 Wine can let frame windows be managed by your window
1177                 manager. This option specifies whether you want that
1178                 by default.
1179               </para>
1180             </listitem>
1181           </varlistentry>          
1182           <varlistentry>
1183             <term>UseDGA</term>
1184             <listitem>
1185               <para>
1186                 This specifies whether you want DirectDraw to use
1187                 XFree86's <firstterm>Direct Graphics
1188                   Architecture</firstterm> (DGA), which is able to
1189                 take over the entire display and run the game
1190                 full-screen at maximum speed. (With DGA1 (XFree86
1191                 3.x), you still have to configure the X server to the
1192                 game's requested bpp first, but with DGA2 (XFree86
1193                 4.x), runtime depth-switching may be possible,
1194                 depending on your driver's capabilities.) But be aware
1195                 that if Wine crashes while in DGA mode, it may not be
1196                 possible to regain control over your computer without
1197                 rebooting. DGA normally requires either root
1198                 privileges or read/write access to
1199                 <filename>/dev/mem</filename>.
1200               </para>
1201             </listitem>
1202           </varlistentry>          
1203           <varlistentry>
1204             <term>UseXShm</term>
1205             <listitem>
1206               <para>
1207                 If you don't want DirectX to use DGA, you can at least
1208                 use X Shared Memory extensions (XShm). It is much
1209                 slower than DGA, since the app doesn't have direct
1210                 access to the physical frame buffer, but using shared
1211                 memory to draw the frame is at least faster than
1212                 sending the data through the standard X11 socket, even
1213                 though Wine's XShm support is still known to crash
1214                 sometimes.
1215               </para>
1216             </listitem>
1217           </varlistentry>          
1218           <varlistentry>
1219             <term>DXGrab</term>
1220             <listitem>
1221               <para>
1222                 If you don't use DGA, you may want an alternative
1223                 means to convince the mouse cursor to stay within the
1224                 game window. This option does that. Of course, as with
1225                 DGA, if Wine crashes, you're in trouble (although not
1226                 as badly as in the DGA case, since you can still use
1227                 the keyboard to get out of X).
1228               </para>
1229             </listitem>
1230           </varlistentry>          
1231           <varlistentry>
1232             <term>DesktopDoubleBuffered</term>
1233             <listitem>
1234               <para>
1235                 Applies only if you use the
1236                 <parameter>--desktop</parameter> command-line option
1237                 to run in a desktop window. Specifies whether to
1238                 create the desktop window with a double-buffered
1239                 visual, something most OpenGL games need to run
1240                 correctly.
1241               </para>
1242             </listitem>
1243           </varlistentry>
1244           <varlistentry>
1245             <term>TextCP</term>
1246             <listitem>
1247               <para>
1248                 <!-- FIXME: To be documented -->
1249                 To be documented...
1250               </para>
1251             </listitem>
1252           </varlistentry>
1253           <varlistentry>
1254             <term>XVideoPort</term>
1255             <listitem>
1256               <para>
1257                 <!-- FIXME: To be documented -->
1258                 To be documented...
1259               </para>
1260             </listitem>
1261           </varlistentry>
1262           <varlistentry>
1263             <term>Synchronous</term>
1264             <listitem>
1265               <para>
1266                 <!-- FIXME: To be documented -->
1267                 To be documented...
1268               </para>
1269             </listitem>
1270           </varlistentry>
1271         </variablelist>
1272       </sect2>          
1273     </sect1>
1274
1275     &registry;
1276
1277     <sect1 id="cdrom-labels">
1278       <sect1info>
1279         <authorgroup>
1280           <author>
1281             <firstname>Petr</firstname>
1282             <surname>Tomasek</surname>
1283             <affiliation>
1284               <address><email>&email-petr-tomasek;</email></address>
1285             </affiliation>
1286             <contrib>Nov 14 1999</contrib>
1287           </author>
1288           <author>
1289             <firstname>Andreas</firstname>
1290             <surname>Mohr</surname>
1291             <affiliation>
1292               <address><email>&email-andreas-mohr;</email></address>
1293             </affiliation>
1294             <contrib>Jan 25 2000</contrib>
1295           </author>
1296         </authorgroup>
1297       </sect1info>
1298
1299       <title>Drive labels and serial numbers with wine</title>
1300       <para>
1301         Written by &name-petr-tomasek; <email>&email-petr-tomasek;</email>
1302         Nov 14 1999
1303       </para>
1304       <para>
1305         Changes by &name-andreas-mohr; <email>&email-andreas-mohr;</email>
1306         Jan 25 2000
1307       </para>
1308       <para>
1309         (Extracted from <filename>wine/documentation/cdrom-labels</filename>)
1310       </para>
1311       <para>
1312         Until now, your only possibility of specifying drive volume
1313         labels and serial numbers was to set them manually in the wine
1314         config file. By now, wine can read them directly from the
1315         device as well. This may be useful for many Win 9x games or
1316         for setup programs distributed on CD-ROMs that check for
1317         volume label.
1318       </para>
1319
1320       <sect2>
1321         <title>What's Supported?</title>
1322
1323         <informaltable frame="all">
1324           <tgroup cols="3">
1325             <thead>
1326               <row>
1327                 <entry>File System</entry>
1328                 <entry>Types</entry>
1329                 <entry>Comment</entry>
1330               </row>
1331             </thead>
1332             <tbody>
1333               <row>
1334                 <entry>FAT systems</entry>
1335                 <entry>hd, floppy</entry>
1336                 <entry>reads labels and serial numbers</entry>
1337               </row>
1338               <row>
1339                 <entry>ISO9660</entry>
1340                 <entry>cdrom</entry>
1341                 <entry>reads labels and serial numbers (not mixed-mode CDs yet !)</entry>
1342               </row>
1343             </tbody>
1344           </tgroup>
1345         </informaltable>
1346
1347       </sect2>
1348
1349       <sect2>
1350         <title>How To Set Up?</title>
1351         <para>
1352           Reading labels and serial numbers just works automagically
1353           if you specify a <literal>Device=</literal> line in the
1354           [Drive X] section in your <filename>~/.wine/config</filename>.
1355           Note that the device has to exist and must be accessible if
1356           you do this, though.
1357         </para>
1358         <para>
1359           If you don't do that, then you should give fixed
1360           <literal>"Label" =</literal> or <literal>"Serial" =</literal>
1361           entries in <filename>~./wine/config</filename>, as Wine returns
1362           these entries instead if no device is given. If they don't
1363           exist, then Wine will return default values (label
1364           <literal>Drive X</literal> and serial
1365           <literal>12345678</literal>).
1366         </para>
1367         <para>
1368           If you want to give a <literal>"Device" =</literal> entry
1369           <emphasis>only</emphasis> for drive raw sector accesses,
1370           but not for reading the volume info from the device (i.e. you want
1371           a <emphasis>fixed</emphasis>, preconfigured label), you need
1372           to specify <literal>"ReadVolInfo" = "0"</literal> to tell Wine
1373           to skip the volume reading.
1374         </para>
1375       </sect2>
1376
1377       <sect2>
1378         <title>EXAMPLES</title>
1379         <para>
1380           Here's a simple example of cdrom and floppy; labels will be
1381           read from the device on both cdrom and floppy; serial
1382           numbers on floppy only:
1383         </para>
1384         <screen>
1385 [Drive A]
1386 "Path" = "/mnt/floppy"
1387 "Type" = "floppy"
1388 "Device" = "/dev/fd0"
1389 "Filesystem" = "msdos"
1390
1391 [Drive R]
1392 "Path" = "/mnt/cdrom"
1393 "Type" = "cdrom"
1394 "Device" = "/dev/hda1"
1395 "Filesystem" = "win95"
1396         </screen>
1397         <para>
1398           Here's an example of overriding the CD-ROM label:
1399         </para>
1400         <screen>
1401 [Drive J]
1402 "Path" = "/mnt/cdrom"
1403 "Type" = "cdrom"
1404 "Label" = "X234GCDSE"
1405 ; note that the device isn't really needed here as we have a fixed label
1406 "Device" = "/dev/cdrom"
1407 "Filesystem" = "msdos"
1408         </screen>
1409       </sect2>
1410
1411       <sect2>
1412         <title>Todo / Open Issues</title>
1413         <itemizedlist>
1414           <listitem> <para>
1415               The cdrom label can be read only if the data track of
1416               the disk resides in the first track and the cdrom is
1417               iso9660.
1418             </para> </listitem>
1419           <listitem> <para>
1420               Better checking for FAT superblock (it now checks only
1421               one byte). </para>
1422           </listitem>
1423           <listitem> <para>
1424               Support for labels/serial nums WRITING.
1425             </para> </listitem>
1426           <listitem> <para>
1427               Can the label be longer than 11 chars? (iso9660 has 32
1428               chars).
1429             </para> </listitem>
1430           <listitem> <para>
1431               What about reading ext2 volume label? ....
1432             </para> </listitem>
1433         </itemizedlist>
1434       </sect2>
1435     </sect1>
1436
1437     <sect1 id="dll-config">
1438       <title>DLL configuration</title>
1439       <sect2 id="dll-overrides">
1440         <title>DLL Overrides</title>
1441   
1442         <para>
1443           Written by &name-ove-kaaven; <email>&email-ove-kaaven;</email>
1444         </para>
1445         <para>
1446           (Extracted from <filename>wine/documentation/dll-overrides</filename>)
1447         </para>
1448   
1449         <para>
1450           The <filename>wine.conf</filename> directives [DllDefaults]
1451           and [DllOverrides] are the subject of some confusion. The
1452           overall purpose of most of these directives are clear enough,
1453           though - given a choice, should Wine use its own built-in
1454           DLLs, or should it use <filename>.DLL</filename> files found
1455           in an existing Windows installation? This document explains
1456           how this feature works.
1457         </para>
1458   
1459         <sect3>
1460           <title>DLL types</title>
1461           <variablelist>
1462             <varlistentry>
1463               <term>native</term>
1464               <listitem> <para>
1465                   A "native" DLL is a <filename>.DLL</filename> file
1466                   written for the real Microsoft Windows.
1467                 </para> </listitem>
1468             </varlistentry>
1469             <varlistentry>
1470               <term>builtin</term>
1471               <listitem> <para>
1472                   A "builtin" DLL is a Wine DLL. These can either be a
1473                   part of <filename>libwine.so</filename>, or more
1474                   recently, in a special <filename>.so</filename> file
1475                   that Wine is able to load on demand.
1476                 </para> </listitem>
1477             </varlistentry>
1478             <varlistentry>
1479               <term>elfdll</term>
1480               <listitem> <para>
1481                   An "elfdll" is a Wine <filename>.so</filename> file
1482                   with a special Windows-like file structure that is as
1483                   close to Windows as possible, and that can also
1484                   seamlessly link dynamically with "native" DLLs, by
1485                   using special ELF loader and linker tricks. Bertho
1486                   Stultiens did some work on this, but this feature has
1487                   not yet been merged back into Wine (because of
1488                   political reasons and lack of time), so this DLL type
1489                   does not exist in the official Wine at this time. In
1490                   the meantime, the "builtin" DLL type gained some of
1491                   the features of elfdlls (such as dynamic loading), so
1492                   it's possible that "elfdll" functionality will be
1493                   folded into "builtin" at some point.
1494                 </para> </listitem>
1495             </varlistentry>
1496             <varlistentry>
1497               <term>so</term>
1498               <listitem> <para>
1499                   A native Unix <filename>.so</filename> file, with
1500                   calling convention conversion thunks generated on the
1501                   fly as the library is loaded. This is mostly useful
1502                   for libraries such as "glide" that have exactly the
1503                   same API on both Windows and Unix.
1504                 </para> </listitem>
1505             </varlistentry>
1506           </variablelist>          
1507         </sect3>
1508   
1509         <sect3>
1510           <title>The [DllDefaults] section</title>
1511           <variablelist>
1512             <varlistentry>
1513               <term>DefaultLoadOrder</term>
1514               <listitem> <para>
1515                   This specifies in what order Wine should search for
1516                   available DLL types, if the DLL in question was not
1517                   found in the [DllOverrides] section.
1518                 </para> </listitem>
1519             </varlistentry>
1520           </variablelist>
1521         </sect3>
1522   
1523         <sect3>
1524           <title>The [DllPairs] section</title>
1525           <para>
1526             At one time, there was a section called [DllPairs] in the
1527             default configuration file, but this has been obsoleted
1528             because the pairing information has now been embedded into
1529             Wine itself. (The purpose of this section was merely to be
1530             able to issue warnings if the user attempted to pair
1531             codependent 16-bit/32-bit DLLs of different types.) If you
1532             still have this in your <filename>wine.conf</filename> or
1533             <filename>~/.wine/config</filename>, you may safely delete it.
1534           </para>
1535         </sect3>
1536   
1537         <sect3>
1538           <title>The [DllOverrides] section</title>
1539           <para>
1540             This section specifies how you want specific DLLs to be
1541             handled, in particular whether you want to use "native" DLLs
1542             or not, if you have some from a real Windows configuration.
1543             Because builtins do not mix seamlessly with native DLLs yet,
1544             certain DLL dependencies may be problematic, but workarounds
1545             exist in Wine for many popular DLL configurations. Also see
1546             WWN's [16]Status Page to figure out how well your favorite
1547             DLL is implemented in Wine.
1548           </para>
1549           <para>
1550             It is of course also possible to override these settings by
1551             explictly using Wine's <parameter>--dll</parameter>
1552             command-line option (see the man page for details).  Some
1553             hints for choosing your optimal configuration (listed by
1554             16/32-bit DLL pair):
1555           </para>
1556           <variablelist>
1557             <varlistentry>
1558               <term>krnl386, kernel32</term>
1559               <listitem> <para>
1560                   Native versions of these will never work, so don't try. Leave
1561                   at <literal>builtin</literal>.
1562                 </para> </listitem>
1563             </varlistentry>
1564             <varlistentry>
1565               <term>gdi, gdi32</term>
1566               <listitem> <para>
1567                   Graphics Device Interface. No effort has been made at trying to
1568                   run native GDI. Leave at <literal>builtin</literal>.
1569                 </para> </listitem>
1570             </varlistentry>          
1571             <varlistentry>
1572               <term>user, user32</term>
1573               <listitem> <para>
1574                   Window management and standard controls. It was
1575                   possible to use Win95's <literal>native</literal>
1576                   versions at some point (if all other DLLs that depend
1577                   on it, such as comctl32 and comdlg32, were also run
1578                   <literal>native</literal>). However, this is no longer
1579                   possible after the Address Space Separation, so leave
1580                   at <literal>builtin</literal>.
1581                 </para> </listitem>
1582             </varlistentry>
1583             <varlistentry>
1584               <term>ntdll</term>
1585               <listitem> <para>
1586                   NT kernel API. Although badly documented, the
1587                   <literal>native</literal> version of this will never
1588                   work. Leave at <literal>builtin</literal>.
1589                 </para> </listitem>
1590             </varlistentry>
1591             <varlistentry>
1592               <term>w32skrnl</term>
1593               <listitem> <para>
1594                   Win32s (for Win3.x). The <literal>native</literal>
1595                   version will probably never work. Leave at
1596                   <literal>builtin</literal>.
1597                 </para> </listitem>
1598             </varlistentry>
1599             <varlistentry>
1600               <term>wow32</term>
1601               <listitem> <para>
1602                   Win16 support library for NT. The
1603                   <literal>native</literal> version will probably never
1604                   work. Leave at <literal>builtin</literal>.
1605                 </para> </listitem>
1606             </varlistentry>
1607             <varlistentry>
1608               <term>system</term>
1609               <listitem> <para>
1610                   Win16 kernel stuff. Will never work
1611                   <literal>native</literal>. Leave at
1612                   <literal>builtin</literal>.
1613                 </para> </listitem>
1614             </varlistentry>          
1615             <varlistentry>
1616               <term>display</term>
1617               <listitem> <para>
1618                   Display driver. Definitely leave at <literal>builtin</literal>.
1619                 </para> </listitem>
1620             </varlistentry>
1621             <varlistentry>
1622               <term>toolhelp</term>
1623               <listitem> <para>
1624                   Tool helper routines. This is rarely a source of problems.
1625                   Leave at <literal>builtin</literal>.
1626                 </para> </listitem>
1627             </varlistentry>
1628             <varlistentry>
1629               <term>ver, version</term>
1630               <listitem> <para>
1631                   Versioning. Seldom useful to mess with.
1632                 </para> </listitem>
1633             </varlistentry>
1634             <varlistentry>
1635               <term>advapi32</term>
1636               <listitem> <para>
1637                   Registry and security features. Trying the
1638                   <literal>native</literal> version of this may or may
1639                   not work.
1640                 </para> </listitem>
1641             </varlistentry>
1642             <varlistentry>
1643               <term>commdlg, comdlg32</term>
1644               <listitem> <para>
1645                   Common Dialogs, such as color picker, font dialog,
1646                   print dialog, open/save dialog, etc. It is safe to try
1647                   <literal>native</literal>.
1648                 </para> </listitem>
1649             </varlistentry>
1650             <varlistentry>
1651               <term>commctrl, comctl32</term>
1652               <listitem> <para>
1653                   Common Controls. This is toolbars, status bars, list controls,
1654                   the works. It is safe to try <literal>native</literal>.
1655                 </para> </listitem>
1656             </varlistentry>
1657             <varlistentry>
1658               <term>shell, shell32</term>
1659               <listitem> <para>
1660                   Shell interface (desktop, filesystem, etc). Being one of the
1661                   most undocumented pieces of Windows, you may have luck with the
1662                   <literal>native</literal> version, should you need it.
1663                 </para> </listitem>
1664             </varlistentry>          
1665             <varlistentry>
1666               <term>winsock, wsock32</term>
1667               <listitem> <para>
1668                   Windows Sockets. The <literal>native</literal> version
1669                   will not work under Wine, so leave at
1670                   <literal>builtin</literal>.
1671                 </para> </listitem>
1672             </varlistentry>
1673             <varlistentry>
1674               <term>icmp</term>
1675               <listitem> <para>
1676                   ICMP routines for wsock32. As with wsock32, leave at
1677                   <literal>builtin</literal>.
1678                 </para> </listitem>
1679             </varlistentry>
1680             <varlistentry>
1681               <term>mpr</term>
1682               <listitem> <para>
1683                   The <literal>native</literal> version may not work due
1684                   to thunking issues. Leave at
1685                   <literal>builtin</literal>.
1686                 </para> </listitem>
1687             </varlistentry>
1688             <varlistentry>
1689               <term>lzexpand, lz32</term>
1690               <listitem> <para>
1691                   Lempel-Ziv decompression. Wine's
1692                   <literal>builtin</literal> version ought to work fine.
1693                 </para> </listitem>
1694             </varlistentry>
1695             <varlistentry>
1696               <term>winaspi, wnaspi32</term>
1697               <listitem> <para>
1698                   Advanced SCSI Peripheral Interface. The
1699                   <literal>native</literal> version will probably never
1700                   work. Leave at <literal>builtin</literal>.
1701                 </para> </listitem>
1702             </varlistentry>
1703             <varlistentry>
1704               <term>crtdll</term>
1705               <listitem> <para>
1706                   C Runtime library. The <literal>native</literal>
1707                   version will easily work better than Wine's on this
1708                   one.
1709                 </para> </listitem>
1710             </varlistentry>
1711             <varlistentry>
1712               <term>winspool.drv</term>
1713               <listitem> <para>
1714                   Printer spooler. You are not likely to have more luck
1715                   with the <literal>native</literal> version.
1716                 </para> </listitem>
1717             </varlistentry>
1718             <varlistentry>
1719               <term>ddraw</term>
1720               <listitem> <para>
1721                   DirectDraw/Direct3D. Since Wine does not implement the
1722                   DirectX HAL, the <literal>native</literal> version
1723                   will not work at this time.
1724                 </para> </listitem>
1725             </varlistentry>
1726             <varlistentry>
1727               <term>dinput</term>
1728               <listitem> <para>
1729                   DirectInput. Running this <literal>native</literal>
1730                   may or may not work.
1731                 </para> </listitem>
1732             </varlistentry>          
1733             <varlistentry>
1734               <term>dsound</term>
1735               <listitem> <para>
1736                   DirectSound. It may be possible to run this
1737                   <literal>native</literal>, but don't count on it.
1738                 </para> </listitem>
1739             </varlistentry>
1740             <varlistentry>
1741               <term>dplay/dplayx</term>
1742               <listitem> <para>
1743                   DirectPlay. The <literal>native</literal> version
1744                   ought to work best on this, if at all.
1745                 </para> </listitem>
1746             </varlistentry>
1747             <varlistentry>
1748               <term>mmsystem, winmm</term>
1749               <listitem> <para>
1750                   Multimedia system. The <literal>native</literal>
1751                   version is not likely to work. Leave at
1752                   <literal>builtin</literal>.
1753                 </para> </listitem>
1754             </varlistentry>
1755             <varlistentry>
1756               <term>msacm, msacm32</term>
1757               <listitem> <para>
1758                   Audio Compression Manager. The
1759                   <literal>builtin</literal> version works best, if you
1760                   set msacm.drv to the same.
1761                 </para> </listitem>
1762             </varlistentry>
1763             <varlistentry>
1764               <term>msvideo, msvfw32</term>
1765               <listitem> <para>
1766                   Video for Windows. It is safe (and recommended) to try
1767                   <literal>native</literal>.
1768                 </para> </listitem>
1769             </varlistentry>
1770             <varlistentry>
1771               <term>mcicda.drv</term>
1772               <listitem> <para>
1773                   CD Audio MCI driver.
1774                 </para> </listitem>
1775             </varlistentry>
1776             <varlistentry>
1777               <term>mciseq.drv</term>
1778               <listitem> <para>
1779                   MIDI Sequencer MCI driver (<filename>.MID</filename>
1780                   playback).
1781                 </para> </listitem>
1782             </varlistentry>
1783             <varlistentry>
1784               <term>mciwave.drv</term>
1785               <listitem> <para>
1786                   Wave audio MCI driver (<filename>.WAV</filename> playback).
1787                 </para> </listitem>
1788             </varlistentry>
1789             <varlistentry>
1790               <term>mciavi.drv</term>
1791               <listitem> <para>
1792                   AVI MCI driver (<filename>.AVI</filename> video
1793                   playback). Best to use <literal>native</literal>.
1794                 </para> </listitem>
1795             </varlistentry>
1796             <varlistentry>
1797               <term>mcianim.drv</term>
1798               <listitem> <para>
1799                   Animation MCI driver.
1800                 </para> </listitem>
1801             </varlistentry>
1802             <varlistentry>
1803               <term>msacm.drv</term>
1804               <listitem> <para>
1805                   Audio Compression Manager. Set to same as msacm32.
1806                 </para> </listitem>
1807             </varlistentry>
1808             <varlistentry>
1809               <term>midimap.drv</term>
1810               <listitem> <para>
1811                   MIDI Mapper.
1812                 </para> </listitem>
1813             </varlistentry>
1814             <varlistentry>
1815               <term>wprocs</term>
1816               <listitem> <para>
1817                   This is a pseudo-DLL used by Wine for thunking
1818                   purposes. A <literal>native</literal> version of this
1819                   doesn't exist.
1820                 </para> </listitem>
1821             </varlistentry>
1822           </variablelist>          
1823         </sect3>
1824       </sect2>
1825       <sect2 id="dll-missing">
1826         <title>Missing DLLs</title>
1827   
1828         <para>
1829           Written by &name-andreas-mohr; <email>&email-andreas-mohr;</email>
1830         </para>
1831   
1832         <para>
1833           In case Wine complains about a missing DLL, you should check whether
1834           this file is a publicly available DLL or a custom DLL belonging
1835           to your program (by searching for its name on the internet).
1836           If you managed to get hold of the DLL, then you should make sure
1837           that Wine is able to find and load it.
1838           DLLs usually get loaded according to the mechanism of the
1839           SearchPath() function.
1840           This function searches directories in the following order:
1841           
1842           a) The directory the program was started from.
1843           b) The current directory.
1844           c) The Windows system directory.
1845           d) The Windows directory.
1846           e) The PATH variable directories.
1847           
1848           In short: either put the required DLL into your application
1849           directory (might be ugly), or usually put it into the Windows system
1850           directory. Just find out its directory by having a look at the Wine
1851           config File variable "System" (which indicates the location of the
1852           Windows system directory) and the associated drive entry.
1853         </para>
1854       </sect2>
1855     </sect1>
1856
1857     <sect1 id="keyboard">
1858       <title>Keyboard</title>
1859
1860       <para>
1861         Written by &name-ove-kaaven; <email>&email-ove-kaaven;</email>
1862       </para>
1863       <para>
1864         (Extracted from <filename>wine/documentation/keyboard</filename>)
1865       </para>
1866
1867       <para>
1868         Wine now needs to know about your keyboard layout. This
1869         requirement comes from a need from many apps to have the
1870         correct scancodes available, since they read these directly,
1871         instead of just taking the characters returned by the X
1872         server. This means that Wine now needs to have a mapping from
1873         X keys to the scancodes these applications expect.
1874       </para>
1875       <para>
1876         On startup, Wine will try to recognize the active X layout by
1877         seeing if it matches any of the defined tables. If it does,
1878         everything is alright. If not, you need to define it.
1879       </para>
1880       <para>
1881         To do this, open the file
1882         <filename>windows/x11drv/keyboard.c</filename> and take a look
1883         at the existing tables. Make a backup copy of it, especially
1884         if you don't use CVS.
1885       </para>
1886       <para>
1887         What you really would need to do, is find out which scancode
1888         each key needs to generate.  Find it in the
1889         <function>main_key_scan</function> table, which looks like
1890         this:
1891       </para>
1892       <programlisting>
1893 static const int main_key_scan[MAIN_LEN] =
1894 {
1895 /* this is my (102-key) keyboard layout, sorry if it doesn't quite match yours */
1896    0x29,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,
1897    0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,
1898    0x1E,0x1F,0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x2B,
1899    0x2C,0x2D,0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35,
1900    0x56 /* the 102nd key (actually to the right of l-shift) */
1901 };
1902       </programlisting>
1903       <para>
1904         Next, assign each scancode the characters imprinted on the
1905         keycaps. This was done (sort of) for the US 101-key keyboard,
1906         which you can find near the top in
1907         <filename>keyboard.c</filename>. It also shows that if there
1908         is no 102nd key, you can skip that.
1909       </para>
1910       <para>
1911         However, for most international 102-key keyboards, we have
1912         done it easy for you. The scancode layout for these already
1913         pretty much matches the physical layout in the
1914         <function>main_key_scan</function>, so all you need to do is
1915         to go through all the keys that generate characters on your
1916         main keyboard (except spacebar), and stuff those into an
1917         appropriate table. The only exception is that the 102nd key,
1918         which is usually to the left of the first key of the last line
1919         (usually <keycap>Z</keycap>), must be placed on a separate
1920         line after the last line.
1921       </para>
1922       <para>
1923         For example, my Norwegian keyboard looks like this
1924       </para>
1925       <screen>
1926 §  !  "  #  ¤  %  &  /  (  )  =  ?  `  Back-
1927 |  1  2@ 3£ 4$ 5  6  7{ 8[ 9] 0} +  \´ space
1928
1929 Tab Q  W  E  R  T  Y  U  I  O  P  Å  ^
1930                                      ¨~
1931                                         Enter
1932 Caps A  S  D  F  G  H  J  K  L  Ø  Æ  *
1933 Lock                                  '
1934
1935 Sh- > Z  X  C  V  B  N  M  ;  :  _  Shift
1936 ift &lt;                      ,  .  -
1937
1938 Ctrl  Alt       Spacebar       AltGr  Ctrl
1939       </screen>
1940       <para>
1941         Note the 102nd key, which is the <keycap>&lt;></keycap> key, to
1942         the left of <keycap>Z</keycap>. The character to the right of
1943         the main character is the character generated by
1944         <keycap>AltGr</keycap>.
1945       </para>
1946       <para>
1947         This keyboard is defined as follows:
1948       </para>
1949       <programlisting>
1950 static const char main_key_NO[MAIN_LEN][4] =
1951 {
1952  "|§","1!","2\"@","3#£","4¤$","5%","6&","7/{","8([","9)]","0=}","+?","\\´",
1953  "qQ","wW","eE","rR","tT","yY","uU","iI","oO","pP","åÅ","¨^~",
1954  "aA","sS","dD","fF","gG","hH","jJ","kK","lL","øØ","æÆ","'*",
1955  "zZ","xX","cC","vV","bB","nN","mM",",;",".:","-_",
1956  "&lt;>"
1957 };   
1958       </programlisting>
1959       <para>
1960         Except that " and \ needs to be quoted with a backslash, and
1961         that the 102nd key is on a separate line, it's pretty
1962         straightforward.
1963       </para>
1964       <para>
1965         After you have written such a table, you need to add it to the
1966         <function>main_key_tab[]</function> layout index table. This
1967         will look like this:
1968       </para>
1969       <programlisting>
1970 static struct {
1971  WORD lang, ansi_codepage, oem_codepage;
1972  const char (*key)[MAIN_LEN][4];
1973 } main_key_tab[]={
1974 ...
1975 ...
1976  {MAKELANGID(LANG_NORWEGIAN,SUBLANG_DEFAULT),  1252, 865, &amp;main_key_NO},  
1977 ...
1978       </programlisting>
1979       <para>
1980         After you have added your table, recompile Wine and test that
1981         it works. If it fails to detect your table, try running
1982       </para>
1983       <screen>
1984 wine --debugmsg +key,+keyboard >& key.log
1985       </screen>
1986       <para>
1987         and look in the resulting <filename>key.log</filename> file to
1988         find the error messages it gives for your layout.
1989       </para>
1990       <para>
1991         Note that the <constant>LANG_*</constant> and
1992         <constant>SUBLANG_*</constant> definitions are in
1993         <filename>include/winnls.h</filename>, which you might need to
1994         know to find out which numbers your language is assigned, and
1995         find it in the debugmsg output. The numbers will be
1996         <literal>(SUBLANG * 0x400 + LANG)</literal>, so, for example
1997         the combination <literal>LANG_NORWEGIAN (0x14)</literal> and
1998         <literal>SUBLANG_DEFAULT (0x1)</literal> will be (in hex)
1999         <literal>14 + 1*400 = 414</literal>, so since I'm Norwegian, I
2000         could look for <literal>0414</literal> in the debugmsg output
2001         to find out why my keyboard won't detect.
2002       </para>
2003       <para>
2004         Once it works, submit it to the Wine project. If you use CVS,
2005         you will just have to do
2006       </para>
2007       <screen>
2008 cvs -z3 diff -u windows/x11drv/keyboard.c > layout.diff
2009       </screen>
2010       <para>
2011         from your main Wine directory, then submit
2012         <filename>layout.diff</filename> to
2013         <email>wine-patches@winehq.com</email> along with a brief note
2014         of what it is.
2015       </para>
2016       <para>
2017         If you don't use CVS, you need to do
2018       </para>
2019       <screen>
2020 diff -u the_backup_file_you_made windows/x11drv/keyboard.c > layout.diff
2021       </screen>
2022       <para>
2023         and submit it as explained above.
2024       </para>
2025       <para>
2026         If you did it right, it will be included in the next Wine
2027         release, and all the troublesome applications (especially
2028         remote-control applications) and games that use scancodes will
2029         be happily using your keyboard layout, and you won't get those
2030         annoying fixme messages either.
2031       </para>
2032       <para>
2033         Good luck.
2034       </para>
2035     </sect1>
2036
2037     &fonts;
2038     &printing;
2039
2040   </chapter>
2041
2042 <!-- Keep this comment at the end of the file
2043 Local variables:
2044 mode: sgml
2045 sgml-parent-document:("wine-doc.sgml" "set" "book" "chapter" "")
2046 End:
2047 -->